Skip to content

[FlyDSL] Update skills and clean up codes about typed memory and pointer APIs in communication kernels - #6377

Merged
coderfeli merged 6 commits into
mainfrom
codex/flydsl-kernel-ir-cleanup
Oct 12, 2026
Merged

coderfeli merged 6 commits into
mainfrom
codex/flydsl-kernel-ir-cleanup

Conversation

@coderfeli

@coderfeli coderfeli commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Update skills, clean old apis
  • Replace raw LLVM memory, atomic, and fence builders in cross-card communication helpers with typed FlyDSL pointer and memory APIs. Preserve alignment, address space, volatile flags, ordering, and sync scopes.
  • Use typed FlyDSL comparisons in top-K merge and common atomic helpers.
  • Reuse the existing scalar buffer-load implementation from tensor_shim. Pinned FlyDSL 0.3.4.1 and merged FlyDSL main do not yet expose fx.rocdl.s_buffer_load, so the supported intrinsic path remains in buffer_ops.
  • Use public fx.inttoptr and fx.to_llvm_ptr to construct the LDS DMA pointer in MegaMoE TP and the global pointer for the INT4 all-reduce nontemporal store. The asynchronous DMA still uses its ROCDL operation; the nontemporal store now uses fx.generic_store. Target-specific operations without exact stable fx equivalents remain unchanged.

Validation

  • Pinned FlyDSL 0.3.4.1: representative communication, LDS, and common atomic probes compile to final gfx950 ISA byte-identical to the base branch. Scalar buffer load was checked at runtime on gfx950.
  • Combined branch, gfx950, COMPILE_ONLY=1: final ISA is byte-identical to the original main baseline for the full quick_allreduce_int4 specialization (world size 2, super tile 1) and MegaMoE TP specialization (H=512, I=256, TP=2, TOPK=2). Focused LDS DMA and nontemporal store probes were also byte-identical before the commits were combined.
  • black --check, ruff check, python -m py_compile, and git diff origin/main...HEAD --check pass for all 12 changed files.

@coderfeli
coderfeli requested a review from a team October 10, 2026 15:10
@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: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 6377 --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.

@github-actions github-actions Bot changed the title Refactor FlyDSL kernels to typed memory and math APIs [FlyDSL] Refactor FlyDSL kernels to typed memory and math APIs Oct 10, 2026
@coderfeli
coderfeli force-pushed the codex/flydsl-kernel-ir-cleanup branch from e60e301 to 6b0a1bc Compare October 10, 2026 15:12
@coderfeli
coderfeli force-pushed the codex/flydsl-kernel-ir-cleanup branch from 6b0a1bc to b810cf0 Compare October 10, 2026 15:19
@coderfeli coderfeli changed the title [FlyDSL] Refactor FlyDSL kernels to typed memory and math APIs [FlyDSL] Use typed memory APIs in communication helpers Oct 10, 2026
@coderfeli coderfeli changed the title [FlyDSL] Use typed memory APIs in communication helpers [FlyDSL] Use typed memory and pointer APIs in communication kernels Oct 10, 2026
@zufayu
zufayu requested a review from yadaish October 12, 2026 01:26
@coderfeli coderfeli changed the title [FlyDSL] Use typed memory and pointer APIs in communication kernels [FlyDSL] Update skills and clean up codes about typed memory and pointer APIs in communication kernels Oct 12, 2026
@coderfeli
coderfeli merged commit e0ba675 into main Oct 12, 2026
@coderfeli
coderfeli deleted the codex/flydsl-kernel-ir-cleanup branch October 12, 2026 03:12
Duyi-Wang added a commit to AMD-yanfeiwang/aiter that referenced this pull request Oct 12, 2026
…_global)

ROCm#6377 removed communication_ops_utils.traced and made _to_ptr_global
return a typed FlyDSL pointer (fx.inttoptr) instead of a raw !llvm.ptr<1>.
Move the v4 nm decode helpers onto the replacements main now uses; the
emitted loads/stores/atomics keep the same type, alignment, ordering,
syncscope and volatile flags.

- mla_v4_decode_common.py: spin_all_arrived / spin_tickets_state use
  @flyc.jit instead of @cu.traced (same AST rewrite when called inside a
  kernel trace).
- mla_v4_decode_common.py: gload, ld64_agent, ld_agent_i32 use
  fx.generic_load; st_raw, st_agent use fx.generic_store; rmw_add64_agent
  uses fx.atomic_add. Element type and alignment now come from
  cu._to_ptr_global(addr, dtype, alignment).
- mla_v4_decode_gfx950.py: ld_idx, the warm-up q / index loads and pld16
  use fx.generic_load on the typed pointer; the four global_load_lds
  sources take fx.to_llvm_ptr(cu._to_ptr_global(...)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants