From 5586833433486a85b08e2b1e05b233e7387359a2 Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Wed, 14 Jan 2026 10:20:40 +0200 Subject: [PATCH 1/5] Bump pre-commit tools --- .pre-commit-config.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 221c75444..c320ae0c0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,13 +1,13 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.3 + rev: 6ce4b4fc349b8881cbce40207dac3bf78824a88e # frozen: v0.14.11 hooks: - - id: ruff + - id: ruff-check args: - --fix - id: ruff-format - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0 hooks: - id: check-merge-conflict - id: check-yaml @@ -19,11 +19,11 @@ repos: - --fix=lf exclude: '\.bat$' - repo: https://github.com/crate-ci/typos - rev: v1.26.0 + rev: bb4666ad77b539a6b4ce4eda7ebb6de553704021 # frozen: v1.42.0 hooks: - id: typos - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v20.1.6 + rev: 75ca4ad908dc4a99f57921f29b7e6c1521e10b26 # frozen: v21.1.8 hooks: - id: clang-format types_or: [c++, c, cuda] From a813070355cb2872173c6c4a677876fbf6ba6c71 Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Wed, 14 Jan 2026 10:21:41 +0200 Subject: [PATCH 2/5] Fix typos with crate-ci/typos --- bitsandbytes/functional.py | 8 ++++---- bitsandbytes/optim/adagrad.py | 6 +++--- csrc/kernels.cu | 2 +- csrc/kernels.hip | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bitsandbytes/functional.py b/bitsandbytes/functional.py index 2a2a40273..b2045a663 100644 --- a/bitsandbytes/functional.py +++ b/bitsandbytes/functional.py @@ -241,13 +241,13 @@ def create_fp8_map(signed=True, exponent_bits=5, precision_bits=2, total_bits=8) has_sign = 1 if signed else 0 assert e + p == total_bits - has_sign # the exponent is biased to 2^(e-1) -1 == 0 - evalues = [] + e_values = [] for i, val in enumerate(range(-(2 ** (exponent_bits - has_sign)), 2 ** (exponent_bits - has_sign), 1)): - evalues.append(2**val) + e_values.append(2**val) values = [] lst = list(itertools.product([0, 1], repeat=precision_bits)) - # for ev in evalues: + # for ev in e_values: bias = 2 ** (exponent_bits - 1) for evalue in range(2 ** (exponent_bits)): for bit_pattern in lst: @@ -1501,7 +1501,7 @@ def check_matmul(A, B, out, transposed_A, transposed_B, expected_type=torch.int8 if not correct: raise ValueError( - f"Tensor dimensions incorrect for matrix mulitiplication: A x B: {sA} x {sB} with transpose for A x B: {tA} x {tB}.", + f"Tensor dimensions incorrect for matrix multiplication: A x B: {sA} x {sB} with transpose for A x B: {tA} x {tB}.", ) return sout diff --git a/bitsandbytes/optim/adagrad.py b/bitsandbytes/optim/adagrad.py index 7459dece1..62316aa28 100644 --- a/bitsandbytes/optim/adagrad.py +++ b/bitsandbytes/optim/adagrad.py @@ -33,7 +33,7 @@ def __init__( weight_decay (`float`, defaults to 0.0): The weight decay value for the optimizer. initial_accumulator_value (`int`, defaults to 0): - The initial momemtum values. + The initial momentum values. eps (`float`, defaults to 1e-10): The epsilon value prevents division by zero in the optimizer. optim_bits (`int`, defaults to 32): @@ -100,7 +100,7 @@ def __init__( weight_decay (`float`, defaults to 0.0): The weight decay value for the optimizer. initial_accumulator_value (`int`, defaults to 0): - The initial momemtum values. + The initial momentum values. eps (`float`, defaults to 1e-10): The epsilon value prevents division by zero in the optimizer. optim_bits (`int`, defaults to 8): @@ -168,7 +168,7 @@ def __init__( weight_decay (`float`, defaults to 0.0): The weight decay value for the optimizer. initial_accumulator_value (`int`, defaults to 0): - The initial momemtum values. + The initial momentum values. eps (`float`, defaults to 1e-10): The epsilon value prevents division by zero in the optimizer. optim_bits (`int`, defaults to 32): diff --git a/csrc/kernels.cu b/csrc/kernels.cu index 8af27075e..bc6b59dd8 100644 --- a/csrc/kernels.cu +++ b/csrc/kernels.cu @@ -1894,7 +1894,7 @@ __global__ void kspmm_coo_very_sparse_naive( // 0. load balancing: We process rows with most columns first (count_vec)and we process one row per block // If a block finishes, the next one is scheduled. Since the last blocks like have fewer - // elements they finish faster "fillin up" the gaps left by larger blocks + // elements they finish faster "filling up" the gaps left by larger blocks // without tensor cores // 1. use rowidx_length to find what to load (as many blocks as there are rows) diff --git a/csrc/kernels.hip b/csrc/kernels.hip index f4bbfdd79..3e92b914a 100644 --- a/csrc/kernels.hip +++ b/csrc/kernels.hip @@ -2024,7 +2024,7 @@ __global__ void kspmm_coo_very_sparse_naive(int *max_count, int *max_idx, int *o // 0. load balancing: We process rows with most columns first (count_vec)and we process one row per block // If a block finishes, the next one is scheduled. Since the last blocks like have fewer - // elements they finish faster "fillin up" the gaps left by larger blocks + // elements they finish faster "filling up" the gaps left by larger blocks // without tensor cores // 1. use rowidx_length to find what to load (as many blocks as there are rows) From 8b46406c9cd9b5e99ef4acd9bd62aa4e75f058a7 Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Wed, 14 Jan 2026 10:24:36 +0200 Subject: [PATCH 3/5] CI: replace lint with vendored tox-dev/action-pre-commit-uv --- .github/workflows/lint.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 01084d44f..b01b603f2 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,9 +11,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: astral-sh/setup-uv@v7 with: - python-version: "3.12" - - uses: pre-commit/action@v3.0.0 + enable-cache: true + cache-dependency-glob: '.pre-commit-config.yaml' + - uses: actions/cache@v5 + with: + path: ~/.cache/pre-commit + key: pre-commit-3|${{ hashFiles('.pre-commit-config.yaml') }} + - run: uv run --python=3.14 --no-sync --with pre-commit-uv pre-commit run --show-diff-on-failure --color=always --all-files env: RUFF_OUTPUT_FORMAT: github From c9df947be67e99e228386419b29c0b5fbe02a5e9 Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Wed, 14 Jan 2026 10:26:09 +0200 Subject: [PATCH 4/5] CI: upgrade action versions, lock (with `uvx gha-tools@latest autoupdate --pin third-party -s specific --first-party-version-strategy=major --write .github/workflows/`) --- .github/workflows/lint.yml | 4 +-- .github/workflows/python-package.yml | 46 ++++++++++++++-------------- .github/workflows/test-runner.yml | 16 +++++----- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b01b603f2..996037cd9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,8 +10,8 @@ jobs: Lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v7 + - uses: actions/checkout@v6 + - uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0 with: enable-cache: true cache-dependency-glob: '.pre-commit-config.yaml' diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index c01752e11..816b4df4d 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -42,17 +42,17 @@ jobs: arch: arm64 runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Setup MSVC if: startsWith(matrix.os, 'windows') - uses: ilammy/msvc-dev-cmd@v1.13.0 # to use cl + uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0, to use cl - name: Build C++ run: bash .github/scripts/build-cpu.sh env: build_os: ${{ matrix.os }} build_arch: ${{ matrix.arch }} - name: Upload build artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: shared_library_${{ matrix.os }}_${{ matrix.arch }} path: output/* @@ -77,9 +77,9 @@ jobs: ["11.8.0", "12.0.1", "12.1.1", "12.2.2", "12.3.2", "12.4.1", "12.5.1", "12.6.3", "12.8.1", "12.9.1", "13.0.2"] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 # Windows: We install Cuda on the agent (slow) - - uses: Jimver/cuda-toolkit@6008063726ffe3309d1b22e413d9e88fed91a2f2 # v0.2.29 + - uses: Jimver/cuda-toolkit@b6fc3a9f3f15256d9d94ffe1254f9c5a2565cde6 # v0.2.30 if: startsWith(matrix.os, 'windows') id: cuda-toolkit with: @@ -92,7 +92,7 @@ jobs: log-file-suffix: ${{matrix.os}}-${{matrix.cuda_version}}.txt - name: Setup MSVC if: startsWith(matrix.os, 'windows') - uses: ilammy/msvc-dev-cmd@v1.13.0 # to use cl + uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0, to use cl - name: Build C++ run: bash .github/scripts/build-cuda.sh env: @@ -100,7 +100,7 @@ jobs: build_arch: ${{ matrix.arch }} cuda_version: ${{ matrix.cuda_version }} - name: Upload build artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: shared_library_cuda_${{ matrix.os }}_${{ matrix.arch }}_${{ matrix.cuda_version }} path: output/* @@ -112,7 +112,7 @@ jobs: os: [ubuntu-22.04, windows-2025] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Build C++ (Linux) if: runner.os == 'Linux' run: bash .github/scripts/build-xpu.sh @@ -125,7 +125,7 @@ jobs: env: build_os: ${{ matrix.os }} - name: Upload build artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: shared_library_xpu_${{ matrix.os }}_x86_64 path: output/* @@ -139,7 +139,7 @@ jobs: rocm_version: ["6.2.4", "6.3.4", "6.4.4", "7.0.2", "7.1"] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Clean up disk space run: | echo "Disk space before cleanup:" @@ -163,7 +163,7 @@ jobs: build_arch: ${{ matrix.arch }} rocm_version: ${{ matrix.rocm_version }} - name: Upload build artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: shared_library_rocm_${{ matrix.os }}_${{ matrix.arch }}_${{ matrix.rocm_version }} path: output/* @@ -196,9 +196,9 @@ jobs: python-version: ["3.10"] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Download build artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v7 with: merge-multiple: true pattern: "shared_library*_${{ matrix.os }}_${{ matrix.arch }}*" @@ -209,7 +209,7 @@ jobs: ls -lR output/ cp output/${{ matrix.os }}/${{ matrix.arch }}/* bitsandbytes/ - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} cache: pip @@ -222,7 +222,7 @@ jobs: echo "PLATFORM_TAG=$PLATFORM_TAG" wheel tags --remove --abi-tag=none --python-tag=py3 --platform-tag=$PLATFORM_TAG dist/bitsandbytes-*.whl - name: Upload build artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: bdist_wheel_${{ matrix.os }}_${{ matrix.arch }} path: dist/bitsandbytes-*.whl @@ -238,7 +238,7 @@ jobs: - build-wheels steps: - name: Download and rename artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v7 with: path: tmp/ pattern: "bdist_wheel_*" @@ -279,7 +279,7 @@ jobs: - name: Inspect wheels directory after renaming files run: ls -alFR wheels/ - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: path: repo @@ -348,7 +348,7 @@ jobs: cat body.md - name: Create new pre-release and upload artifacts - uses: softprops/action-gh-release@v2.2.1 + uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0 with: files: wheels/*.whl prerelease: true @@ -372,14 +372,14 @@ jobs: env: PIP_DISABLE_PIP_VERSION_CHECK: 1 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Download wheel - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v7 with: name: bdist_wheel_${{ matrix.os }}_${{ matrix.arch }} path: wheels/ - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: "3.12" - run: pip install auditwheel @@ -399,13 +399,13 @@ jobs: id-token: write steps: - name: Download distribution artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v7 with: path: dist/ pattern: "bdist_wheel_*" merge-multiple: true - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 with: print-hash: true diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml index 12c32b828..1b6d48da3 100644 --- a/.github/workflows/test-runner.yml +++ b/.github/workflows/test-runner.yml @@ -130,7 +130,7 @@ jobs: echo "build_os=${BUILD_OS}" >> $GITHUB_OUTPUT echo "arch=${ARCH}" >> $GITHUB_OUTPUT - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set build environment variables shell: bash @@ -141,7 +141,7 @@ jobs: # Windows + CUDA: Install CUDA Toolkit - name: Install CUDA Toolkit if: inputs.backend == 'cuda' && inputs.platform == 'windows' - uses: Jimver/cuda-toolkit@6008063726ffe3309d1b22e413d9e88fed91a2f2 # v0.2.29 + uses: Jimver/cuda-toolkit@b6fc3a9f3f15256d9d94ffe1254f9c5a2565cde6 # v0.2.30 with: cuda: ${{ inputs.cuda_version }} method: "network" @@ -151,7 +151,7 @@ jobs: # Windows: Setup MSVC (needed for both CPU and CUDA builds) - name: Setup MSVC if: inputs.platform == 'windows' - uses: ilammy/msvc-dev-cmd@v1.13.0 + uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 # Build CPU backend - name: Build C++ @@ -167,7 +167,7 @@ jobs: cuda_targets: "75;89" - name: Upload build artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: ${{ steps.config.outputs.artifact_name }} path: output/${{ steps.config.outputs.build_os }}/${{ steps.config.outputs.arch }}/* @@ -184,24 +184,24 @@ jobs: if: inputs.backend == 'cuda' run: nvidia-smi - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Download build artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v7 with: name: ${{ needs.build.outputs.artifact_name }} path: bitsandbytes/ merge-multiple: true - name: Setup Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: '3.10' # Windows: Setup MSVC for torch.compile - name: Setup MSVC if: inputs.platform == 'windows' - uses: ilammy/msvc-dev-cmd@v1.13.0 + uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 - name: Install dependencies run: | From 4ab4415949a04f8fbc6926fe979c2a6137674244 Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Wed, 14 Jan 2026 10:39:11 +0200 Subject: [PATCH 5/5] CI: use uv --- .github/scripts/build-cpu.sh | 2 +- .github/scripts/build-cuda.sh | 3 +-- .github/scripts/build-rocm.sh | 2 +- .github/workflows/python-package.yml | 20 +++++++++----------- .github/workflows/test-runner.yml | 17 ++++++++--------- 5 files changed, 20 insertions(+), 24 deletions(-) diff --git a/.github/scripts/build-cpu.sh b/.github/scripts/build-cpu.sh index 5daeb5ea5..3357fe21d 100644 --- a/.github/scripts/build-cpu.sh +++ b/.github/scripts/build-cpu.sh @@ -4,7 +4,7 @@ declare build_os set -xeuo pipefail -pip install cmake==3.28.3 +uv tool install cmake==3.28.3 if [ "${build_os:0:5}" == macos ] && [ "${build_arch}" == aarch64 ]; then cmake -DCMAKE_OSX_ARCHITECTURES=arm64 -DCOMPUTE_BACKEND=cpu . diff --git a/.github/scripts/build-cuda.sh b/.github/scripts/build-cuda.sh index 9bb2f1a66..e3195dc0b 100644 --- a/.github/scripts/build-cuda.sh +++ b/.github/scripts/build-cuda.sh @@ -27,7 +27,7 @@ else [[ "${cuda_version}" == 13.*.* ]] && build_capability="75;80;86;89;90;100;120" fi -[[ "${build_os}" = windows-* ]] && python3 -m pip install ninja +uv tool install ninja cmake==3.28.3 if [ "${build_os:0:6}" == ubuntu ]; then # We'll use Rocky Linux 8 in order to maintain manylinux 2.24 compatibility. @@ -41,7 +41,6 @@ if [ "${build_os:0:6}" == ubuntu ]; then && cmake -DCOMPUTE_BACKEND=cuda -DCOMPUTE_CAPABILITY=\"${build_capability}\" . \ && cmake --build . --config Release" else - pip install cmake==3.28.3 cmake -G Ninja -DCOMPUTE_BACKEND=cuda -DCOMPUTE_CAPABILITY="${build_capability}" -DCMAKE_BUILD_TYPE=Release -S . cmake --build . --config Release fi diff --git a/.github/scripts/build-rocm.sh b/.github/scripts/build-rocm.sh index d0efa5bb3..3629903c2 100644 --- a/.github/scripts/build-rocm.sh +++ b/.github/scripts/build-rocm.sh @@ -18,7 +18,7 @@ if [ "${build_os:0:6}" == ubuntu ]; then docker run --rm --platform "linux/$build_arch" -i \ -w /src -v "$PWD:/src" "$image" sh -c \ "apt-get update \ - && pip install cmake==3.31.6 \ + && uv tool install cmake==3.31.6 \ && cmake -DCOMPUTE_BACKEND=hip -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_HIP_FLAGS=\"--offload-compress\" -DBNB_ROCM_ARCH=\"${bnb_rocm_arch}\" . \ && cmake --build ." fi diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 816b4df4d..9baa9c5a2 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -140,6 +140,9 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v6 + - uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b + with: + python-version: '3.14' - name: Clean up disk space run: | echo "Disk space before cleanup:" @@ -209,18 +212,17 @@ jobs: ls -lR output/ cp output/${{ matrix.os }}/${{ matrix.arch }}/* bitsandbytes/ - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 + uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0 with: python-version: ${{ matrix.python-version }} - cache: pip - - run: pip install build wheel - - run: python -m build . + enable-cache: 'true' + - run: uv build - name: Determine and Set Platform Tag, then Tag Wheel shell: bash run: | PLATFORM_TAG=$(python .github/scripts/set_platform_tag.py "${{ matrix.arch }}") echo "PLATFORM_TAG=$PLATFORM_TAG" - wheel tags --remove --abi-tag=none --python-tag=py3 --platform-tag=$PLATFORM_TAG dist/bitsandbytes-*.whl + uvx wheel tags --remove --abi-tag=none --python-tag=py3 --platform-tag=$PLATFORM_TAG dist/bitsandbytes-*.whl - name: Upload build artifact uses: actions/upload-artifact@v6 with: @@ -378,12 +380,8 @@ jobs: with: name: bdist_wheel_${{ matrix.os }}_${{ matrix.arch }} path: wheels/ - - name: Set up Python - uses: actions/setup-python@v6 - with: - python-version: "3.12" - - run: pip install auditwheel - - run: python ./.github/scripts/auditwheel_show.py wheels/* | tee $GITHUB_STEP_SUMMARY + - uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0 + - run: uv run --no-sync --with=auditwheel ./.github/scripts/auditwheel_show.py wheels/* | tee $GITHUB_STEP_SUMMARY publish-wheels: name: Publish wheels to PyPI diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml index 1b6d48da3..3e3b53214 100644 --- a/.github/workflows/test-runner.yml +++ b/.github/workflows/test-runner.yml @@ -193,10 +193,10 @@ jobs: path: bitsandbytes/ merge-multiple: true - - name: Setup Python - uses: actions/setup-python@v6 + - uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b with: python-version: '3.10' + activate-environment: 'true' # Windows: Setup MSVC for torch.compile - name: Setup MSVC @@ -205,21 +205,20 @@ jobs: - name: Install dependencies run: | - pip install torch==${{ inputs.torch_version }} --index-url ${{ inputs.pypi_index }} - pip install -e ".[test]" -v - pip install pytest-cov + uv pip install torch==${{ inputs.torch_version }} --index-url ${{ inputs.pypi_index }} + uv pip install pytest-cov -e ".[test]" # Windows: Downgrade NumPy for torch<2.4.1 compatibility # See: https://github.com/pytorch/pytorch/issues/131668 - name: Downgrade NumPy if: inputs.platform == 'windows' && startsWith(inputs.torch_version, '2.3.') - run: pip install "numpy<2" + run: uv pip install "numpy<2" - name: Show installed packages - run: pip list + run: uv pip list - name: Show environment information - run: python -m torch.utils.collect_env + run: uv run -m torch.utils.collect_env - name: Run tests - run: pytest --durations=100 + run: uv run pytest --durations=100