Skip to content

[HIP] [JIT] Add gfx950 prefill FP8 MQA logits - #7183

Merged
amd-ruitang3 merged 2 commits into
ROCm:mainfrom
moreh-dev:sumin/fp8-mqa-v35wes
Nov 23, 2026
Merged

amd-ruitang3 merged 2 commits into
ROCm:mainfrom
moreh-dev:sumin/fp8-mqa-v35wes

Conversation

@sumin-hong

@sumin-hong sumin-hong commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Validation status: Based on ROCm/aiter main at f0b96f49e7d8518950292d41b6a27ceadc772315. The review follow-up replaces the native Torch interface with aiter_tensor_t; the public Python API and device-kernel arithmetic are preserved. Historical GPU measurements below retain their stated earlier builds. A clean HIP build and current-head GPU validation remain pending.

[HIP] [JIT] fp8_mqa_logits: v35w gfx950 prefill indexer logits kernel

Motivation

This PR adds a faster HIP kernel for the prefill fp8 MQA indexer logits used by GLM-5.x / DeepSeek-V3.2 sparse attention, on gfx950 (MI355X):

logits[m, n] = sum_h relu(Q[m,h,:] . K[n,:]) * w[m,h] * kv_scale[n]
               for n in [ks[m], ke[m]), -inf elsewhere

The added API and JIT module are:

  • Python entry: aiter.ops.fp8_mqa_logits.fp8_mqa_logits / is_supported
  • JIT module: module_fp8_mqa_logits

It is an alternative to the Triton/Gluon aiter.ops.triton.attention.fp8_mqa_logits. It supports n_heads = 32 and head_dim = 128 only; other shapes are routed via is_supported().

Design (csrc/kernels/fp8_mqa_logits.cu)

  • Workgroup layout. One workgroup is 8 waves × 4 rows = 32 query rows. Q and w stay in VGPRs, and all waves walk the same K sequence, so K is read once per 32 rows.
  • K staging. K is staged through LDS with a bank-conflict-free swizzle, and kv_scale is staged next to it. Raw buffer loads prefetch 4 stages ahead. The vmcnt waits are placed by hand, because vmcnt also counts the logits stores and compiler-derived waits drain them every stage.
  • Epilogue. MFMA is the plain v_mfma_f32_32x32x64_f8f6f4. The fp32 epilogue is scalar (v_max relu, v_fma with w) and is interleaved under the MFMAs. On gfx950, scalar VALU co-issues with an independent MFMA, but packed v_pk_* does not. Accumulation uses even/odd chains in a fixed order.
  • Reduction and stores. The v_permlane32_swap head reduction is inline asm, because the clang builtin miscompiles its 2nd result on ROCm 7.2.3. kv_scale is applied after the reduction. The tail of each row pair is deferred by one sub-tile so it fills the MFMA→VALU hazard window, which leaves no s_nop in the loop.
  • Masking and -inf. Stages are split into clean stages (no compare/select) and masked boundary stages, and both are shared across grid.y = SplitN. With clean_logits the kernel writes -inf itself, so there is no torch.full pass.
  • Grid choice. (SplitN, reverse_rows) comes from a makespan model fitted on MI355X.
  • Build flags. -fno-honor-nans -fno-slp-vectorize -mllvm -disable-machine-sink:
    • -fno-slp-vectorize: otherwise the epilogue is re-packed into v_pk_fma.
    • -mllvm -disable-machine-sink: otherwise the last row's MFMA pair sinks past the loop exit.

The table below describes the earlier v35w kernel. The current source head is the subsequent v35wes variant, which moves the stage barrier earlier and adds a per-wave s_setprio staircase. Its source commit reports bit-exact output versus v35w and 1.2–2.8% lower kernel time across two runs; those measurements have not been independently repeated here.

Kernel time on the GLM-5.3-Flash table shapes (MI355X, µs, clean_logits=True)

