Skip to content

Add Strix Halo (gfx1151) Atlas Inference Hub-kernel path for Qwen3.5/3.6/3.8 Gated DeltaNet - #49127

Merged
vasqu merged 8 commits into
huggingface:mainfrom
AzeezIsh:gdn-rocm-gfx1151
Sep 30, 2026
Merged

vasqu merged 8 commits into
huggingface:mainfrom
AzeezIsh:gdn-rocm-gfx1151

Conversation

@AzeezIsh

@AzeezIsh AzeezIsh commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

CPU CI GPU run-slow

On AMD Strix Halo (Ryzen AI Max, gfx1151, RDNA 3.5) the fla and causal_conv1d fast paths have no ROCm build, so Qwen3.5-family models (Qwen3.5, Qwen3.6-27B, Qwen3.8-27B) fall back to the slow pure-torch Gated DeltaNet (is_fast_path_available=False). This adds a rocm device entry, gated to that GPU, to the existing Qwen3_5GatedDeltaNet mapping from #46423, pointing at the ROCm build of the same Hub kernel (Atlas-Inference/gdn). Strix Halo users get the fast path automatically; every other GPU, including other ROCm GPUs, keeps its existing path.

  • One Device(type="rocm", properties=ROCMProperties(min_capability=115, max_capability=115)) entry next to the GB10 one in integrations/hub_kernels.py, same layer name and repo, revision pinned.
  • A usage note with measured numbers in docs/source/en/model_doc/qwen3_5.md.

The kernel is the same stateless kernels layer as the GB10 build. it reuses the host module's projections, gated RMSNorm and out_proj, and replaces only the conv1d, q/k L2-norm and delta-rule cores. On gfx1151 it runs the kernels the Atlas engine serves Qwen3.6/3.8-27B with on Strix Halo.

  • prefill: causal_conv1d_update_prefill → l2_norm_bf16 → FLA-chunked delta rule (recompute_wu → chunk_delta_h → chunk_fwd_o)
  • decode: causal_conv1d_update_l2norm_f32 → gated_delta_rule_decode_f32

What does this PR do?

The gated rocm entry in integrations/hub_kernels.py plus the docs note. @use_kernel_forward_from_hub("Qwen3_5GatedDeltaNet") decorators from #46423 already cover the dense and MoE classes.

Verified on Strix Halo (gfx1151, torch.cuda.get_device_capability() == (11, 5)), bf16, torch 2.14.0 ROCm 7.2 and ROCm 7.14 wheels, transformers main + kernels 0.17:

  • Parity against a float64 torch reference for every op, including ragged prefill lengths (1, 33, 65, 100, 257, 1024): 23/23 tests on both wheels.
  • kernelize() swaps the forward of all 24/24 GDN layers of Qwen/Qwen3.5-9B, and the profiler shows the kernel ops running.
  • End-user path: transformers main + this PR, from_pretrained(..., use_kernels=True) with an empty kernel cache pulls Atlas-Inference/gdn at the pinned revision. All 24/24 GDN layers of Qwen/Qwen3.5-9B run it, and greedy generate() produces identical token IDs

Measured through the end-user path (from_pretrained(..., use_kernels=True), kernel pulled from the Hub) on Qwen/Qwen3.5-9B (bf16, gfx1151, torch 2.14 + ROCm 7.2, 1024-token prompt, greedy decode of 256 tokens; mean of two runs):

use_kernels TTFT (prefill) Decode
False (PyTorch fallback) 1.33 s 5.77 tok/s
True (Atlas-Inference/gdn) 1.16 s (1.15x faster) 6.23 tok/s

About 74% of this prefill is the dense projection GEMMs, which the kernel doesn't touch. Per Gated DeltaNet layer of Qwen/Qwen3.8-27B (real weights), the kernel is 1.65x faster on a 1024-token prefill and 1.26x faster per decode step. The published build targets torch 2.14 with ROCm 7.2.

Follow-up to #46423 (the GB10/SM121 entry). The ROCm build needs kernel-builder with gfx1151 support, which landed in huggingface/kernels#839 (tracked in huggingface/kernels#834). No overlapping PR exists.

The same trust note applies as for the GB10 entry: the mapped kernel needs trust_remote_code=True until Atlas-Inference is on the kernels trusted-publisher allowlist, would love to enable this for continued future contributions without any blocks!

Code Agent Policy

  • I confirm that this is not a pure code agent PR.

Before submitting

Who can review?

@vasqu original PR merger, @danieldk first issue
Potentially @drbh (kernels integration) and @Cyrilvallez (text models / Qwen3.5) as well :)
If you could enable myself on the kernels trusted-publisher allowlist that would help for the future!

@Rocketknight1

Copy link
Copy Markdown
Member

cc @Abdennacer-Badaoui

@vasqu vasqu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yep thanks, same as in the GB10 case. Would just like to combine the comments to just mention kernels in general and note your special kernels with their benchmarks

Comment thread docs/source/en/model_doc/qwen3_5.md Outdated
Comment on lines +77 to +92
| `False` (PyTorch fallback) | 1.33 s | 5.77 tok/s |
| `True` ([`Atlas-Inference/gdn`](https://huggingface.co/kernels/Atlas-Inference/gdn)) | 1.16 s (1.15x faster) | 6.23 tok/s |

Most of this prefill is the dense projection GEMMs, which the kernel does not touch; per Gated DeltaNet layer of `Qwen/Qwen3.8-27B` the kernel is 1.65x faster on a 1024-token prefill and 1.26x faster per decode step. The published build targets torch 2.14 with ROCm 7.2.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Imo we can combine both into mentioning the specialized kernels wdyt?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I.e. we can shorten the comments a bit and nudge users to use your kernels on the specialized hw

@AzeezIsh AzeezIsh Sep 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure I can work on this @vasqu! Will have an update for you in a moment. Ideally pass CI too then 😅

@Abdennacer-Badaoui

Copy link
Copy Markdown
Member

Thanks @AzeezIsh

@vasqu vasqu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Perf cc @stevhliu if you have some time to check but otherwise would likely merge tomorrow 🤗

Comment thread docs/source/en/model_doc/qwen3_5.md Resolved
AzeezIsh and others added 2 commits September 28, 2026 14:00
Co-authored-by: Anton Vlasjuk <73884904+vasqu@users.noreply.github.com>
@AzeezIsh

Copy link
Copy Markdown
Contributor Author

Thanks for taking a look @vasqu, @Abdennacer-Badaoui! As I mentioned above, would appreciate if it was possible to add Atlas Inference to the kernels trusted-publisher allowlist. I could then continue making future contributions that automatically slot in rather than the additional trust_remote_code flag here :)

If there's an additional process for this, more than happy to take it on 🫡

@stevhliu stevhliu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks for the docs! just one question and some small nits :)

if i understand correctly, it seems like the kernel is selected based on a capability number thats shared by several AMD GPUs and not just Strix Halo. this may be worth clarifying

Comment thread docs/source/en/model_doc/qwen3_5.md Outdated

- Layers are hybrid: [`Qwen3_5TextConfig`]'s `layer_types` is a per-layer list of `"linear_attention"` or `"full_attention"` that encodes the 3:1 Gated DeltaNet / Gated Attention stack. The DeltaNet path (`Qwen3NextGatedDeltaNet`) needs the optional `causal_conv1d` (from [Dao-AILab](https://github.com/Dao-AILab/causal-conv1d)) and `fla` packages for its fast kernels — without them, the model silently falls back to slower and more memory hungry PyTorch ops.
- On NVIDIA GB10 (compute capability 12.1 / SM121) neither `causal_conv1d` nor `fla` ship an SM121 build, so the DeltaNet path always falls back to the slow PyTorch reference. Passing `use_kernels=True` (`pip install -U kernels`) to [`~PreTrainedModel.from_pretrained`] swaps the Gated DeltaNet conv1d and delta-rule cores for a compute-capability-gated Hub kernel ([`Atlas-Inference/gdn`](https://huggingface.co/kernels/Atlas-Inference/gdn)); every other GPU keeps the existing path. The kernel is numerically faithful to the fallback (identical greedy output) and speeds up prefill. Measured on `Qwen/Qwen3.6-27B` (bf16, GB10/SM121, 1024-token prompt, greedy decode of 256 tokens):
- On NVIDIA GB10 (`SM121`) and AMD Strix Halo (`gfx1151`), `causal_conv1d` and `fla` have no build, so the DeltaNet path falls back to the slow PyTorch reference. Pass `use_kernels=True` (`pip install -U kernels`) to [`~PreTrainedModel.from_pretrained`] to use the specialized [`Atlas-Inference/gdn`](https://huggingface.co/kernels/Atlas-Inference/gdn) kernels instead. They are gated to these two GPUs (every other GPU keeps the existing path), produce identical greedy output, and currently load with `trust_remote_code=True` until `Atlas-Inference` is added to the trusted-kernels allowlist. The Strix Halo build targets torch 2.14 with ROCm 7.2. Measured in bf16 with a 1024-token prompt and greedy decode of 256 tokens:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
- On NVIDIA GB10 (`SM121`) and AMD Strix Halo (`gfx1151`), `causal_conv1d` and `fla` have no build, so the DeltaNet path falls back to the slow PyTorch reference. Pass `use_kernels=True` (`pip install -U kernels`) to [`~PreTrainedModel.from_pretrained`] to use the specialized [`Atlas-Inference/gdn`](https://huggingface.co/kernels/Atlas-Inference/gdn) kernels instead. They are gated to these two GPUs (every other GPU keeps the existing path), produce identical greedy output, and currently load with `trust_remote_code=True` until `Atlas-Inference` is added to the trusted-kernels allowlist. The Strix Halo build targets torch 2.14 with ROCm 7.2. Measured in bf16 with a 1024-token prompt and greedy decode of 256 tokens:
- `causal_conv1d` and `fla` don't provide a build for NVIDIA GB10 (`SM121`) and AMD Strix Halo (`gfx1151`), so the DeltaNet path falls back to the slow PyTorch reference. Pass `use_kernels=True` (`pip install -U kernels`) to [`~PreTrainedModel.from_pretrained`] to use the specialized [Atlas-Inference/gdn](https://huggingface.co/kernels/Atlas-Inference/gdn) kernels instead. They are gated to these two GPUs (every other GPU keeps the existing path), and produce identical greedy output. The mapping currently enables `trust_remote_code=True` for this kernel because `Atlas-Inference` is not yet on the trusted-kernels allowlist. The Strix Halo build targets torch 2.14 with ROCm 7.2. Benchmarks used bf16 with a 1024-token prompt, and greedy decoding for 256 tokens.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks @stevhliu. Well this rocm entry matches on torch.cuda.get_device_capability(), and every RDNA 3.5 part does report (11, 5) including gfx1150 (Strix Point), gfx1151(Strix Halo) and gfx1152 (Krackan Point). Given ROCMProperties takes a capability range, the mapping itself can't narrow down to gfx1151. So what does keep others off this particular kernel is the arch check with the published build declaring gfx1151, so on gfx1150/gfx1152 use_kernels=True fails at load with an "arch not supported by the build". I've pushed it up to clarify!

@github-actions

Copy link
Copy Markdown
Contributor

CI recap

Dashboard: View test results in Grafana
Latest run: 36597250203:2
Result: success | Jobs: 16 | Tests: 115,710 | Failures: 0 | Duration: 10h 23m

@AzeezIsh

Copy link
Copy Markdown
Contributor Author

Thanks for approving y'all! Quick bump on this @vasqu / @stevhliu I think CI is awaiting one more approval-gated pass :)

@vasqu
vasqu enabled auto-merge September 30, 2026 15:02
@vasqu
vasqu added this pull request to the merge queue Sep 30, 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.

@sayakpaul

Copy link
Copy Markdown
Member

@AzeezIsh thanks for your continued support. The number of seats we want to allocate for "Trusted Publishers" is really really limited and is quite reserved at the moment. This is why allowing repo ids through trust_remote_code is the compromise we came up with. But we'd be happy to set up a Slack channel, feel free to write to anton.vlasjuk@huggingface.co.

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 30, 2026
@vasqu
vasqu added this pull request to the merge queue Sep 30, 2026
@vasqu
vasqu removed this pull request from the merge queue due to a manual request Sep 30, 2026
@vasqu
vasqu merged commit 8520b15 into huggingface:main Sep 30, 2026
116 checks passed
@AzeezIsh

AzeezIsh commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

@AzeezIsh thanks for your continued support. The number of seats we want to allocate for "Trusted Publishers" is really really limited and is quite reserved at the moment. This is why allowing repo ids through trust_remote_code is the compromise we came up with. But we'd be happy to set up a Slack channel, feel free to write to anton.vlasjuk@huggingface.co.

Done! CC'ed you as well @sayakpaul

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.

7 participants