Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Use uv instead of pip in CI/CD #116

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions .github/workflows/3d_parallelism_unit_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,22 @@ jobs:

- name: Install nanotron's dependencies
run: |
python -m venv $GITHUB_WORKSPACE/venv
. $GITHUB_WORKSPACE/venv/bin/activate
export PATH="$PATH:$(python -c 'import site; print(site.USER_BASE + "/bin")')"
python -m pip install --upgrade pip
pip install packaging
pip install wheel
pip install -e .
pip install -e .[dev]
pip install -e .[test]

- name: Show installed libraries and their versions
run: pip freeze | tee installed.txt
python -m pip install --upgrade uv
uv pip install packaging
uv pip install wheel
uv pip install -e .
uv pip install -e .[dev]
uv pip install -e .[test]

- name: Run nanotron tests
# NOTE: -m "not fa2" will run all the unit tests that don't have the mark
# "fa2" (these are FA2-related tests, we can't run it on T4)
run: |
. $GITHUB_WORKSPACE/venv/bin/activate
pytest \
-m "not fa2" \
--color=yes \
Expand All @@ -61,6 +63,7 @@ jobs:
--ignore tests/fp8 \
--verbose \
tests/

# NOTE: T4 can't run FA2, DoReMi's LLaMa needs FÀ
# - name: Run DoReMi tests
# # NOTE: -m "not fa2" will run all the unit tests that don't have the mark
Expand Down
25 changes: 17 additions & 8 deletions .github/workflows/fa2_unit_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,29 @@ jobs:
python -c "import torch; print('torch:', torch.__version__, torch)"
python -c "import torch; print('CUDA available:', torch.cuda.is_available())"

- name: Instal nanotron
- name: Install nanotron
# NOTE: uv can't build flash-attn
run: |
python -m venv $GITHUB_WORKSPACE/venv
. $GITHUB_WORKSPACE/venv/bin/activate
python -m pip install --upgrade pip
pip install packaging
pip install wheel
python -m pip install --upgrade uv
uv pip install packaging
uv pip install wheel
uv pip install torch
pip install "flash-attn>=2.5.0" --no-build-isolation
pip install -e .
pip install -e .[dev]
pip install -e .[test]
uv pip install -e .
uv pip install -e .[dev]
uv pip install -e .[test]

- name: Show installed libraries and their versions
run: pip freeze | tee installed.txt
run: |
. $GITHUB_WORKSPACE/venv/bin/activate
uv pip freeze | tee installed.txt

- name: Run tests
# NOTE: -m fa2 will only run the unit tests that have the mark
# "fa2" (these are FA2-related tests)
run: pytest -m fa2 --color=yes --durations=0 --ignore tests/fp8 --verbose tests/
run: |
. $GITHUB_WORKSPACE/venv/bin/activate
pytest -m fa2 --color=yes --durations=0 --ignore tests/fp8 --verbose tests/
2 changes: 1 addition & 1 deletion tests/test_checkpointing.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __init__(self, is_checkpointed: bool = False):
self.fwd_counter = 0

@checkpoint_method("is_checkpointed")
def forward(self, x: Union[torch.Tensor, TensorPointer]):
def forward(self, x: Union[torch.Tensor, TensorPointer]) -> torch.Tensor:
x = self.dense1(x)
if self.is_checkpointed and self.fwd_counter == 0:
assert not x.requires_grad, "x should not require grad when checkpointed, because fwd runs in no_grad mode"
Expand Down
Loading