Skip to content

feat: move to uv first#3545

Open
NanoCode012 wants to merge 25 commits intomainfrom
feat/uv-static-deps
Open

feat: move to uv first#3545
NanoCode012 wants to merge 25 commits intomainfrom
feat/uv-static-deps

Conversation

@NanoCode012
Copy link
Copy Markdown
Collaborator

@NanoCode012 NanoCode012 commented Mar 25, 2026

Description

  • Generate lock file on GPU
  • Update docs

Also fixes some nightly, see issues #3545 (comment)

Motivation and Context

How has this been tested?

AI Usage Disclaimer

Screenshots (if appropriate)

Types of changes

Social Handles (Optional)

Summary by CodeRabbit

Release Notes

  • New Features

    • Added uv-based installation workflow for simplified dependency management; new Docker image variants with -uv tag now available.
  • Documentation

    • Updated installation guides to prioritize uv as the recommended package manager; added migration guide from pip to uv; revised Docker image documentation with -uv variant details.
  • Chores

    • Upgraded minimum PyTorch requirement to 2.9.0; restructured project dependency declarations and build configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 25, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 56c9d410-ee79-4288-a7d8-84533eb76e9e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR migrates the project from pip-based dependency management to uv-based workflow, consolidating dependency declarations from multiple requirements files into pyproject.toml, updating GitHub Actions workflows to use uv instead of pip, and updating installation documentation and examples accordingly.

Changes

Cohort / File(s) Summary
GitHub Actions Workflows
.github/workflows/lint.yml, .github/workflows/multi-gpu-e2e.yml, .github/workflows/tests.yml
Updated workflow path filters to trigger on pyproject.toml changes instead of requirements.txt/requirements-tests.txt, removing legacy dependency file monitoring.
GitHub Actions Workflows (uv Migration)
.github/workflows/pypi.yml, .github/workflows/tests-nightly.yml, .github/workflows/tests.yml
Added UV_SYSTEM_PYTHON=1 environment variable, replaced pip-based dependency installs with uv pip commands, setup astral-sh/setup-uv action, replaced requirements file installs with explicit uv package lists, and updated custom script invocations to pass --uv flag.
Package Configuration
pyproject.toml
Moved static dependency declarations from requirements files into explicit project.dependencies list, removed dynamic dependency parsing from project.dynamic, updated build-system.requires to drop packaging==26.0 pin, added [tool.uv] configuration with prerelease settings and extra conflict matrix, and added setuptools package discovery configuration.
Build System Cleanup
setup.py, src/setuptools_axolotl_dynamic_dependencies.py
Removed entire setup.py file and custom dynamic dependency parsing module, consolidating all packaging logic into pyproject.toml via uv.
Dependency Files
requirements.txt, requirements-dev.txt, requirements-tests.txt
Removed all contents from traditional pip requirements files; dependency management now handled via pyproject.toml and uv configuration.
Packaging Manifest
MANIFEST.in
Removed requirements.txt and src/setuptools_axolotl_dynamic_dependencies.py from manifest, removed recursive Python file inclusion, kept Jinja template includes.
Docker Configuration
cicd/Dockerfile.jinja, cicd/Dockerfile-uv.jinja
Replaced pip-based dev/test dependency installs from requirements-dev.txt and requirements-tests.txt with explicit uv pip install of curated tooling package lists (e.g., black, mypy, pre-commit, pytest*, codecov, jupyter).
Core Installation Documentation
README.md, docs/installation.qmd
Updated minimum PyTorch requirement to ≥2.9.0, replaced pip installation instructions with uv-based setup, updated CUDA backend selection examples to cu128/cu130, changed UV_TORCH_BACKEND examples, added "Migrating from pip to uv" guide, and retained pip as alternative fallback option.
Specialized Documentation
docs/debugging.qmd, docs/docker.qmd
Updated host/container setup examples to use uv sync with .venv activation, updated Docker image tag recommendations to PyTorch 2.9.1 variants, added -uv image variant documentation, and changed image references to corresponding uv variants.
Example READMEs (pip → uv pip)
examples/LiquidAI/README.md, examples/apertus/README.md, examples/arcee/README.md, examples/devstral/README.md, examples/gemma3n/README.md, examples/gpt-oss/README.md, examples/granite4/README.md, examples/hunyuan/README.md, examples/internvl3_5/README.md, examples/magistral/README.md, examples/magistral/vision/README.md, examples/ministral3/README.md, examples/ministral3/vision/README.md, examples/mistral-small/README.md, examples/mistral4/README.md, examples/qwen3-next/README.md, examples/qwen3.5/README.md, examples/seed-oss/README.md, examples/smolvlm2/README.md, examples/voxtral/README.md
Updated installation commands to use uv pip instead of pip3/pip, removed explicit installs of pinned build tooling (packaging==26.0, setuptools==75.8.0, wheel, ninja) from setup instructions.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • #3544 — Directly attempts to revert the uv migration changes by restoring requirements.txt, setup.py, and setuptools dynamic-deps module.
  • #2844 — Modifies the same packaging/dependency files (requirements.txt and setup.py) affected by this PR.
  • #3082 — Updates setup.py extras_require for flash-attn, directly affected by the removal of setup.py in this PR.

