Skip to content

Backport ROCm version fixes (#902, #959) - #962

Merged
danieldk merged 2 commits into
huggingface:release-0.17from
Abdennacer-Badaoui:backport-959-0.17
Nov 2, 2026
Merged

danieldk merged 2 commits into
huggingface:release-0.17from
Abdennacer-Badaoui:backport-959-0.17

Conversation

@Abdennacer-Badaoui

Copy link
Copy Markdown
Member

Backport to release-0.17, for a 0.17.3 release (transformers pins kernels<0.18).

Two commits:

  1. ROCm fixes for Torch 2.15 #902, Python part only: read the ROCm version from torch.version.rocm, falling back to torch.version.hip. 0.17 still uses torch.version.hip, which is 7.16 on ROCm 10.1. Without this, Accept older ROCm minor versions within the same major #959 alone would make 0.17 accept rocm7x builds on ROCm 10.x, which is the cross-major mixing we want to avoid. The kernel-builder parts of ROCm fixes for Torch 2.15 #902 are left out.
  2. Accept older ROCm minor versions within the same major #959: accept older ROCm minor versions within the same major. There was a small conflict in test_variants.py, because 0.17's test_resolve_cpu_linux has no linux_abi parameter. I kept 0.17's version.

Checked by mocking torch.version.hip = "7.16…" and torch.version.rocm = "10.1.0": the backend is detected as ROCm 10.1, and only the rocm101/rocm100 builds are accepted (not rocm71/rocm72/rocm714).

test_variants.py, test_archs.py and test_basic.py run with the same results as unmodified release-0.17: the 3 new tests pass. The 2 failures and 4 errors in test_get_variants and test_basic.py also happen on release-0.17 without these changes.

Abdennacer-Badaoui and others added 2 commits November 2, 2026 12:27
Python part only: use `torch.version.rocm` to get the ROCm version, falling back to `torch.version.hip`.

(cherry picked from commit dc9dbf4)
ROCm build variants were matched by exact tag, so a system on ROCm 10.1
rejects the existing `rocm100` builds.

This applies the same rule we use for CUDA: given a system ROCm version
x.y, builds for ROCm x.z with z <= y are accepted, newest first. Builds
for a different major are still rejected, so 7.x and 10.x builds never
mix.

(cherry picked from commit f3feb6b)
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Hi @Abdennacer-Badaoui, thanks for your interest in contributing!

This project requires that pull request authors are vouched, and you are not in the list of vouched users.

This PR will be closed automatically. See https://github.com/huggingface/kernels/blob/main/CONTRIBUTING.md for more details.

@github-actions github-actions Bot closed this Nov 2, 2026
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@danieldk danieldk reopened this Nov 2, 2026
@danieldk
danieldk merged commit 8dbe961 into huggingface:release-0.17 Nov 2, 2026
52 of 54 checks passed
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