Skip to content

feat: move to uv first#3545

Merged
winglian merged 47 commits into
mainfrom
feat/uv-static-deps
Apr 21, 2026
Merged

feat: move to uv first#3545
winglian merged 47 commits into
mainfrom
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: 39d48504-ac14-44b8-87e5-5c3f2db8061a

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://69e5d728cd92690f35692b20--resonant-treacle-0fd729.netlify.app

Deployed on Netlify from commit 0d6e834

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 thread .github/workflows/multi-gpu-e2e.yml Outdated
Comment thread .github/workflows/tests.yml Outdated
Comment thread .github/workflows/tests.yml Outdated
Comment thread docs/installation.qmd
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 thread docs/installation.qmd Outdated

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 thread pyproject.toml Outdated
Comment thread pyproject.toml
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

@coderabbitai coderabbitai Bot Mar 25, 2026

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@BrownianNotion , are you familiar whether this is an issue?

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.

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Comment thread README.md Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 26, 2026

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/axolotl/utils/schemas/validation.py 87.50% 1 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:

Comment thread pyproject.toml Outdated
axolotl = ["huggingface_hub"]
mamba-ssm = ["torch"]
causal-conv1d = ["torch"]
flash-attn = ["torch"]
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.

Is it worth setting match_runtime = true to ensure packages like flash-attn/deepspeed use the same version of torch https://docs.astral.sh/uv/concepts/projects/config/#augmenting-build-dependencies?

This seems to be the preferred approach over using --no-build-isolation

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thank you for the suggestion, I will look into this

Copy link
Copy Markdown
Collaborator Author

@NanoCode012 NanoCode012 Apr 9, 2026

Choose a reason for hiding this comment

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

@BrownianNotion , I read through this, is this applicable only for uv sync? I'm deleting the lockfile and usually recommending folks to do uv pip install.. which may not be impacted by this?

It's tricky with lock file as we would need to maintain it updated per requirements change and it doesn't really work with N torch x cuda combinations. If anyone has better recommendation on how to handle this, we're all ears.

Edit: I'll add this anyways but I think it could be a no-op with no build isolation. I'll see if we still need that flag later.

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.

Thanks for looking into it! I think match_runtime is indeed for uv sync only.

Fair enough, I don't know of a nice way to support N torch x cuda combinations with the .lock file, you might have to enumerate all the combinations and their indices for example.

@winglian winglian merged commit 9de5b76 into main Apr 21, 2026
41 of 42 checks passed
@winglian winglian deleted the feat/uv-static-deps branch April 21, 2026 14:16
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.

3 participants