Suggested reviewers

  • winglian
  • djsaunde
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: move to uv first' directly and clearly summarizes the main change: migrating the project's package management and dependency handling from pip-centric workflows to a uv-first approach across all CI/CD, documentation, examples, and configuration files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/uv-static-deps

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@NanoCode012 NanoCode012 marked this pull request as ready for review March 25, 2026 11:18
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 25, 2026

📖 Documentation Preview: https://69ca54820a5f5e0720c01ea7--resonant-treacle-0fd729.netlify.app

Deployed on Netlify from commit ee9b2c2

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
cicd/Dockerfile-uv.jinja (1)

26-32: ⚠️ Potential issue | 🟠 Major

Same nightly build issue as in Dockerfile.jinja.

The sed commands targeting requirements.txt will be ineffective if that file is empty or removed. This needs the same fix as the non-uv Dockerfile.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cicd/Dockerfile-uv.jinja` around lines 26 - 32, The sed replacement commands
inside the NIGHTLY_BUILD branch can fail if requirements.txt is missing or
empty; ensure requirements.txt exists before running the sed commands (e.g.,
create or touch the file) so the transformations for
transformers/peft/accelerate/trl/datasets always run reliably when NIGHTLY_BUILD
is "true". Reference the NIGHTLY_BUILD conditional and the sed replacement lines
for transformers, peft, accelerate, trl, and datasets to locate where to add the
pre-check/creation.
cicd/Dockerfile.jinja (1)

27-33: ⚠️ Potential issue | 🟠 Major

Nightly build sed commands will fail—requirements.txt does not exist.

The repository uses pyproject.toml and uv for dependency management; there is no requirements.txt file. The sed commands at lines 27-33 will fail when executed in the Docker build. Update the nightly build logic to modify the dependency specifications in pyproject.toml instead, or inject the development versions through environment variables passed to the pip install step at lines 37-41.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cicd/Dockerfile.jinja` around lines 27 - 33, The nightly build block uses sed
to patch requirements.txt which doesn't exist; update the NIGHTLY_BUILD branch
to either mutate pyproject.toml or set override env vars used by the later pip
install step: replace the sed commands that reference requirements.txt with
commands that (a) use a small Python one-liner or sed to replace the package
entries (transformers, peft, accelerate, trl, datasets) inside pyproject.toml,
or (b) export an env var (e.g. NIGHTLY_DEP_OVERRIDES) containing the git+ URLs
and append that var to the pip install invocation in the pip install step so
those dev versions are installed; ensure you reference NIGHTLY_BUILD,
pyproject.toml, and the pip install step when making the change.
🧹 Nitpick comments (3)
.github/workflows/lint.yml (1)

9-9: Include lockfile changes in PR trigger paths.

Line 9 now tracks pyproject.toml, but dependency-only updates may land via lockfile changes too. Consider adding uv.lock to pull_request.paths so lint always runs on dependency updates.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/lint.yml at line 9, CI workflow pull_request.paths
currently includes 'pyproject.toml' but misses the lockfile so dependency-only
updates can bypass lint; update the pull_request.paths list in
.github/workflows/lint.yml to also include the lockfile (uv.lock) so lint runs
on dependency changes, i.e., add 'uv.lock' alongside 'pyproject.toml' under the
pull_request.paths entry.
.github/workflows/tests-nightly.yml (1)

83-90: Consider the risk of --no-deps with nightly packages.

