This commit is contained in:
Dan Saunders
2025-08-29 22:54:21 -04:00
parent df870f6a8f
commit 89d5323c13
7 changed files with 16 additions and 27 deletions

View File

@@ -63,10 +63,9 @@ jobs:
- name: Install dependencies
run: |
uv pip show --system torch
uv pip install --system --no-build-isolation -U -e .
python scripts/unsloth_install.py --uv | sh
python scripts/cutcrossentropy_install.py --uv | sh
uv pip install --system -e .[dev]
uv pip install --system --no-build-isolation -U -e ".[dev]"
python scripts/unsloth_install.py | sh
python scripts/cutcrossentropy_install.py | sh
- name: Make sure PyTorch version wasn't clobbered
run: |

View File

@@ -84,10 +84,10 @@ jobs:
- name: Install dependencies
run: |
uv pip show --system torch
uv pip install --system --no-build-isolation -U -e .
python scripts/unsloth_install.py --uv | sh
python scripts/cutcrossentropy_install.py --uv | sh
uv pip install --system -e .[dev]
uv pip install --system wheel
uv pip install --system --no-build-isolation -U -e ".[dev]"
python scripts/unsloth_install.py | sh
python scripts/cutcrossentropy_install.py | sh
- name: Make sure PyTorch version wasn't clobbered
run: |
@@ -157,8 +157,8 @@ jobs:
uv pip show --system torch
uv pip install --system wheel
uv pip install --system --no-build-isolation -e .
python scripts/unsloth_install.py --uv | sh
python scripts/cutcrossentropy_install.py --uv | sh
python scripts/unsloth_install.py | sh
python scripts/cutcrossentropy_install.py | sh
uv pip install --system -e .[dev]
- name: Make sure PyTorch version wasn't clobbered
@@ -178,7 +178,6 @@ jobs:
pytest -v --durations=10 tests/monkeypatch/ --cov=axolotl --cov-append --cov-report=xml
pytest -v --durations=10 tests/cli/
gate-skip-e2e:
needs: [pre-commit, pytest, pytest-sdist]
runs-on: ubuntu-latest

View File

@@ -38,8 +38,8 @@ RUN if [ "$AXOLOTL_EXTRAS" != "" ] ; then \
uv pip install --no-build-isolation -e .[deepspeed,flash-attn,ring-flash-attn,optimizers,ray] $AXOLOTL_ARGS; \
fi
RUN python scripts/unsloth_install.py --uv | sh
RUN python scripts/cutcrossentropy_install.py --uv | sh
RUN python scripts/unsloth_install.py | sh
RUN python scripts/cutcrossentropy_install.py | sh
# So we can test the Docker image
RUN uv pip install -e .[dev]

View File

@@ -26,8 +26,8 @@ RUN if [ "$AXOLOTL_EXTRAS" != "" ] ; then \
else \
uv pip install --no-build-isolation -e .[deepspeed,flash-attn,ring-flash-attn,optimizers,ray] $AXOLOTL_ARGS; \
fi && \
python scripts/unsloth_install.py --uv | sh && \
python scripts/cutcrossentropy_install.py --uv | sh && \
python scripts/unsloth_install.py | sh && \
python scripts/cutcrossentropy_install.py | sh && \
uv pip install pytest
# fix so that git fetch/pull from remote works with shallow clone

View File

@@ -188,7 +188,6 @@ dev = [
# Utilities
"blobfile",
"tiktoken",
"wheel",
]
[project.scripts]

View File

@@ -9,8 +9,6 @@ except ImportError as exc:
raise ImportError("Install torch via `pip install torch`") from exc
from packaging.version import Version as V
USE_UV = "--uv" in sys.argv[1:]
v = V(torch.__version__)
# no cut-cross-entropy support for torch < 2.4.0
@@ -23,12 +21,9 @@ cce_spec = importlib.util.find_spec("cut_cross_entropy")
UNINSTALL_PREFIX = ""
if cce_spec:
if not importlib.util.find_spec("cut_cross_entropy.transformers"):
uninstall_cmd = "uv pip uninstall" if USE_UV else "pip"
UNINSTALL_PREFIX = f"{uninstall_cmd} uninstall -y cut-cross-entropy && "
UV_PREFIX = "uv " if USE_UV else ""
UNINSTALL_PREFIX = "uv pip uninstall -y cut-cross-entropy && "
print(
UNINSTALL_PREFIX
+ f'{UV_PREFIX}pip install "cut-cross-entropy[transformers] @ git+https://github.com/axolotl-ai-cloud/ml-cross-entropy.git@147ea28"'
+ 'uv pip install --system "cut-cross-entropy[transformers] @ git+https://github.com/axolotl-ai-cloud/ml-cross-entropy.git@c6a32c5"'
)

View File

@@ -7,8 +7,6 @@ except ImportError as error:
raise ImportError("Install torch via `pip install torch`") from error
from packaging.version import Version as V
use_uv = "--uv" in sys.argv[1:]
v = V(torch.__version__)
cuda = str(torch.version.cuda)
try:
@@ -34,7 +32,6 @@ elif v < V("2.6.0"):
else:
raise RuntimeError(f"Torch = {v} too new!")
x = x.format(cuda.replace(".", ""), "-ampere" if is_ampere else "")
uv_prefix = "uv " if use_uv else ""
print(
f'{uv_prefix}pip install unsloth-zoo==2024.12.1 && {uv_prefix}pip install --no-deps "unsloth[{x}]==2024.12.4"'
f'uv pip install --system unsloth-zoo==2024.12.1 && uv pip install --system --no-deps "unsloth[{x}]==2024.12.4"'
)