Setup:

  • Harness: cold timing with a 1 GiB L2/MALL flush, device time from torch.profiler, median of 3 rotated runs.
  • Image: vllm/vllm-openai-rocm:v0.30.0.
  • Baselines: aiter main b59277d (14/10). FlyDSL uses flydsl 0.3.4.1; Gluon uses Triton 3.7.1.
s_q s_k FlyDSL (#4538) this PR Gluon (#5216) HIP (#5046) this / FlyDSL
causal · 1 request per chunk
8192 8192 181.5 142.3 219.0 228.7 1.28×
4096 32768 629.7 423.3 758.0 648.6 1.49×
2048 65536 633.1 430.2 790.3 723.5 1.47×
1024 131072 637.8 430.2 793.8 798.7 1.48×
16384 32000 (kpool 4) 2165.4 1571.5 2809.4 2388.6 1.38×
multi_req · 4 requests per chunk
4096 32768 218.6 155.8 268.0 274.7 1.40×
2048 65536 219.1 165.9 269.8 291.2 1.32×
1024 131072 221.5 204.1 273.5 282.9 1.09×
8192 8192 94.2 88.5 96.9 120.4 1.06×

Geomean vs FlyDSL #4538: 1.32× with clean_logits=True and 1.39× with clean_logits=False. It is also faster than every stronger baseline we measured, per shape:

Against the best of those on each shape, the geomean is 1.26× (clean) and 1.30× (no-clean). The one exception is 8192×8192 multi_req, where this PR loses by 3% (clean) and 18% (no-clean, vs Gluon on the AMD Triton).

Test plan

  • Op test. python3 op_tests/test_fp8_mqa_logits.py --num-heads 32 --head-dim 128: all 150 HIP cases pass. They cover 6 window modes (causal, cp, misaligned, empty, past_end, multi_req), clean_logits 0/1, and a NaN-poisoned output buffer. The -inf mask matches exactly and checkAllclose err = 0.
  • Op-test perf vs the Triton/Gluon kernel in main on the real chunk shapes (4096×32768, 2048×65536, 1024×131072): 1.38–1.85× (causal), 1.35–1.45× (multi_req), 1.11–1.57× (cp).
  • JIT build identity. The JIT-built module is bit-exact against the standalone build used for the measurements and the vLLM E2E run, on 15 shapes × clean 0/1.
  • E2E. In the vLLM nightly (GLM-5.3-Flash TP4, 128k/1k), output was correct: needles 5/5, top-512 identical on ≥ 99.8 % of rows vs the aiter result. TTFT changed by −1.4 % at c4.

Known limitations

  • Default grid choice for multi-request chunks. The SplitN model assumes one causal request per chunk, so for multi-request chunks the default can be far from the best grid. For example, 1024×131072 multi_req takes 204 µs by default versus 159 µs with an explicit SplitN=20. Callers that know the layout can pass SplitN; a layout-aware heuristic is a follow-up.
  • Small shapes. At M ≤ 128, or at small square shapes such as 1024×1024, the 32-row workgroup is too coarse and the Triton/FlyDSL kernels are faster. Route those through is_supported() plus a size gate in the caller if needed.
  • Kernel-time scaling follows the windows of the whole 32-row block. Interleaved empty / past-end rows therefore cost about as much as full rows (the empty and past_end op-test modes).

Review update (2026-11-16)

Follow-up 48906854b749e5b4361e0e93ec1d5bb9b59423e1 removes Torch/ATen/c10 dependencies from this operator's native header, kernel and pybind source. The native entry takes aiter_tensor_t with a required output buffer, uses HipDeviceGuard/aiter::getCurrentHIPStream(), and registers AITER_EXTENSION_NAME plus AITER_SET_STREAM_PYBIND. The JIT module enables torch_exclude.

The public fp8_mqa_logits Python signature is unchanged. It allocates FP32 output when out=None, otherwise reuses the supplied buffer, and calls the private develop=True binding. Native argument failures are guarded by AiterThrowGuard so Python receives an exception.

CPU wrapper tests cover allocation, output identity and tunable forwarding. Static checks preserve device arithmetic and launch logic after the local WARP_SIZE → WAVE_SIZE rename. No local HIP toolchain or gfx950 GPU is available, so a clean JIT build, shared-library linkage inspection, current-head GPU correctness and benchmarks were not run here. Historical measurements retain their original builds.

Related work

  • #4538 adds a FlyDSL prefill implementation with direct and LDS-staged variants; this PR adds an independent fixed-shape HIP implementation. The historical comparison above includes FlyDSL.
  • #5216 optimizes the Gluon prefill path.
  • #6185 proposes an AITER dispatch and tuned table for Triton/FlyDSL. This PR adds an opt-in HIP operator and does not integrate it into that dispatcher.
  • #5046 was an earlier HIP implementation closed after comparison with existing backends; the table above includes that prior kernel.

Current validation

  • Black 26.3.0, Ruff 0.15.7, changed-line clang-format 18.1.8, syntax and diff checks passed.
  • Supplied review-fix AST/tokens, module registration scope, device-code equivalence and CPU wrapper contracts passed.
  • No local HIP toolchain or gfx950 GPU is available, so a clean JIT build, shared-library linkage inspection, current-head GPU correctness and benchmarks were not run here. Historical measurements retain their original builds.

AI assistance: Claude Code was used in the source development; OpenAI Codex was used for the rebase, static validation, and preparation of this PR.

PR Self-Review

Reviewed revision

48906854b749e5b4361e0e93ec1d5bb9b59423e1

Behavior and intent

This adds an opt-in gfx950 HIP prefill MQA logits operator. It computes weighted ReLU dot products over a contiguous gathered K buffer and supports clean or caller-managed output masks; existing Triton/Gluon and FlyDSL paths remain available. The aim is improved performance for the supported GLM indexer shapes.

Validation and unverified scope

The supplied review fix was compared by Python AST/C++ tokens, with the prefill exception guard added locally. Device-kernel arithmetic and launch code are preserved after the WARP_SIZE/WAVE_SIZE rename. Black 26.3.0, Ruff 0.15.7, changed-line clang-format 18.1.8, syntax and diff checks passed. CPU wrapper tests cover allocation, supplied-output reuse and tunable forwarding; the C++ host harness exercises exception-guard behavior. No local HIP toolchain or gfx950 GPU is available, so a clean JIT build, shared-library linkage inspection, current-head GPU correctness and benchmarks were not run here. Historical measurements retain their original builds.

PR-specific question

The intended contract is gfx950, 32 heads, head dimension 128, FP8 Q/K, float32 scales and weights, and int32 row bounds. The caller must check is_supported and supply the documented dtypes and contiguous layouts; the operator does not automatically route unsupported inputs. The C++ entry checks shape, contiguity and one-byte Q/K storage, but one-byte storage alone does not prove the FP8 dtype.

Changed op tests

op_tests/test_fp8_mqa_logits.py compares the new operator and Triton to the reference with clean and unclean outputs, poisoned buffers, causal, CP, misaligned, empty, past-end and multi-request windows. This new HIP entry and its masking behavior are not covered by the existing backend-only tests.

@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:windows Windows JIT op smoke test on the gfx1201 ROCm runner
ci:multi-gpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 7183 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

@aiter-bot

aiter-bot commented Oct 30, 2026 •

Copy link
Copy Markdown

READY FOR HUMAN REVIEW

PR Self-Review

Revision 48906854b749 · mode shadow

Author self-review accepted. Readiness report:

Author answers

  • PASS — current-SHA answers are present and structurally specific
Show the author's self-review answers

Behavior and intent

This adds an opt-in gfx950 HIP prefill MQA logits operator. It computes weighted ReLU dot products over a contiguous gathered K buffer and supports clean or caller-managed output masks; existing Triton/Gluon and FlyDSL paths remain available. The aim is improved performance for the supported GLM indexer shapes.

Validation and unverified scope

The supplied review fix was compared by Python AST/C++ tokens, with the prefill exception guard added locally. Device-kernel arithmetic and launch code are preserved after the WARP_SIZE/WAVE_SIZE rename. Black 26.3.0, Ruff 0.15.7, changed-line clang-format 18.1.8, syntax and diff checks passed. CPU wrapper tests cover allocation, supplied-output reuse and tunable forwarding; the C++ host harness exercises exception-guard behavior. No local HIP toolchain or gfx950 GPU is available, so a clean JIT build, shared-library linkage inspection, current-head GPU correctness and benchmarks were not run here. Historical measurements retain their original builds.

PR-specific question

The intended contract is gfx950, 32 heads, head dimension 128, FP8 Q/K, float32 scales and weights, and int32 row bounds. The caller must check is_supported and supply the documented dtypes and contiguous layouts; the operator does not automatically route unsupported inputs. The C++ entry checks shape, contiguity and one-byte Q/K storage, but one-byte storage alone does not prove the FP8 dtype.

Changed op tests

op_tests/test_fp8_mqa_logits.py compares the new operator and Triton to the reference with clean and unclean outputs, poisoned buffers, causal, CP, misaligned, empty, past-end and multi-request windows. This new HIP entry and its masking behavior are not covered by the existing backend-only tests.

PR state

  • PASS — pull request is marked ready for review

Copilot findings

  • PASS — no active Copilot finding lacks a substantive author reply
  • ADVISORY — Copilot could not review the current head (for example, quota or service failure)

Code and op-test hygiene

  • PASS — no committed artifact or conflict marker detected

Required CI

  • PASS — Black: passed
  • PASS — Ruff: passed
  • PASS — Repository dependency: passed
  • PASS — Aiter Test Gate: passed

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

Co-authored-by: OpenAI Codex <[email protected]>
Signed-off-by: Sumin Hong <[email protected]>
@sumin-hong
sumin-hong force-pushed the sumin/fp8-mqa-v35wes branch from 4403a8a to 460c230 Compare October 30, 2026 05:34
@sumin-hong
sumin-hong marked this pull request as ready for review October 30, 2026 05:34
@sumin-hong
sumin-hong requested review from a team and a balanced review from Copilot October 30, 2026 05:34

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@qgzhou

qgzhou commented Nov 13, 2026

Copy link
Copy Markdown

@amd-ruitang3 could you please review this?

@amd-ruitang3

Copy link
Copy Markdown
Contributor

I validated this PR after a local rebase onto ROCm/aiter main. The rebase completed without conflicts. The HIP kernel, wrapper, header, pybind source, and PR op test are unchanged from the original PR head.

  • Original PR head: 460c230
  • Fetched main: 3d3d56d
  • Tested local rebased commit: 1ca7e6944b1baf1546f336ad8857811d878ee3df (local only; the PR branch was not updated)
  • Validation date: November 16, 2026

Environment: container rui_1106, image rocm/atom-dev:nightly_202611060646; gfx950 with 256 CUs; ROCm/hipcc 7.2.4; PyTorch 2.10.0+rocm7.2.4.git3d3aa833; Triton 3.8.0; FlyDSL 0.5.0. The Triton public entry selected the gfx950 Gluon kernel. FlyDSL was installed into an isolated directory because the image supplied 0.4.2 and current main requires 0.5.0.

Correctness passed for the supported shape/dtype contract:

  • 150/150 PR op-test cases passed, with 32 heads, head dimension 128, native E4M3FN FP8 Q/K, float32 scales/weights, and int32 row bounds. This covers clean/no-clean and causal, CP, misaligned, empty, past-end, and multi-request windows. No cases were skipped for OOM. HIP and Gluon had zero elementwise mismatches at rtol=atol=1e-2, exact -inf mask agreement, and passing aggregate calc_diff checks. I added an assertion that checkAllclose returns zero; the original test records that value but does not assert it.
  • 510/510 additional HIP checks passed against a separate FP32 einsum reference using torch.testing.assert_close at rtol=atol=1e-2. These cover NaN-poisoned caller-provided out, num_warps=4/8, SplitN=1/3/20, both row orders, both clean modes, window modes, partial row/tile shapes, and zero-length inputs. The returned tensor reuses out; clean writes -inf outside the valid window, and no-clean leaves those positions untouched.
  • All three backends also passed the FP32-reference checks in each of the 16 benchmark cases below: 48/48 candidate checks passed.

The PR suite uses the entry point below. My full run used an external wrapper to enforce the additional assertion and record each result:

python3 op_tests/test_fp8_mqa_logits.py --num-heads 32 --head-dim 128

Cold-cache performance: public APIs with default launch heuristics and internally allocated output. Each sample follows a 1 GiB cache fill and synchronization. There are 10 warmup calls and three rounds of 21 samples, with backend order rotated between rounds. Values are the median of the three round medians, in microseconds. Gluon clean-mode output initialization is included.

I summed actual GPU kernel durations inside each isolated GPU annotation range in the profiler trace. Cache-flush kernels and CPU launch gaps are excluded. This avoids a ROCTracer CPU-correlation issue observed during the run, where unrelated cache fills could be attributed to the measured call.

M N Window clean_logits HIP (μs) Gluon (μs) FlyDSL default (μs) Gluon / HIP FlyDSL / HIP
8192 8192 causal false 127.44 166.24 200.96 1.304× 1.577×
8192 8192 causal true 146.76 207.04 215.68 1.411× 1.470×
8192 8192 multi_req false 61.56 53.32 75.08 0.866× 1.220×
8192 8192 multi_req true 94.64 95.28 108.16 1.007× 1.143×
4096 32768 causal false 402.12 570.52 921.17 1.419× 2.291×
4096 32768 causal true 406.00 681.08 925.09 1.678× 2.279×
4096 32768 multi_req false 110.24 170.96 255.24 1.551× 2.315×
4096 32768 multi_req true 166.76 249.80 295.96 1.498× 1.775×
2048 65536 causal false 408.44 642.28 953.21 1.573× 2.334×
2048 65536 causal true 415.16 703.08 991.01 1.694× 2.387×
2048 65536 multi_req false 112.24 177.32 253.20 1.580× 2.256×
2048 65536 multi_req true 183.20 257.44 304.12 1.405× 1.660×
1024 131072 causal false 413.88 668.64 992.53 1.616× 2.398×
1024 131072 causal true 411.64 708.12 981.81 1.720× 2.385×
1024 131072 multi_req false 112.80 184.68 258.88 1.637× 2.295×
1024 131072 multi_req true 205.84 260.28 301.24 1.264× 1.463×

For the 32K/64K/128K single-request cases, clean-mode speedup over current Gluon is 1.68–1.72×. For four requests on those shapes, it is 1.26–1.50×. At 8192 × 8192 with four requests, clean is close to Gluon, while no-clean is 15.5% slower (61.56 vs 53.32 μs). The small 64 × 2048 smoke case is also slower than FlyDSL. These results support selecting the backend by shape and workload.

The FlyDSL column uses current main’s default variants with FlyDSL 0.5.0, without a best-variant search: mfma32x32x64_bkv64_r2_w4_lds3 for 8192 × 8192, and mfma32x32x64_bkv64_r2_w2_lds3 for the three long-context shapes. This is a different baseline from the earlier revisions in the PR description, so these measurements are not a reproduction of the historical 1.32× geomean against that older FlyDSL baseline.

Scope: this validates operator correctness and operator-level performance after rebase on ROCm 7.2.4. I did not repeat vLLM model evaluation, top-k output comparisons, needles tests, or TTFT measurements, so this run does not establish end-to-end speedup.

@amd-ruitang3

Copy link
Copy Markdown
Contributor

@sumin-hong We cannot include torch headers in .h or .cu files. This will slow down the compiler significantly and make the resulting .so library tied to a specific PyTorch version.
you can refer to other kernel such as remove torch dependency.

namle-213 added a commit to moreh-dev/rocm-aiter that referenced this pull request Nov 16, 2026
Review on ROCm#7183: csrc .h/.cu must not include torch headers
(slow compiles, .so tied to one PyTorch version). Follow the
torch-free pattern of mega_mhc / dsv4_dequant_gather_k:

- fp8_mqa_logits.h: include only aiter_tensor.h; aiter::fp8_mqa_logits
  takes aiter_tensor_t and writes into a caller-provided `out`.
- fp8_mqa_logits.cu: TORCH_CHECK -> AITER_CHECK, at:: HIP guard/stream ->
  HipDeviceGuard + aiter::getCurrentHIPStream(); dtype checks on
  AiterDtype; add a same-device check. Kernel-local WARP_SIZE renamed
  to WAVE_SIZE (collides with aiter_hip_common.h's WARP_SIZE).
- pybind: AITER_EXTENSION_NAME + AITER_SET_STREAM_PYBIND; out is the
  first, required argument; the ignored unroll2 is no longer bound.
- optCompilerConfig.json: module_fp8_mqa_logits is torch_exclude.
- aiter/ops/fp8_mqa_logits.py: compile_ops(develop=True) binding
  `_fp8_mqa_logits`; the public fp8_mqa_logits keeps its signature and
  allocates `out` (torch.empty [M, N] f32) when it is None.

The 8 kernel instantiations compile to the same gfx950 ISA as before
(ROCm 7.2.3, label-normalized diff), and the built .so links no
torch/c10 library.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012r9e4kzvV1zZxs8eymhVjv
Signed-off-by: namle <[email protected]>
Use aiter_tensor_t, explicit output and AITER stream plumbing in the native module. Preserve the public Python signature and output reuse. Keep argument failures catchable with AiterThrowGuard.

Co-authored-by: OpenAI Codex <[email protected]>
Signed-off-by: Sumin Hong <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 12:06

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Copy link
Copy Markdown
Contributor Author

Addressed the Torch-dependency request in this follow-up.

The native header/kernel/pybind use aiter_tensor_t, AITER_CHECK, AITER device/stream handling and the standalone module/stream macros. module_fp8_mqa_logits enables torch_exclude. Output allocation moved to Python; the public signature, supplied-output reuse and launch tunables are preserved. AiterThrowGuard preserves catchable argument errors.

CPU wrapper/exception checks, Black/Ruff, changed-line clang-format and source/device-code comparisons passed. Device arithmetic and launch logic are unchanged after the WARP_SIZE/WAVE_SIZE rename. A clean HIP build, .so linkage inspection and GPU rerun remain pending; they were not run on this host.

@amd-ruitang3
amd-ruitang3 merged commit a027406 into ROCm:main Nov 23, 2026
39 of 43 checks passed
sumin-hong added a commit to moreh-dev/rocm-aiter that referenced this pull request Nov 23, 2026
Merge current main after ROCm#7183 and retain both prefill and paged MQA
registrations in the shared compiler configuration and pybind header.
Preserve upstream header additions and the reviewed paged kernel/API.

Co-authored-by: OpenAI Codex <[email protected]>
Signed-off-by: Sumin Hong <[email protected]>
valarLip pushed a commit that referenced this pull request Nov 23, 2026
zufayu pushed a commit that referenced this pull request Nov 24, 2026
…rd (#8507)

* Reapply "[HIP] [JIT] Add gfx950 prefill FP8 MQA logits" (#7183)

This reverts commit cf16a55 (#8504),
restoring the operator from #7183 by @sumin-hong unchanged. The build fix
follows in the next commit.

* [HIP] fp8_mqa_logits: guard the gfx950 kernel for multi-arch builds

The kernel uses __builtin_amdgcn_mfma_scale_f32_32x32x64_f8f6f4 and
v_permlane32_swap_b32, which exist only on gfx950, so building with
GPU_ARCHS="gfx942;gfx950" failed with "needs target feature gfx950-insts".

Compile the kernel body only for __gfx950__ and trap elsewhere, as the
other gfx950-only kernels do. fp8_mqa_logits() now raises on other archs
instead of launching the stub.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants