remove setup.py, requirements.txt and refs
This commit is contained in:
@@ -2,7 +2,6 @@
|
|||||||
source = axolotl
|
source = axolotl
|
||||||
omit =
|
omit =
|
||||||
*/tests/*
|
*/tests/*
|
||||||
setup.py
|
|
||||||
|
|
||||||
[report]
|
[report]
|
||||||
exclude_lines =
|
exclude_lines =
|
||||||
|
|||||||
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
@@ -6,7 +6,7 @@ on:
|
|||||||
types: [opened, synchronize, reopened, ready_for_review]
|
types: [opened, synchronize, reopened, ready_for_review]
|
||||||
paths:
|
paths:
|
||||||
- '**.py'
|
- '**.py'
|
||||||
- 'requirements.txt'
|
- 'pyproject.toml'
|
||||||
- '.github/workflows/*.yml'
|
- '.github/workflows/*.yml'
|
||||||
- "*.[q]md"
|
- "*.[q]md"
|
||||||
- "examples/**/*.y[a]?ml"
|
- "examples/**/*.y[a]?ml"
|
||||||
|
|||||||
2
.github/workflows/multi-gpu-e2e.yml
vendored
2
.github/workflows/multi-gpu-e2e.yml
vendored
@@ -4,8 +4,6 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- 'tests/e2e/multigpu/**.py'
|
- 'tests/e2e/multigpu/**.py'
|
||||||
- 'requirements.txt'
|
|
||||||
- 'setup.py'
|
|
||||||
- 'pyproject.toml'
|
- 'pyproject.toml'
|
||||||
- '.github/workflows/multi-gpu-e2e.yml'
|
- '.github/workflows/multi-gpu-e2e.yml'
|
||||||
- 'src/axolotl/core/trainers/mixins/sequence_parallel.py'
|
- 'src/axolotl/core/trainers/mixins/sequence_parallel.py'
|
||||||
|
|||||||
12
.github/workflows/pypi.yml
vendored
12
.github/workflows/pypi.yml
vendored
@@ -46,20 +46,16 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
uv pip install --system wheel packaging==23.2
|
uv pip install --system wheel packaging==23.2
|
||||||
uv pip install --system --no-build-isolation -e .
|
uv pip install --system --no-build-isolation -e .[dev]
|
||||||
uv pip install --system -e .[dev]
|
|
||||||
|
|
||||||
- name: Extract tag name
|
- name: Extract tag name
|
||||||
id: tag
|
id: tag
|
||||||
run: echo ::set-output name=TAG_NAME::$(echo $GITHUB_REF | cut -d / -f 3)
|
run: echo ::set-output name=TAG_NAME::$(echo $GITHUB_REF | cut -d / -f 3)
|
||||||
|
|
||||||
- name: Update version in setup.py
|
- name: Build package
|
||||||
run: |
|
run: |
|
||||||
sed -i -E 's/version="([0-9.]+)",/version="${{ steps.tag.outputs.TAG_NAME }}",/g' setup.py
|
uv pip install --system build
|
||||||
|
python -m build
|
||||||
- name: Build a source dist
|
|
||||||
run: |
|
|
||||||
python setup.py sdist
|
|
||||||
|
|
||||||
- name: Publish package distributions to PyPI
|
- name: Publish package distributions to PyPI
|
||||||
uses: pypa/gh-action-pypi-publish@release/v1
|
uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
|
|||||||
14
.github/workflows/tests-nightly.yml
vendored
14
.github/workflows/tests-nightly.yml
vendored
@@ -52,13 +52,13 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
uv pip install --system torch==${{ matrix.pytorch_version }} torchvision
|
uv pip install --system torch==${{ matrix.pytorch_version }} torchvision
|
||||||
|
|
||||||
- name: Update requirements.txt
|
- name: Update pyproject.toml for nightly builds
|
||||||
run: |
|
run: |
|
||||||
sed -i 's#^transformers.*#transformers @ git+https://github.com/huggingface/transformers.git@main#' requirements.txt
|
sed -i 's#"transformers==.*"#"transformers @ git+https://github.com/huggingface/transformers.git@main"#' pyproject.toml
|
||||||
sed -i 's#^peft.*#peft @ git+https://github.com/huggingface/peft.git@main#' requirements.txt
|
sed -i 's#"peft==.*"#"peft @ git+https://github.com/huggingface/peft.git@main"#' pyproject.toml
|
||||||
sed -i 's#^accelerate.*#accelerate @ git+https://github.com/huggingface/accelerate.git@main#' requirements.txt
|
sed -i 's#"accelerate==.*"#"accelerate @ git+https://github.com/huggingface/accelerate.git@main"#' pyproject.toml
|
||||||
sed -i 's#^trl.*#trl @ git+https://github.com/huggingface/trl.git@main#' requirements.txt
|
sed -i 's#"trl==.*"#"trl @ git+https://github.com/huggingface/trl.git@main"#' pyproject.toml
|
||||||
sed -i 's#^datasets.*#datasets @ git+https://github.com/huggingface/datasets.git@main#' requirements.txt
|
sed -i 's#"datasets==.*"#"datasets @ git+https://github.com/huggingface/datasets.git@main"#' pyproject.toml
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
@@ -178,4 +178,4 @@ jobs:
|
|||||||
echo "CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }}" >> $GITHUB_ENV
|
echo "CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }}" >> $GITHUB_ENV
|
||||||
- name: Run tests job on Modal
|
- name: Run tests job on Modal
|
||||||
run: |
|
run: |
|
||||||
modal run -m cicd.multigpu
|
modal run cicd.multigpu
|
||||||
|
|||||||
8
.github/workflows/tests.yml
vendored
8
.github/workflows/tests.yml
vendored
@@ -7,7 +7,6 @@ on:
|
|||||||
- "main"
|
- "main"
|
||||||
paths:
|
paths:
|
||||||
- '**.py'
|
- '**.py'
|
||||||
- 'requirements.txt'
|
|
||||||
- 'pyproject.toml'
|
- 'pyproject.toml'
|
||||||
- '.github/workflows/*.yml'
|
- '.github/workflows/*.yml'
|
||||||
- 'cicd/cicd.sh'
|
- 'cicd/cicd.sh'
|
||||||
@@ -16,7 +15,6 @@ on:
|
|||||||
types: [opened, synchronize, reopened, ready_for_review]
|
types: [opened, synchronize, reopened, ready_for_review]
|
||||||
paths:
|
paths:
|
||||||
- '**.py'
|
- '**.py'
|
||||||
- 'requirements.txt'
|
|
||||||
- 'pyproject.toml'
|
- 'pyproject.toml'
|
||||||
- '.github/workflows/*.yml'
|
- '.github/workflows/*.yml'
|
||||||
- 'cicd/cicd.sh'
|
- 'cicd/cicd.sh'
|
||||||
@@ -261,7 +259,7 @@ jobs:
|
|||||||
echo "E2E_DOCKERFILE=${{ matrix.dockerfile || 'Dockerfile.jinja'}}" >> $GITHUB_ENV
|
echo "E2E_DOCKERFILE=${{ matrix.dockerfile || 'Dockerfile.jinja'}}" >> $GITHUB_ENV
|
||||||
- name: Run tests job on Modal
|
- name: Run tests job on Modal
|
||||||
run: |
|
run: |
|
||||||
modal run -m cicd.e2e_tests
|
modal run cicd.e2e_tests
|
||||||
|
|
||||||
docker-e2e-tests:
|
docker-e2e-tests:
|
||||||
if: >
|
if: >
|
||||||
@@ -326,7 +324,7 @@ jobs:
|
|||||||
echo "E2E_DOCKERFILE=${{ matrix.dockerfile || 'Dockerfile.jinja'}}" >> $GITHUB_ENV
|
echo "E2E_DOCKERFILE=${{ matrix.dockerfile || 'Dockerfile.jinja'}}" >> $GITHUB_ENV
|
||||||
- name: Run tests job on Modal
|
- name: Run tests job on Modal
|
||||||
run: |
|
run: |
|
||||||
modal run -m cicd.e2e_tests
|
modal run cicd.e2e_tests
|
||||||
|
|
||||||
docker-e2e-cleanup:
|
docker-e2e-cleanup:
|
||||||
runs-on: [self-hosted, modal]
|
runs-on: [self-hosted, modal]
|
||||||
@@ -370,4 +368,4 @@ jobs:
|
|||||||
echo "CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }}" >> $GITHUB_ENV
|
echo "CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }}" >> $GITHUB_ENV
|
||||||
- name: Run tests job on Modal
|
- name: Run tests job on Modal
|
||||||
run: |
|
run: |
|
||||||
modal run -m cicd.cleanup
|
modal run cicd.cleanup
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
FROM axolotlai/axolotl-cloud:main-py3.11-cu124-2.6.0
|
FROM axolotlai/axolotl-cloud:main-py3.11-cu124-2.6.0
|
||||||
|
|
||||||
COPY .runpod/requirements.txt /requirements.txt
|
COPY .runpod/requirements.txt /requirements.txt
|
||||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
|
||||||
python3 -m pip install --upgrade pip && \
|
/root/.local/bin/uv pip install --system -r /requirements.txt
|
||||||
python3 -m pip install --upgrade -r /requirements.txt
|
|
||||||
|
|
||||||
# Environment settings
|
# Environment settings
|
||||||
ARG BASE_VOLUME="/runpod-volume"
|
ARG BASE_VOLUME="/runpod-volume"
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
include requirements.txt
|
include pyproject.toml
|
||||||
include README.md
|
include README.md
|
||||||
include LICENSE
|
include LICENSE
|
||||||
include src/setuptools_axolotl_dynamic_dependencies.py
|
|
||||||
include src/axolotl/utils/chat_templates/templates/*.jinja
|
include src/axolotl/utils/chat_templates/templates/*.jinja
|
||||||
recursive-include axolotl *.py
|
recursive-include axolotl *.py
|
||||||
|
|||||||
@@ -24,11 +24,11 @@ RUN git fetch origin +$GITHUB_REF && \
|
|||||||
|
|
||||||
# If AXOLOTL_EXTRAS is set, append it in brackets
|
# If AXOLOTL_EXTRAS is set, append it in brackets
|
||||||
RUN if [ "$NIGHTLY_BUILD" = "true" ] ; then \
|
RUN if [ "$NIGHTLY_BUILD" = "true" ] ; then \
|
||||||
sed -i 's#^transformers.*#transformers @ git+https://github.com/huggingface/transformers.git@main#' requirements.txt; \
|
sed -i 's#"transformers==.*"#"transformers @ git+https://github.com/huggingface/transformers.git@main"#' pyproject.toml; \
|
||||||
sed -i 's#^peft.*#peft @ git+https://github.com/huggingface/peft.git@main#' requirements.txt; \
|
sed -i 's#"peft==.*"#"peft @ git+https://github.com/huggingface/peft.git@main"#' pyproject.toml; \
|
||||||
sed -i 's#^accelerate.*#accelerate @ git+https://github.com/huggingface/accelerate.git@main#' requirements.txt; \
|
sed -i 's#"accelerate==.*"#"accelerate @ git+https://github.com/huggingface/accelerate.git@main"#' pyproject.toml; \
|
||||||
sed -i 's#^trl.*#trl @ git+https://github.com/huggingface/trl.git@main#' requirements.txt; \
|
sed -i 's#"trl==.*"#"trl @ git+https://github.com/huggingface/trl.git@main"#' pyproject.toml; \
|
||||||
sed -i 's#^datasets.*#datasets @ git+https://github.com/huggingface/datasets.git@main#' requirements.txt; \
|
sed -i 's#"datasets==.*"#"datasets @ git+https://github.com/huggingface/datasets.git@main"#' pyproject.toml; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
RUN uv pip install packaging==23.2 setuptools==75.8.0
|
RUN uv pip install packaging==23.2 setuptools==75.8.0
|
||||||
|
|||||||
@@ -1,104 +0,0 @@
|
|||||||
"""
|
|
||||||
dynamic requirements for axolotl
|
|
||||||
"""
|
|
||||||
|
|
||||||
import platform
|
|
||||||
import re
|
|
||||||
from importlib.metadata import PackageNotFoundError, version
|
|
||||||
|
|
||||||
from setuptools.command.build_py import build_py as _build_py
|
|
||||||
|
|
||||||
|
|
||||||
def parse_requirements():
|
|
||||||
_install_requires = []
|
|
||||||
_dependency_links = []
|
|
||||||
with open("./requirements.txt", encoding="utf-8") as requirements_file:
|
|
||||||
lines = [r.strip() for r in requirements_file.readlines()]
|
|
||||||
for line in lines:
|
|
||||||
is_extras = (
|
|
||||||
"flash-attn" in line
|
|
||||||
or "flash-attention" in line
|
|
||||||
or "deepspeed" in line
|
|
||||||
or "mamba-ssm" in line
|
|
||||||
or "lion-pytorch" in line
|
|
||||||
)
|
|
||||||
if line.startswith("--extra-index-url"):
|
|
||||||
# Handle custom index URLs
|
|
||||||
_, url = line.split()
|
|
||||||
_dependency_links.append(url)
|
|
||||||
elif not is_extras and line and line[0] != "#":
|
|
||||||
# Handle standard packages
|
|
||||||
_install_requires.append(line)
|
|
||||||
|
|
||||||
try:
|
|
||||||
xformers_version = [req for req in _install_requires if "xformers" in req][0]
|
|
||||||
torchao_version = [req for req in _install_requires if "torchao" in req][0]
|
|
||||||
autoawq_version = [req for req in _install_requires if "autoawq" in req][0]
|
|
||||||
|
|
||||||
if "Darwin" in platform.system():
|
|
||||||
# don't install xformers on MacOS
|
|
||||||
_install_requires.pop(_install_requires.index(xformers_version))
|
|
||||||
else:
|
|
||||||
# detect the version of torch already installed
|
|
||||||
# and set it so dependencies don't clobber the torch version
|
|
||||||
try:
|
|
||||||
torch_version = version("torch")
|
|
||||||
except PackageNotFoundError:
|
|
||||||
torch_version = "2.5.1"
|
|
||||||
_install_requires.append(f"torch=={torch_version}")
|
|
||||||
|
|
||||||
version_match = re.match(r"^(\d+)\.(\d+)(?:\.(\d+))?", torch_version)
|
|
||||||
if version_match:
|
|
||||||
major, minor, patch = version_match.groups()
|
|
||||||
major, minor = int(major), int(minor)
|
|
||||||
patch = (
|
|
||||||
int(patch) if patch is not None else 0
|
|
||||||
) # Default patch to 0 if not present
|
|
||||||
else:
|
|
||||||
raise ValueError("Invalid version format")
|
|
||||||
|
|
||||||
if (major, minor) >= (2, 5):
|
|
||||||
_install_requires.pop(_install_requires.index(xformers_version))
|
|
||||||
if patch == 0:
|
|
||||||
_install_requires.append("xformers==0.0.28.post2")
|
|
||||||
else:
|
|
||||||
_install_requires.append("xformers==0.0.28.post3")
|
|
||||||
_install_requires.pop(_install_requires.index(autoawq_version))
|
|
||||||
elif (major, minor) >= (2, 4):
|
|
||||||
if patch == 0:
|
|
||||||
_install_requires.pop(_install_requires.index(xformers_version))
|
|
||||||
_install_requires.append("xformers>=0.0.27")
|
|
||||||
else:
|
|
||||||
_install_requires.pop(_install_requires.index(xformers_version))
|
|
||||||
_install_requires.append("xformers==0.0.28.post1")
|
|
||||||
elif (major, minor) >= (2, 3):
|
|
||||||
_install_requires.pop(_install_requires.index(torchao_version))
|
|
||||||
if patch == 0:
|
|
||||||
_install_requires.pop(_install_requires.index(xformers_version))
|
|
||||||
_install_requires.append("xformers>=0.0.26.post1")
|
|
||||||
else:
|
|
||||||
_install_requires.pop(_install_requires.index(xformers_version))
|
|
||||||
_install_requires.append("xformers>=0.0.27")
|
|
||||||
elif (major, minor) >= (2, 2):
|
|
||||||
_install_requires.pop(_install_requires.index(torchao_version))
|
|
||||||
_install_requires.pop(_install_requires.index(xformers_version))
|
|
||||||
_install_requires.append("xformers>=0.0.25.post1")
|
|
||||||
else:
|
|
||||||
_install_requires.pop(_install_requires.index(torchao_version))
|
|
||||||
_install_requires.pop(_install_requires.index(xformers_version))
|
|
||||||
_install_requires.append("xformers>=0.0.23.post1")
|
|
||||||
|
|
||||||
except PackageNotFoundError:
|
|
||||||
pass
|
|
||||||
return _install_requires, _dependency_links
|
|
||||||
|
|
||||||
|
|
||||||
class BuildPyCommand(_build_py):
|
|
||||||
"""
|
|
||||||
custom build_py command to parse dynamic requirements
|
|
||||||
"""
|
|
||||||
|
|
||||||
def finalize_options(self):
|
|
||||||
super().finalize_options()
|
|
||||||
install_requires, _ = parse_requirements()
|
|
||||||
self.distribution.install_requires = install_requires
|
|
||||||
Reference in New Issue
Block a user