Skip to content

[HIP] [JIT] gfx1250 mha: fix the CK JIT builds and route the Python backward to asm - #7487

Merged
shengnxu merged 4 commits into
mainfrom
jim/dev/gfx1250_py_bwd
Nov 5, 2026
Merged

shengnxu merged 4 commits into
mainfrom
jim/dev/gfx1250_py_bwd

Conversation

@slippedJim

@slippedJim slippedJim commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

On gfx1250, aiter.flash_attn_varlen_func training could not run (bf16, THD, hdim 64, non-causal, sink=None, cu_seqlens_q == cu_seqlens_k). On current main the CK varlen forward fails to JIT-build, and once it builds, the backward finds no kernel. This PR fixes the CK JIT builds for gfx1250, routes the Python backward to the gfx1250 asm kernels (#6454, #6996, #7160), and fixes two issues found while validating it.

Motivation

Reproducer: flash_attn_varlen_func with q/k/v (20000, 2, 64) or (20000, 4, 64) split into two 10000-token sequences, and (20000, 2, 64) split into 10000 ragged sequences (max 5057), then .backward().

  • At 37b5395 the forward ran and the backward failed with fmha_bwd: no kernel found for given traits, skipping run / invalid argument for fmha_varlen_bwd.
  • At e4973c4 (which has [ASM] [HIP] gfx1250 mha bwd: hd64 kernels and hd128 border mask #7160) the forward fails to build mha_varlen_fwd_bf16_nlogits_nbias_nmask_lse_ndropout_nskip_nqscale: 'exec' following the 'template' keyword does not refer to a template, static assertion failed: B distribution is wrong!. hdim 64 with sink=None has no asm forward (the D64 binaries are ENABLE_SINK=1 and always load sink[head]), so it takes CK.

Causes:

  1. CK's CMakeLists defines USE_NEW_UNIFIED_FRAMEWORK=0 for any build that targets gfx1250, which the unified ck_tile framework does not support yet. The JIT does not go through that CMake, so ck_tile/core/arch/arch.hpp defaults the macro to 1, the host pass picks MMA types for the HOST target, and every gfx1250 CK fmha kernel fails to compile. With -DUSE_NEW_UNIFIED_FRAMEWORK=0 the failing units compile; with only -DCK_CMAKE_GPU_TARGET_IDS=0x1250 they still fail.
  2. generate.py defaults to --targets gfx9,gfx950. The varlen forward recipes append _ck_targets_flag() (ew kernels support on gfx12. #3330), but cmdGenFunc_mha_fwd, cmdGenFunc_mha_bwd and cmdGenFunc_mha_varlen_bwd do not, so their generated API has no gfx125 branch.
  3. _flash_attn_varlen_backward and _flash_attn_backward only send gfx942/gfx950 to fmha_v3_*_bwd, so the gfx1250 asm backward was reachable only from the C++ API.

Changes

  • aiter/jit/core.py: build_module adds -DUSE_NEW_UNIFIED_FRAMEWORK=0 when any targeted arch is gfx1250 or gfx1250-strict, as CK's CMakeLists does. It is a whole-TU define so the host and device passes agree; only CK headers read it. The arch test moves into _targets_gfx1250, which _cluster_launch_target now calls.
  • aiter/ops/mha.py:
    • cmdGenFunc_mha_fwd, cmdGenFunc_mha_bwd and cmdGenFunc_mha_varlen_bwd append _ck_targets_flag(), which is empty on gfx9.
    • gfx1250 B0+ backward goes to fmha_v3_varlen_bwd / fmha_v3_bwd for the shipped kernel set: bf16, hdim 64/64, 128/128 and 192/128, no mask or bottom-right causal, no dropout, alibi or sink. Those modules are built with -DONLY_FAV3=1 and have no CK fallback, so the gate matches hsa/gfx1250/fmha_v3_bwd/*.csv exactly and everything else stays on CK. gfx1250 only ships a32, so is_v3_atomic_fp32 is forced to True. Batch mode skips the seqlen_q <= 16 CK preference on gfx1250, which builds no such CK tiles.
    • flash_attn_func / flash_attn_varlen_func no longer take the FlyDSL forward fast path when gradients are needed. That path returns a tensor with no autograd graph; with flydsl installed the reproducer failed with element 0 of tensors does not require grad and does not have a grad_fn. no_grad calls are unchanged.
  • csrc/py_itfs_cu/asm_mha_bwd.cu: pass deterministic through instead of a hard-coded false. On gfx1250 a batch-mode deterministic backward ran the non-deterministic kernels. gfx942/gfx950 are unaffected: Python never sends a deterministic request to their asm path, and fmha_v3_bwd rejects one off gfx1250.
  • op_tests/test_build_targets_architecture.py, op_tests/test_jit_cache_transaction.py: cover _targets_gfx1250 and stub it where build_module runs in an isolated namespace.

Performance (if applicable)

Before this PR the gfx1250 backward did not run. Rough backward times on the reproducer shapes (hdim 64, bf16, non-causal; CUDA events, mean of 20 after 3 warmups, launch overhead included): the asm route this PR selects vs the CK kernels this PR makes build.

Hardware Workload/configuration CK bwd asm bwd Change
gfx1250 (MI450 ES) varlen, 2 seqs x 10000, h=2 0.498 ms 0.171 ms 2.9x
gfx1250 (MI450 ES) varlen, 2 seqs x 10000, h=4 0.772 ms 0.304 ms 2.5x
gfx1250 (MI450 ES) varlen, 10000 ragged seqs (max 5057), h=2 3.968 ms 1.825 ms 2.2x

Testing

  • Unit tests added or updated
  • Performance benchmarks run
  • Tested on MI250X
  • Tested on MI300X

Tested on gfx1250 only; see "Validation and unverified scope". Performance above is rough timing, not a benchmark run.

Documentation

  • Docstrings updated
  • User guide updated
  • Performance guide updated
  • No documentation change is needed, with the reason stated below

Dispatch and build-flag fixes only; the gfx1250 backward feature list in op_tests/cpp/mha/README.md (#7160) already describes the kernels the Python path now reaches.

Dependencies

  • No new third-party dependencies added
  • New dependencies are listed and justified below

Breaking Changes

None.

PR Self-Review

Reviewed revision

1cf7bf18c0f6

Behavior and intent

On gfx1250, flash_attn_varlen_func / flash_attn_func training could not run: the CK forward JIT build failed (unified ck_tile framework left on), the CK backward module had no gfx125 kernels (no --targets), and the Python backward never reached the gfx1250 asm kernels. After this PR the CK fmha modules build for gfx1250, bf16 backward with hdim 64/128/192x128 (no mask or bottom-right causal, no dropout/alibi/sink) runs on the asm kernels, deterministic included, and the rest falls back to CK with gfx125 kernels. Two more fixes: the batch asm entry passes deterministic through, and the FlyDSL forward fast path is skipped when gradients are needed because its output cannot be differentiated.

Validation and unverified scope

Hardware: gfx1250 (MI450 engineering sample), docker rocm/fw-bringup:gfx1250-atom-20260923 (torch 2.11.0+rocm10.1.0, HIP 7.16), ENABLE_CK=1, GPU_ARCHS=gfx1250.

  • Reproducer, --case all --check-accuracy: the three shapes pass forward and backward. With AITER_LOG_MORE=2, one process per shape, each calls mha_varlen_fwd (CK) and fmha_v3_varlen_bwd, loading fmha_bwd_hd64_odo_bf16_group, fmha_bwd_hd64_bf16_a32_pssk_group and fmha_bwd_hd64_dq_convert_bf16_group; mha_varlen_bwd is not called.
  • Against an fp32 reference with random dout (pass: max|err| / max|ref| < 2e-2 for out/dq/dk/dv; observed at most 6.1e-3):
    • varlen, the three shapes: asm, asm deterministic (dq/dk/dv bit-identical across two runs, _det kernels loaded), asm causal (causal_br kernels), and CK forced by hiding the asm gate. The ragged shape has 2470 zero-length sequences and 9999 of 10000 at most 3 tokens long.
    • flash_attn_func: hdim 64/128 x causal x deterministic at b=2 s=1000 h=4 h_k=2; b=3 s=257 h=4 h_k=1 deterministic; CK forced for hdim 64/128. Deterministic runs are bit-identical.
  • Build: before the core.py change, 40 gfx125 units of the mha_varlen_fwd module failed with the reported errors; after it, the bf16 mha_varlen_fwd, mha_fwd, mha_varlen_bwd and mha_bwd modules built here all build, and their APIs dispatch on gfx125.
  • op_tests/test_build_targets_architecture.py, op_tests/test_jit_cache_transaction.py, op_tests/test_mha_optional_flydsl.py: 92 passed. Black and Ruff clean.

Unverified:

  • gfx942/gfx950 beyond CI. The codegen flag is empty there, the gates and the build flag are gfx1250-only, and Python never passes deterministic=True to their asm path. The FlyDSL change does apply wherever FlyDSL takes a request (gfx950 fp8, gfx1250): grad-requiring calls now go through the autograd functions. That was run only on gfx1250.
  • gfx1250 A0 (gfx1250-strict): the asm gates are off there via is_gfx1250_asm_supported(); the CK path was not run on A0.
  • CK variants other than bf16 nbias with nmask/mask were not built or run (fp16, dropout, alibi, other head dims).
  • Not changed: the default blob_gen_cmd of the module_mha_* / libmha_* entries in optCompilerConfig.json (used by prebuilds, not by these Python paths), and the batch_prefill and paged-KV forward codegen, still pass no --targets.

PR-specific question

The asm backward is selected only on get_gfx() == "gfx1250" with is_gfx1250_asm_supported() (B0+; there are no hsa/gfx1250-strict bwd objects). The request must be bf16 with (hdim_q, hdim_v) in {(64, 64), (128, 128), (192, 128)} and nhead_q % nhead_k == 0, with no alibi (batch mode: no bias or dbias either), dropout_p == 0 and no sink/d_sink. The mask must be none or bottom-right causal: window_size_left == -1 after clamping to the k length, and window_size_right == -1 unless causal. Any seqlen_q/seqlen_k is accepted, since the kernels are pssk; that includes zero-length sequences in group mode and padded cu_seqlens. Batch mode on gfx1250 also skips the seqlen_q <= 16 CK preference.

These are exactly the hsa/gfx1250/fmha_v3_bwd/fmha_bwd_dqdkdv.csv rows (bf16, atomic32=1, pddv=0, mask 0 or 2, batch/group, stock/deterministic), each with matching odo and dq_convert rows. is_v3_atomic_fp32 is forced to True on gfx1250, so the atomic32=1 rows always match.

The invariant: module_fmha_v3_bwd and module_fmha_v3_varlen_bwd are built with -DONLY_FAV3=1, so a miss in get_heuristic_kernel raises instead of falling back. The Python gate therefore stays a subset of the csv. Head dims that would need padding (pddv=1), fp16, top-left causal in group mode, window masks (mask type 3, including window_size_left == 0), dropout, alibi and sink never reach it; they stay on CK, which now has gfx125 kernels. Inside fmha_v3_bwd, the arch/stepping check and the config lookup still return -1 before any kernel is loaded.

On gfx942/gfx950 the new gates are False, _ck_targets_flag() is empty, and the batch asm entry still receives deterministic=False from Python (fmha_v3_bwd rejects deterministic requests off gfx1250). -DUSE_NEW_UNIFIED_FRAMEWORK=0 is added only when a targeted arch is gfx1250 or gfx1250-strict. The FlyDSL change removes the fast path only when torch.is_grad_enabled() is True and q, k or v requires grad.

Changed op tests

  • op_tests/test_build_targets_architecture.py: test_gfx1250_target_follows_any_targeted_arch pins _targets_gfx1250, which now also gates -DUSE_NEW_UNIFIED_FRAMEWORK=0, including multi-arch GPU_ARCHS. It overlaps test_cluster_launch_follows_any_targeted_arch, since _cluster_launch_target calls the same helper, but states the helper's own contract.
  • op_tests/test_jit_cache_transaction.py: build_module runs in a hand-built namespace there, and now calls _targets_gfx1250. The new stub returns False, as for the simulated gfx942 target, next to the existing _cluster_launch_target stub; without it the test fails with NameError. What the test covers is unchanged.

slippedJim and others added 4 commits November 5, 2026 02:31
* CK's CMakeLists defines USE_NEW_UNIFIED_FRAMEWORK=0 for any build that
  targets gfx1250, which the unified framework does not support yet. The JIT
  bypasses that CMake, so ck_tile defaulted the macro to 1: the host pass of
  every gfx1250 fmha kernel picked MMA types for the HOST target and failed
  with "'exec' following the 'template' keyword does not refer to a template"
  and "B distribution is wrong!".
* build_module adds -DUSE_NEW_UNIFIED_FRAMEWORK=0 whenever a targeted arch is
  gfx1250 or gfx1250-strict. This unblocks the mha_varlen_fwd/mha_fwd JIT
  builds that flash_attn_varlen_func/flash_attn_func fall back to on gfx1250
  (e.g. head dim 64 without a sink).

Signed-off-by: Jim,Guo <[email protected]>
Co-authored-by: Cursor <[email protected]>
* cmdGenFunc_mha_fwd, cmdGenFunc_mha_bwd and cmdGenFunc_mha_varlen_bwd append
  _ck_targets_flag(), as the varlen forward recipes already do. generate.py
  defaults to --targets gfx9,gfx950, so on gfx1250 these modules had no gfx125
  dispatch branch and failed at runtime with "fmha_bwd: no kernel found for
  given traits" / "invalid argument for fmha_varlen_bwd", and "invalid argument
  for fmha_fwd" in batch mode.
* No change on gfx9 hosts, where _ck_targets_flag() is empty.

Signed-off-by: Jim,Guo <[email protected]>
Co-authored-by: Cursor <[email protected]>
…nels

* _flash_attn_varlen_backward and _flash_attn_backward send gfx1250 B0+ to
  fmha_v3_varlen_bwd / fmha_v3_bwd for the shipped kernel set: bf16, hdim 64,
  128 and 192x128, no mask or bottom-right causal, no dropout, alibi or sink.
  The asm modules have no CK fallback, so the gate matches the csv exactly and
  everything else stays on CK. gfx1250 only ships a32, so atomic32 is forced.
* Batch mode no longer prefers CK for seqlen_q <= 16 on gfx1250, which builds
  no such CK tiles.
* asm_mha_bwd.cu passed deterministic=false whatever the caller asked, so a
  batch-mode deterministic backward ran the non-deterministic kernels.

Signed-off-by: Jim,Guo <[email protected]>
Co-authored-by: Cursor <[email protected]>
* flash_attn_func and flash_attn_varlen_func return the FlyDSL forward result
  directly when FlyDSL handles the config. That tensor carries no autograd
  graph, so with flydsl installed a gfx1250 training call could not run
  backward ("element 0 of tensors does not require grad").
* Calls that need gradients now skip that path and go through the autograd
  functions; no_grad and inference calls are unchanged.

Signed-off-by: Jim,Guo <[email protected]>
Co-authored-by: Cursor <[email protected]>
@slippedJim
slippedJim requested review from a team and a balanced review from Copilot November 5, 2026 02:33
@github-actions

github-actions Bot commented Nov 5, 2026

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 7487 --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 Nov 5, 2026 •

Copy link
Copy Markdown

NOT READY FOR HUMAN REVIEW

PR Self-Review

Revision 1cf7bf18c0f6 · 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

On gfx1250, `flash_attn_varlen_func` / `flash_attn_func` training could not run: the CK forward JIT build failed (unified ck_tile framework left on), the CK backward module had no gfx125 kernels (no `--targets`), and the Python backward never reached the gfx1250 asm kernels. After this PR the CK fmha modules build for gfx1250, bf16 backward with hdim 64/128/192x128 (no mask or bottom-right causal, no dropout/alibi/sink) runs on the asm kernels, deterministic included, and the rest falls back to CK with gfx125 kernels. Two more fixes: the batch asm entry passes `deterministic` through, and the FlyDSL forward fast path is skipped when gradients are needed because its output cannot be differentiated.

Validation and unverified scope

Hardware: gfx1250 (MI450 engineering sample), docker `rocm/fw-bringup:gfx1250-atom-20260923` (torch 2.11.0+rocm10.1.0, HIP 7.16), `ENABLE_CK=1`, `GPU_ARCHS=gfx1250`.

- Reproducer, `--case all --check-accuracy`: the three shapes pass forward and backward. With `AITER_LOG_MORE=2`, one process per shape, each calls `mha_varlen_fwd` (CK) and `fmha_v3_varlen_bwd`, loading `fmha_bwd_hd64_odo_bf16_group`, `fmha_bwd_hd64_bf16_a32_pssk_group` and `fmha_bwd_hd64_dq_convert_bf16_group`; `mha_varlen_bwd` is not called.
- Against an fp32 reference with random `dout` (pass: `max|err| / max|ref| < 2e-2` for out/dq/dk/dv; observed at most 6.1e-3):
  - varlen, the three shapes: asm, asm deterministic (dq/dk/dv bit-identical across two runs, `_det` kernels loaded), asm causal (`causal_br` kernels), and CK forced by hiding the asm gate. The ragged shape has 2470 zero-length sequences and 9999 of 10000 at most 3 tokens long.
  - `flash_attn_func`: hdim 64/128 x causal x deterministic at b=2 s=1000 h=4 h_k=2; b=3 s=257 h=4 h_k=1 deterministic; CK forced for hdim 64/128. Deterministic runs are bit-identical.
- Build: before the `core.py` change, 40 gfx125 units of the `mha_varlen_fwd` module failed with the reported errors; after it, the bf16 `mha_varlen_fwd`, `mha_fwd`, `mha_varlen_bwd` and `mha_bwd` modules built here all build, and their APIs dispatch on `gfx125`.
- `op_tests/test_build_targets_architecture.py`, `op_tests/test_jit_cache_transaction.py`, `op_tests/test_mha_optional_flydsl.py`: 92 passed. Black and Ruff clean.

Unverified:
- gfx942/gfx950 beyond CI. The codegen flag is empty there, the gates and the build flag are gfx1250-only, and Python never passes `deterministic=True` to their asm path. The FlyDSL change does apply wherever FlyDSL takes a request (gfx950 fp8, gfx1250): grad-requiring calls now go through the autograd functions. That was run only on gfx1250.
- gfx1250 A0 (`gfx1250-strict`): the asm gates are off there via `is_gfx1250_asm_supported()`; the CK path was not run on A0.
- CK variants other than bf16 nbias with nmask/mask were not built or run (fp16, dropout, alibi, other head dims).
- Not changed: the default `blob_gen_cmd` of the `module_mha_*` / `libmha_*` entries in `optCompilerConfig.json` (used by prebuilds, not by these Python paths), and the batch_prefill and paged-KV forward codegen, still pass no `--targets`.

PR-specific question

The asm backward is selected only on `get_gfx() == "gfx1250"` with `is_gfx1250_asm_supported()` (B0+; there are no `hsa/gfx1250-strict` bwd objects). The request must be bf16 with (hdim_q, hdim_v) in {(64, 64), (128, 128), (192, 128)} and `nhead_q % nhead_k == 0`, with no alibi (batch mode: no bias or dbias either), `dropout_p == 0` and no sink/d_sink. The mask must be none or bottom-right causal: `window_size_left == -1` after clamping to the k length, and `window_size_right == -1` unless causal. Any seqlen_q/seqlen_k is accepted, since the kernels are pssk; that includes zero-length sequences in group mode and padded cu_seqlens. Batch mode on gfx1250 also skips the `seqlen_q <= 16` CK preference.

These are exactly the `hsa/gfx1250/fmha_v3_bwd/fmha_bwd_dqdkdv.csv` rows (bf16, atomic32=1, pddv=0, mask 0 or 2, batch/group, stock/deterministic), each with matching odo and dq_convert rows. `is_v3_atomic_fp32` is forced to True on gfx1250, so the atomic32=1 rows always match.

The invariant: `module_fmha_v3_bwd` and `module_fmha_v3_varlen_bwd` are built with `-DONLY_FAV3=1`, so a miss in `get_heuristic_kernel` raises instead of falling back. The Python gate therefore stays a subset of the csv. Head dims that would need padding (pddv=1), fp16, top-left causal in group mode, window masks (mask type 3, including `window_size_left == 0`), dropout, alibi and sink never reach it; they stay on CK, which now has gfx125 kernels. Inside `fmha_v3_bwd`, the arch/stepping check and the config lookup still return -1 before any kernel is loaded.

On gfx942/gfx950 the new gates are False, `_ck_targets_flag()` is empty, and the batch asm entry still receives `deterministic=False` from Python (`fmha_v3_bwd` rejects deterministic requests off gfx1250). `-DUSE_NEW_UNIFIED_FRAMEWORK=0` is added only when a targeted arch is gfx1250 or gfx1250-strict. The FlyDSL change removes the fast path only when `torch.is_grad_enabled()` is True and q, k or v requires grad.

Changed op tests

- `op_tests/test_build_targets_architecture.py`: `test_gfx1250_target_follows_any_targeted_arch` pins `_targets_gfx1250`, which now also gates `-DUSE_NEW_UNIFIED_FRAMEWORK=0`, including multi-arch `GPU_ARCHS`. It overlaps `test_cluster_launch_follows_any_targeted_arch`, since `_cluster_launch_target` calls the same helper, but states the helper's own contract.
- `op_tests/test_jit_cache_transaction.py`: `build_module` runs in a hand-built namespace there, and now calls `_targets_gfx1250`. The new stub returns False, as for the simulated gfx942 target, next to the existing `_cluster_launch_target` stub; without it the test fails with `NameError`. What the test covers is unchanged.

PR state

  • PASS — pull request is marked ready for review

Copilot findings

  • FAIL — an active Copilot finding has no substantive reply from the PR author
  • FAIL — an active Copilot finding has no substantive reply from the PR author

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.

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.

🟡 Changes recommended

The gfx1250 gates omit native dQ workspace limits, causing oversized requests to fail instead of using the CK fallback, and use build-target rather than runtime GPU detection.

2 open issues
What changed in this PR

This PR restores gfx1250 flash-attention training by fixing CK JIT compilation and connecting Python backward dispatch to the existing assembly kernels.

Changes:

  • Disables CK’s unsupported unified framework for gfx1250 builds and adds missing code-generation target flags.
  • Routes supported gfx1250 backward requests to assembly kernels and forwards deterministic mode.
  • Bypasses the FlyDSL forward fast path when gradients are needed and updates architecture-related tests.
File Description
op_tests/​test_jit_cache_transaction.py Stubs the new target helper in isolated build tests.
op_tests/​test_build_targets_architecture.py Tests gfx1250 detection across build-target lists.
csrc/​py_itfs_cu/​asm_mha_bwd.cu Forwards deterministic mode to native backward execution.
aiter/​ops/​mha.py Updates CK code generation, gfx1250 backward dispatch, and gradient-aware forward routing.
aiter/​jit/​core.py Adds shared gfx1250 target detection and the CK compatibility build flag.

Review effort: Balanced

Comment thread aiter/ops/mha.py Resolved
Comment thread aiter/ops/mha.py Resolved
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.

4 participants