Installing nightly HF packages with --no-deps relies on the project's pinned dependencies being sufficient. If a @main version introduces a new transitive dependency not declared in pyproject.toml, tests could fail with import errors.

This is likely intentional for nightly testing (to catch such issues early), but worth documenting or monitoring.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/tests-nightly.yml around lines 83 - 90, The nightly
override step ("Override with nightly HF packages") uses pip install with
--no-deps which can hide new transitive requirements from `@main` that cause
import errors; either remove --no-deps so pip can pull transitive deps when
running the pip command that installs the nightly HF packages, or if you intend
to keep --no-deps for stricter testing, add a clear comment above the pip
install (the line invoking "transformers @ git+https://...@main" etc.)
documenting this risk and add a follow-up monitoring action (or a fallback pip
install without --no-deps on failure) to catch and surface missing transitive
dependencies.
.github/workflows/tests.yml (1)

111-112: Replace hardcoded package list with dependency group installation.

The packages at lines 111-112 and 202-203 duplicate the dev and test dependency groups from pyproject.toml:141-159. Instead of maintaining this second source of truth, use uv sync to install from the declared groups. This eliminates drift risk and ensures the workflow always matches the project's dependency configuration.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/tests.yml around lines 111 - 112, Replace the hardcoded
pip install command (the line invoking "uv pip install black mypy ..." in the
workflow) with a call to uv sync that installs the project's declared dependency
groups (dev and test) from pyproject.toml; specifically, remove the explicit
package list and run uv sync targeting the dev and test groups (e.g., "uv sync"
with the appropriate flags to install groups dev and test) so the workflow uses
the single source of truth in pyproject.toml.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/multi-gpu-e2e.yml:
- Around line 7-8: Remove the duplicate path entry under on.pull_request.paths:
there are two identical 'pyproject.toml' entries—keep only one. Edit the
workflow (the on.pull_request.paths array) to remove the redundant
'pyproject.toml' line so the array contains a single 'pyproject.toml' entry.

In @.github/workflows/tests.yml:
- Around line 8-10: Update the GitHub Actions workflow file's paths filter to
include the lockfile so dependency-only changes trigger tests: add 'uv.lock' to
the paths array alongside '**.py' and 'pyproject.toml' in the workflow (the two
occurrences shown around the existing paths entries) so lockfile-only updates
won't skip the tests.

In `@docs/installation.qmd`:
- Around line 60-62: Update the default Docker run example in the
docs/installation.qmd so the shown docker run command includes the --ipc=host
flag to avoid shared-memory/DataLoader failures; locate the existing snippet
containing the Docker command (the line starting with docker run --gpus) and add
--ipc=host alongside --rm -it (keeping the advanced example unchanged).
- Around line 142-144: The sentence claiming "Any existing `pip install` command
can be run with `uv pip install`" overstates compatibility; change the copy to
soften the claim (e.g., describe `uv pip` as a drop-in replacement for common
`pip` workflows or for most `pip install` use-cases) and add a brief note or
parenthetical that `uv pip` is not an exact clone of `pip` and that some
options/behaviors (for example `--user`, `--prefix`,
resolver/pre-release/config/env differences) are intentionally different—update
the `uv pip` callout text to reflect this more accurate compatibility statement
and optionally point readers to the official uv documentation for details.

In `@examples/granite4/README.md`:
- Line 18: Clarify that the command "uv pip install --no-build-isolation -e
'.[flash-attn]'" requires an active virtual environment by instructing the
reader to create and activate one first (e.g., python -m venv .venv && source
.venv/bin/activate) or by adding a prior bullet/line in the README code block
that shows creating and activating a venv before running the uv pip install
command.

In `@pyproject.toml`:
- Around line 220-249: In the conflicts array update each conflict entry that
currently uses { package = "axolotl" } to instead list extras only by replacing
that object with { extra = "axolotl" } (i.e., change entries like [{ package =
"axolotl" }, { extra = "vllm" }] to [{ extra = "axolotl" }, { extra = "vllm" }])
so every conflict list contains only { extra = "..."} objects; apply this change
to all entries in the conflicts block.
- Around line 20-23: Update the pinned datasets dependency in pyproject.toml
from "datasets==4.5.0" to "datasets==4.8.3" to match transformers==5.3.0 and
accelerate==1.13.0; after updating the "datasets" line, regenerate any
lock/poetry files or run your dependency install (poetry install / pip-compile /
pip-sync) and run the test suite to verify compatibility with the updated
datasets package.

In `@README.md`:
- Line 90: The README's "PyTorch ≥2.9.0" and pyproject.toml's dependency line
"torch>=2.6.0" disagree; make them consistent by deciding the true minimum
supported version and updating the other file to match (either change README's
"PyTorch ≥2.9.0" to "PyTorch ≥2.6.0" or update pyproject.toml's "torch>=2.6.0"
to "torch>=2.9.0"). Edit the string in the README or the "torch" entry in
pyproject.toml so both files state the same minimum version.

---

Outside diff comments:
In `@cicd/Dockerfile-uv.jinja`:
- Around line 26-32: The sed replacement commands inside the NIGHTLY_BUILD
branch can fail if requirements.txt is missing or empty; ensure requirements.txt
exists before running the sed commands (e.g., create or touch the file) so the
transformations for transformers/peft/accelerate/trl/datasets always run
reliably when NIGHTLY_BUILD is "true". Reference the NIGHTLY_BUILD conditional
and the sed replacement lines for transformers, peft, accelerate, trl, and
datasets to locate where to add the pre-check/creation.

In `@cicd/Dockerfile.jinja`:
- Around line 27-33: The nightly build block uses sed to patch requirements.txt
which doesn't exist; update the NIGHTLY_BUILD branch to either mutate
pyproject.toml or set override env vars used by the later pip install step:
replace the sed commands that reference requirements.txt with commands that (a)
use a small Python one-liner or sed to replace the package entries
(transformers, peft, accelerate, trl, datasets) inside pyproject.toml, or (b)
export an env var (e.g. NIGHTLY_DEP_OVERRIDES) containing the git+ URLs and
append that var to the pip install invocation in the pip install step so those
dev versions are installed; ensure you reference NIGHTLY_BUILD, pyproject.toml,
and the pip install step when making the change.

---

Nitpick comments:
In @.github/workflows/lint.yml:
- Line 9: CI workflow pull_request.paths currently includes 'pyproject.toml' but
misses the lockfile so dependency-only updates can bypass lint; update the
pull_request.paths list in .github/workflows/lint.yml to also include the
lockfile (uv.lock) so lint runs on dependency changes, i.e., add 'uv.lock'
alongside 'pyproject.toml' under the pull_request.paths entry.

In @.github/workflows/tests-nightly.yml:
- Around line 83-90: The nightly override step ("Override with nightly HF
packages") uses pip install with --no-deps which can hide new transitive
requirements from `@main` that cause import errors; either remove --no-deps so pip
can pull transitive deps when running the pip command that installs the nightly
HF packages, or if you intend to keep --no-deps for stricter testing, add a
clear comment above the pip install (the line invoking "transformers @
git+https://...@main" etc.) documenting this risk and add a follow-up monitoring
action (or a fallback pip install without --no-deps on failure) to catch and
surface missing transitive dependencies.

In @.github/workflows/tests.yml:
- Around line 111-112: Replace the hardcoded pip install command (the line
invoking "uv pip install black mypy ..." in the workflow) with a call to uv sync
that installs the project's declared dependency groups (dev and test) from
pyproject.toml; specifically, remove the explicit package list and run uv sync
targeting the dev and test groups (e.g., "uv sync" with the appropriate flags to
install groups dev and test) so the workflow uses the single source of truth in
pyproject.toml.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a3af9e30-0089-46d9-af9c-ab2188fdc9d7

📥 Commits

Reviewing files that changed from the base of the PR and between 2fb7279 and 32349dc.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (39)
  • .github/CONTRIBUTING.md
  • .github/workflows/lint.yml
  • .github/workflows/multi-gpu-e2e.yml
  • .github/workflows/pypi.yml
  • .github/workflows/tests-nightly.yml
  • .github/workflows/tests.yml
  • MANIFEST.in
  • README.md
  • cicd/Dockerfile-uv.jinja
  • cicd/Dockerfile.jinja
  • docs/debugging.qmd
  • docs/docker.qmd
  • docs/installation.qmd
  • examples/LiquidAI/README.md
  • examples/apertus/README.md
  • examples/arcee/README.md
  • examples/devstral/README.md
  • examples/gemma3n/README.md
  • examples/gpt-oss/README.md
  • examples/granite4/README.md
  • examples/hunyuan/README.md
  • examples/internvl3_5/README.md
  • examples/magistral/README.md
  • examples/magistral/vision/README.md
  • examples/ministral3/README.md
  • examples/ministral3/vision/README.md
  • examples/mistral-small/README.md
  • examples/mistral4/README.md
  • examples/qwen3-next/README.md
  • examples/qwen3.5/README.md
  • examples/seed-oss/README.md
  • examples/smolvlm2/README.md
  • examples/voxtral/README.md
  • pyproject.toml
  • requirements-dev.txt
  • requirements-tests.txt
  • requirements.txt
  • setup.py
  • src/setuptools_axolotl_dynamic_dependencies.py
💤 Files with no reviewable changes (5)
  • requirements-dev.txt
  • requirements-tests.txt
  • requirements.txt
  • src/setuptools_axolotl_dynamic_dependencies.py
  • setup.py

Comment on lines 7 to 8
- 'pyproject.toml'
- 'pyproject.toml'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove duplicate workflow path entry.
'pyproject.toml' appears twice in on.pull_request.paths. Keep a single entry to avoid config noise.

Suggested cleanup
     paths:
       - 'tests/e2e/multigpu/**.py'
-      - 'pyproject.toml'
       - 'pyproject.toml'
       - '.github/workflows/multi-gpu-e2e.yml'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- 'pyproject.toml'
- 'pyproject.toml'
paths:
- 'tests/e2e/multigpu/**.py'
- 'pyproject.toml'
- '.github/workflows/multi-gpu-e2e.yml'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/multi-gpu-e2e.yml around lines 7 - 8, Remove the duplicate
path entry under on.pull_request.paths: there are two identical 'pyproject.toml'
entries—keep only one. Edit the workflow (the on.pull_request.paths array) to
remove the redundant 'pyproject.toml' line so the array contains a single
'pyproject.toml' entry.

Comment on lines +8 to +10
paths:
- '**.py'
- 'requirements.txt'
- 'pyproject.toml'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Include uv.lock in the workflow path filters.

A lockfile-only dependency update will skip this workflow today because only pyproject.toml is watched. That leaves regenerated or transitive dependency changes untested.

Suggested change
     paths:
       - '**.py'
       - 'pyproject.toml'
+      - 'uv.lock'
       - '.github/workflows/*.yml'
       - 'cicd/cicd.sh'
       - 'cicd/Dockerfile.jinja'
   pull_request:
       types: [opened, synchronize, reopened, ready_for_review]
       paths:
        - '**.py'
        - 'pyproject.toml'
+       - 'uv.lock'
        - '.github/workflows/*.yml'
        - 'cicd/cicd.sh'
        - 'cicd/Dockerfile.jinja'

Also applies to: 16-18

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/tests.yml around lines 8 - 10, Update the GitHub Actions
workflow file's paths filter to include the lockfile so dependency-only changes
trigger tests: add 'uv.lock' to the paths array alongside '**.py' and
'pyproject.toml' in the workflow (the two occurrences shown around the existing
paths entries) so lockfile-only updates won't skip the tests.

run: |
find "$(pip cache dir)/http-v2" -type f -mtime +14 -exec rm {} \;
uv pip install --no-build-isolation -U -e .
python scripts/unsloth_install.py --uv | sh
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

unsloth_install.py does not support any torch version in this matrix.

scripts/unsloth_install.py:16-35 raises for torch >= 2.6.0, but these jobs invoke it under 2.8.0, 2.9.1, and 2.10.0. Every matrix entry will fail here before the test suite starts.

Also applies to: 200-200

Comment on lines 60 to 62
```{.bash}
docker run --gpus '"all"' --rm -it axolotlai/axolotl:main-latest
docker run --gpus '"all"' --rm -it axolotlai/axolotl-uv:main-latest
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Keep --ipc=host in the default Docker run example.

The advanced example still includes it, but the first command users copy no longer does. That makes the default path the one most likely to hit shared-memory/DataLoader failures.

Suggested change
-docker run --gpus '"all"' --rm -it axolotlai/axolotl-uv:main-latest
+docker run --gpus '"all"' --ipc=host --rm -it axolotlai/axolotl-uv:main-latest
Based on learnings, For Axolotl Docker commands, the `--ipc=host` flag should be included by default to prevent shared memory failures that commonly occur with PyTorch DataLoaders and multiprocessing during machine learning training workflows.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```{.bash}
docker run --gpus '"all"' --rm -it axolotlai/axolotl:main-latest
docker run --gpus '"all"' --rm -it axolotlai/axolotl-uv:main-latest
```
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/installation.qmd` around lines 60 - 62, Update the default Docker run
example in the docs/installation.qmd so the shown docker run command includes
the --ipc=host flag to avoid shared-memory/DataLoader failures; locate the
existing snippet containing the Docker command (the line starting with docker
run --gpus) and add --ipc=host alongside --rm -it (keeping the advanced example
unchanged).

Comment on lines +142 to +144
::: {.callout-tip}
`uv pip` is a drop-in replacement for `pip`. Any existing `pip install` command can be run with `uv pip install` instead — it uses the same package format and indexes, just faster.
:::
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

uv pip compatibility with pip official documentation

💡 Result:

uv provides a uv pip interface designed as a drop-in replacement for common pip and pip-tools workflows, allowing users to swap pip install with uv pip install in most cases without changes. However, it is not an exact clone of pip and has intentional differences, outlined in uv's official compatibility documentation. Official pip documentation (pip.pypa.io) does not mention uv or provide specific compatibility guidance; compatibility details are solely from uv's docs (docs.astral.sh/uv/pip/compatibility/). Key differences include: - uv ignores pip-specific config files (e.g., pip.conf) and env vars (e.g., PIP_INDEX_URL), using its own (e.g., UV_INDEX_URL, uv.toml). - Differences in pre-release handling, index strategies (uv prefers internal indexes to avoid dependency confusion), virtualenv defaults (uv requires venv by default), resolver priorities, and unsupported pip options like --user, --prefix. - uv pip compile has different defaults from pip-tools (e.g., requires explicit --output-file). For full details, see uv's compatibility page. No pip docs reference uv compatibility.

Citations:


🌐 Web query:

uv drop-in replacement pip astral.sh

💡 Result:

Yes, uv from astral.sh is designed as a drop-in replacement for pip. You can use commands like uv pip install to replace pip install directly in most common workflows, providing 10-100x faster performance. It supports pip-tools workflows like uv pip compile and uv pip sync. While not bug-for-bug identical to pip (e.g., differences in resolver behavior, index handling, pre-release versions), it works for standard use cases without changes. Official docs: https://docs.astral.sh/uv/pip/ and https://docs.astral.sh/uv/pip/compatibility/. Install via curl -LsSf https://astral.sh/uv/install.sh | sh.

Citations:


Soften the uv pip compatibility claim to match official uv documentation.

The current statement "Any existing pip install command can be run" is overstated. Official uv docs describe the pip interface as a drop-in replacement for "common" workflows, not all commands. The documentation explicitly notes that uv is "not an exact clone of pip" and lists intentional differences including unsupported options (--user, --prefix), different resolver behavior, pre-release handling, and config/environment variable handling. Users with custom flags or unusual workflows risk failures if they assume full compatibility.

Suggested rewording
-`uv pip` is a drop-in replacement for `pip`. Any existing `pip install` command can be run with `uv pip install` instead — it uses the same package format and indexes, just faster.
+`uv pip` covers common `pip install` workflows, but some flags and behaviors differ from `pip`. If a command is unusual or highly customized, check uv's compatibility guidance before swapping it over.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/installation.qmd` around lines 142 - 144, The sentence claiming "Any
existing `pip install` command can be run with `uv pip install`" overstates
compatibility; change the copy to soften the claim (e.g., describe `uv pip` as a
drop-in replacement for common `pip` workflows or for most `pip install`
use-cases) and add a brief note or parenthetical that `uv pip` is not an exact
clone of `pip` and that some options/behaviors (for example `--user`,
`--prefix`, resolver/pre-release/config/env differences) are intentionally
different—update the `uv pip` callout text to reflect this more accurate
compatibility statement and optionally point readers to the official uv
documentation for details.


pip3 install packaging==26.0 setuptools==75.8.0 wheel ninja
pip3 install --no-build-isolation -e '.[flash-attn]'
uv pip install --no-build-isolation -e '.[flash-attn]'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

In current uv documentation, does uv pip installrequire an active virtual environment by default, and when should--systembe used for editable installs likeuv pip install -e '.[flash-attn]'?

💡 Result:

Yes, in the current uv documentation, uv pip install requires an active virtual environment by default. Unlike pip, uv pip will error with "No virtual environment found" or prompt to create one if no virtual environment is detected (via VIRTUAL_ENV, .venv in current/parent dirs, etc.). It searches for virtual environments in a specific order and skips if none found without --system. The --system flag should be used for editable installs like uv pip install -e '.[flash-attn]' when you intentionally want to install into the system Python environment, such as in continuous integration (CI), containerized environments, or when modifying non-virtual Python installations (e.g., --python 3.12 on a system interpreter). uv docs warn that --system skips virtual environments and targets system Python (first in PATH), but recommend virtual environments generally. Use with caution as it mutates system Python, which can be problematic on some distros (PEP 668 externally managed).

Citations:


🏁 Script executed:

cd examples/granite4 && wc -l README.md

Repository: axolotl-ai-cloud/axolotl

Length of output: 80


🏁 Script executed:

cd examples/granite4 && cat -n README.md | head -30

Repository: axolotl-ai-cloud/axolotl

Length of output: 1364


🏁 Script executed:

cd examples/granite4 && cat -n README.md | grep -i "venv\|virtual\|environment" -A 2 -B 2

Repository: axolotl-ai-cloud/axolotl

Length of output: 50


🏁 Script executed:

cd examples/granite4 && cat -n README.md | tail -35

Repository: axolotl-ai-cloud/axolotl

Length of output: 1544


🏁 Script executed:

cd examples/granite4 && git log --oneline -10 -- README.md 2>/dev/null | head -5

Repository: axolotl-ai-cloud/axolotl

Length of output: 96


🏁 Script executed:

cd examples/granite4 && git show HEAD:README.md 2>/dev/null | sed -n '13,22p'

Repository: axolotl-ai-cloud/axolotl

Length of output: 1325


🏁 Script executed:

# Check if there's a main installation guide referenced that covers venv setup
grep -r "installation.html\|installation guide" README.md

Repository: axolotl-ai-cloud/axolotl

Length of output: 297


Clarify that an active virtual environment is required before running uv pip install.

The uv pip install command on line 18 requires an active virtual environment by default. Without one, users will encounter "No virtual environment found" errors. While the README references the installation guide which presumably covers venv setup, this snippet should explicitly state that users need to create and activate a virtual environment first, or add that step to the code block.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/granite4/README.md` at line 18, Clarify that the command "uv pip
install --no-build-isolation -e '.[flash-attn]'" requires an active virtual
environment by instructing the reader to create and activate one first (e.g.,
python -m venv .venv && source .venv/bin/activate) or by adding a prior
bullet/line in the README code block that shows creating and activating a venv
before running the uv pip install command.

Comment on lines +20 to +23
"transformers==5.3.0",
"accelerate==1.13.0",
"datasets==4.5.0",
"trl==0.29.0",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

What is the latest version of transformers library from Hugging Face?

💡 Result:

The latest version of the Hugging Face transformers library is 5.3.0, released on March 4, 2026.

Citations:


🌐 Web query:

What is the latest version of the accelerate library from Hugging Face?

💡 Result:

The latest version of the Hugging Face Accelerate library is v1.13.0, released on March 4, 2026.

Citations:


🌐 Web query:

What is the latest version of the datasets library from Hugging Face?

💡 Result:

The latest version of the Hugging Face datasets library is 4.8.3.

Citations:


🌐 Web query:

What is the latest version of the trl library from Hugging Face?

💡 Result:

The latest stable version of the Hugging Face TRL library is v0.29.1, released on March 20, 2026. There is a pre-release v1.0.0rc1 from the same day, but the stable release on PyPI is v0.29.0 from February 25, 2026, with v0.29.1 as the latest patch.

Citations:


Update datasets to latest version.

The pinned versions for transformers==5.3.0 (latest), accelerate==1.13.0 (latest), and trl==0.29.0 (stable) are confirmed and correct. However, datasets==4.5.0 is significantly outdated—the latest version is 4.8.3. This version mismatch may cause compatibility issues with the recently released transformers and accelerate libraries. Update datasets to 4.8.3.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pyproject.toml` around lines 20 - 23, Update the pinned datasets dependency
in pyproject.toml from "datasets==4.5.0" to "datasets==4.8.3" to match
transformers==5.3.0 and accelerate==1.13.0; after updating the "datasets" line,
regenerate any lock/poetry files or run your dependency install (poetry install
/ pip-compile / pip-sync) and run the test suite to verify compatibility with
the updated datasets package.

Comment on lines +220 to +249
conflicts = [
[
{ package = "axolotl" },
{ extra = "vllm" },
],
[
{ package = "axolotl" },
{ extra = "flash-attn" },
],
[
{ package = "axolotl" },
{ extra = "ring-flash-attn" },
],
[
{ package = "axolotl" },
{ extra = "mamba-ssm" },
],
[
{ package = "axolotl" },
{ extra = "auto-gptq" },
],
[
{ package = "axolotl" },
{ extra = "fbgemm-gpu" },
],
[
{ package = "axolotl" },
{ extra = "llmcompressor" },
],
]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

uv tool conflicts configuration syntax pyproject.toml

💡 Result:

The configuration syntax in pyproject.toml for handling dependency conflicts in uv is under the [tool.uv] section using the conflicts key. This declares mutually exclusive collections of extras or dependency groups, allowing uv to resolve them in separate forks without failing resolution. Syntax: [tool.uv] conflicts = [ [ { extra = "extra1" }, { extra = "extra2" }, ], [ { group = "group1" }, { group = "group2" }, ], ] This tells uv that "extra1" and "extra2" conflict (e.g., different numpy versions), and similarly for groups. Without this, uv fails if incompatible dependencies are detected across groups/extras during lock/sync. Use uv sync --extra extra1 or --group group1 to install specific non-conflicting sets. From official uv docs: conflicts are for cases where extras/groups have incompatible deps but aren't meant to be used together. uv resolves all groups together by default but uses separate resolution forks for declared conflicts. Note: Conflicts must be in pyproject.toml under [tool.uv]; not supported in uv.toml. Dependency groups use standard [dependency-groups] table (PEP 735).

Citations:


Fix uv conflicts syntax in [tool.uv] section.

The conflicts configuration syntax is incorrect. According to the official uv documentation, conflicts should directly list mutually exclusive extras or groups within each conflict entry, not nest them with a package specification.

Incorrect syntax:

[ { package = "axolotl" }, { extra = "vllm" } ]

Correct syntax:

[ { extra = "vllm" }, { extra = "flash-attn" } ]

Update each conflict entry to list only the conflicting extras, removing the { package = "axolotl" } constraint from each conflict list.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pyproject.toml` around lines 220 - 249, In the conflicts array update each
conflict entry that currently uses { package = "axolotl" } to instead list
extras only by replacing that object with { extra = "axolotl" } (i.e., change
entries like [{ package = "axolotl" }, { extra = "vllm" }] to [{ extra =
"axolotl" }, { extra = "vllm" }]) so every conflict list contains only { extra =
"..."} objects; apply this change to all entries in the conflicts block.

README.md Outdated
- NVIDIA GPU (Ampere or newer for `bf16` and Flash Attention) or AMD GPU
- Python 3.11
- PyTorch ≥2.8.0
- PyTorch ≥2.9.0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify the torch version requirement in pyproject.toml
rg -n 'torch>=' pyproject.toml

Repository: axolotl-ai-cloud/axolotl

Length of output: 90


Align PyTorch minimum version between README and pyproject.toml.

README.md line 90 specifies PyTorch ≥2.9.0, but pyproject.toml line 15 specifies torch>=2.6.0. Update one to match the other to avoid confusing users about the actual minimum supported version.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` at line 90, The README's "PyTorch ≥2.9.0" and pyproject.toml's
dependency line "torch>=2.6.0" disagree; make them consistent by deciding the
true minimum supported version and updating the other file to match (either
change README's "PyTorch ≥2.9.0" to "PyTorch ≥2.6.0" or update pyproject.toml's
"torch>=2.6.0" to "torch>=2.9.0"). Edit the string in the README or the "torch"
entry in pyproject.toml so both files state the same minimum version.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 26, 2026

Codecov Report

❌ Patch coverage is 0% with 19 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/axolotl/cli/utils/lora_merge.py 0.00% 11 Missing ⚠️
src/axolotl/utils/schemas/validation.py 0.00% 8 Missing ⚠️

📢 Thoughts on this report? Let us know!

@NanoCode012
Copy link
Copy Markdown
Collaborator Author

2 CI failures on nightly build upstream which this PR attempts to fix:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant