Skip to content

[Triton/Gluon] [gfx1250] ReplaySSM KDA: take an FP16 or BF16 checkpoint - #8543

Draft
gbyu-amd wants to merge 2 commits into
feat/gfx1250-replayssm-kda-verifyfrom
gyu/gfx1250-replayssm-kda-fp16-ckpt
Draft

gbyu-amd wants to merge 2 commits into
feat/gfx1250-replayssm-kda-verifyfrom
gyu/gfx1250-replayssm-kda-fp16-ckpt

Conversation

@gbyu-amd

@gbyu-amd gbyu-amd commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #7975 / #7992: the base is their branch, feat/gfx1250-replayssm-kda-verify.

Motivation

replayssm_sigmoid_gating_delta_rule rejects any checkpoint that is not FP32. A model that keeps its KDA state in 16 bits cannot use it, so its spec verify stays on the caller's Triton kernel. An example is ATOM with ATOM_GDN_SSM_DTYPE=fp16 or bf16.

Technical Details

  • The kernel already loads the checkpoint tile into FP32 for the replay (b_ck.to(gl.float32)), and a flush stores the rebuilt state as ckpt.dtype.element_ty. So only the entry's dtype check changes.
    • The checkpoint may be FP32, FP16 or BF16.
    • A_log, dt_bias and the g records stay FP32.
    • The docstring states the rounding.
    • The accepted dtypes are exported as CKPT_DTYPES, so a caller that routes by dtype can check what the installed AITER takes.
  • Tests:
    • test_replayssm_kda_fwd runs with FP32, FP16 and BF16 checkpoints, with the checkpoint tolerance by dtype.
    • test_verify_two_transitions and test_capture_and_side_stream add an FP16 checkpoint.
    • A new test rejects an FP64 checkpoint and checks CKPT_DTYPES.
  • bench_kda_replayssm.py takes --ckpt_dtype fp32|fp16|bf16.

Performance

MI455X (gfx1250), one GPU, spec verify with 5 tokens a request, K = V = 128, BF16 activations and records, us per call (median of CUDA-graph replays of 20 calls). "Triton" is ATOM's _replayssm_kda_fwd_kernel, the fallback that a 16-bit checkpoint takes today.

value heads requests Triton FP32 Triton FP16 this kernel FP32 this kernel FP16 FP16 vs Triton FP16
12 1 7.39 7.47 4.13 4.11 1.82x
12 8 9.03 8.48 5.95 5.53 1.53x
12 32 14.94 11.34 8.42 7.74 1.47x
12 64 23.83 19.24 10.68 10.21 1.88x
12 128 43.38 31.48 18.68 17.61 1.79x
96 1 8.09 7.79 4.27 4.26 1.83x
96 8 20.65 17.26 10.19 9.82 1.76x
96 32 89.46 62.77 33.36 31.86 1.97x
96 64 180.23 135.05 68.05 67.10 2.01x
96 128 353.66 268.65 138.51 144.04 1.87x
  • An FP16 checkpoint is within -8% to +4% of an FP32 one here: the checkpoint is read once a call and written only on a flush.
  • The point of the change is that a 16-bit state pool now reaches this kernel at all: 1.47-2.01x over its current fallback.
  • Accuracy against the Triton kernel with the same FP16 checkpoint: max abs diff / max abs ref is at most 2e-3 on o and 1e-4 on the checkpoint.

Testing

replayssm_sigmoid_gating_delta_rule rejected any checkpoint that was not FP32,
so a model that keeps its KDA state in 16 bits could not use it.

The kernel already loads the checkpoint into FP32 for the replay and rounds a
flushed state to the checkpoint's dtype, so only the entry's dtype check
changes: the checkpoint may be FP32, FP16 or BF16; A_log, dt_bias and the g
records stay FP32.

The tests run the forward, two verify transitions and the graph capture with
FP16 (and the forward with BF16) checkpoints against the reference, and check
that an FP64 checkpoint is rejected. bench_kda_replayssm.py takes --ckpt_dtype.
Export CKPT_DTYPES, the checkpoint dtypes replayssm_sigmoid_gating_delta_rule
takes, and check against it. A caller that routes by dtype (ATOM's ReplaySSM
dispatch) can then send a 16-bit state pool here only when the installed AITER
takes it, and keep it on its own kernel with an older AITER.
gbyu-amd added a commit that referenced this pull request Nov 24, 2026
gbyu-amd added a commit that referenced this pull request Dec 3, 2026
#8543 @ 304c896, head 2026-11-24T06:30:44Z)

(cherry picked from commit 76c9cdc)

This branch has not been deployed

No deployments
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.

1 participant