Repository navigation
Conversation
🏷️ CI GuideRuns automatically on every eligible PR before approval:
Heavy model tests:
Path scope:
|
whx-sjtu
left a comment
There was a problem hiding this comment.
ATOM PR #3637 — Merge Kimi BF16 MoE front and combine its reductions
Merges eligible Kimi projections into one BF16 GEMM, reduces routed/shared partials together, and preserves supported latent input views through an explicit output destination.
Review: ✅ LGTM for source and CPU scope at cb6f1af7fc7e3c9f8722750419c09c9b6b966790; one grouped Category A PR, with landing held.
Coverage: 2 files / 235 added lines -- within one review pass
Validation (advisory): Independent Windows CPU: 157 passed, 5 GPU skipped; eleven in-memory controls rejected their defects, including a direct AOT owner-copy witness — one run, this box, unverified by the deterministic validator. Maintained Linux CI: 15,208 passed, 1,548 skipped, 3 xfailed; all 52 new CPU cases executed. CI merge 6cca75cb98 has the same tree as this head. GPU numerical/compiled execution, native/plugin accuracy, complete decode/verify/prefill timing, temporary and steady-state memory, #3587/#3628 integration and final landing-tree checks remain outstanding. No landing approval.
valar-cop
left a comment
There was a problem hiding this comment.
some changes needed..
gpu evidence that aiter's selected mxfp4 stage-1 kernel accepts the row-strided view and matches the contiguous path?
ci green.
|
Part of the selected-stage1 question: the selected GEMM1 consumes the original row view at 16/32 rows; paired complete FusedMoE outputs satisfy the original relative-L2 bound of 0.02. No separate GEMM1 intermediate output was saved. Executed boundary and numerical scopeThe operator uses cb6f1af7, AITER View/dense relative L2 is 0.00623400698/0.00601975403 at 16/32 rows. These are complete rank-local FusedMoE comparisons with generated weights. The 128-row selection uses contiguous FP4 fallback; the original packet's overall inconclusive result remains. The separate |
The token-graph hunks of ROCm#3636's integration commit 80ae966 ("Integrate Kimi prefill graphs and explicit residual storage contracts"), verbatim: - `_KimiMLAGDNCommon.supports_token_graph` also accepts a target MLA layer that is sparse and carries a bound unscaled BF16 query layout (`TokenGraphQueryLayout`), so Kimi-K3.1 at DP1/PCP1 records its prefill buckets. Quantized or unknown query layouts keep eager execution. - The layout check moves from `_attention` into `_attention_region`, so a plain eager call never enters the token-graph helper. - docs: ATOM_TOKEN_GRAPH_SIZES names the K3.1 regions. - tests: the gate's accept/refuse cases and the plain-call bypass. Left out, because this head has none of the code they integrate with: the row tail's in-graph guard and the KDA in_proj split on buckets (ROCm#3587), ColumnTail materialization at tensor-only boundaries (ROCm#3637/ROCm#3638), and the native eager residual's absent addends (the ROCm#3317 part, which exists only on a row-sharded step). Whoever merges those stacks with this one needs those hunks of 80ae966 too. Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit c24b52a) Conflict in atom/models/kimi_k3/model.py (this commit was written against main without ROCm#3637) resolved as in upstream merge 931b22b ("Merge Category A interfaces for local tail integration") of ROCm#3638. Ported from ROCm#3638. Co-authored-by: Cursor <cursoragent@cursor.com>
…ROCm#3637 ROCm#3638) k31-opt2/PT4@2c68a46f Conflicts resolved as ROCm#3636 does for PT3 (ROCm#3577/ROCm#3582/ROCm#3587) + PT4: - kimi_k3/attention_residual.py: PT4's kernel with PT3's num_blocks bound; PT3's int64 bank offsets (71a6aba) moved into PT4's _mix_tile and kernel. - model.py: column tail first (decode, 1-64 tokens), then PT3's dispatch op; row tail (>= ATOM_KIMI_K3_MOE_ROW_SHARD_MIN_TOKENS) before PT4's one-AR split; aggregate materializes column pendings; per-phase token_graph.
|
ci triage for cb6f1af:
|
Closes https://github.com/wuhuikx/LLM-Booster/issues/695, closes https://github.com/wuhuikx/LLM-Booster/issues/696, and closes https://github.com/wuhuikx/LLM-Booster/issues/702. Ready for human review; hold landing.
Kimi's eligible BF16 shared-front, router and latent-down projections share one GEMM and one weight allocation. Routed/shared partials share one reduction before routed normalization; supported MXFP4 consumers receive the latent input view directly.
Dev record
Named result
CPU paths preserve values/storage with one front call and one reduction. The GPU selected-kernel witness qualifies inline BF16 views at 16/32 rows only; 128 rows use the intended contiguous-FP4 fallback. The full packet remains inconclusive. The native plain TP8/DCP8 accuracy result is recorded below; complete decode/verify/prefill timing and temporary/steady-state memory attribution remain open.
Testing
Native plain Kimi-K3.1-Pro passed full GSM8K 3-shot: 1275/1319 = 0.9666413949962093 for both strict-match and flexible-extract, above the unchanged 0.96 threshold. The run used TP8/DCP8, default level 3/FULL graphs and mono, with no eager override or DSpark. Independent verification covered all 2,638 physical JSONL records, scoring, inputs, source/runtime/model bindings and final GPU cleanup. Reviewable evidence.
Source, runtime and qualification limits
Executed tree
fa7ea15c7d5aaae0f7d2ec12fb2d07aaddace99cis the prospective integration of this PR'scb6f1af7with main6180dbcff9. All 3,929 source files match that Git tree canonically: 3,555 after CRLF-to-LF normalization and 374 as raw bytes. Runtime: 4aff image base, AITER ga5927ba8f, Torch 2.10.0/ROCm7.2.4. Data: fixed GSM8K revision 740312, full 1,319 documents, three-shot, unchanged seeds and 65 concurrent requests.The model input was an explicit 80aff content-reuse view: 15 small files verified by content and 96 weights bound by official LFS IDs, existing download metadata and file identities. It was not claimed as a native HF snapshot; weight payloads were not fully rehashed and the original 6d directory was unchanged. Startup/capture logs witness all-eight mono installation and FULL capture, not a per-request kernel trace.
The earlier 0/1319 result at
dcedefc8, e1 image/AITER5c remains a real historical failure. The source/runtime and recorded input provenance differ; this pass does not establish its root cause or a causal fix. It qualifies this recorded native configuration, not all Category A acceptance. The selected-stage1 strided-view question, remaining full-path timing/memory evidence, dependencies and formal reviewer disposition retain their separate scopes.Gates
cb6f1af7fc7e3c9f8722750419c09c9b6b966790: maintained CPU CI passed 15208 cases, with 1548 skips and 3 xfails; Black/Ruff/catalog passed. Focused CPU: 157 passed, 5 GPU skips. Independent repository review found no source/CPU blocker. The new native plain result is scoped above; other declared acceptance requirements and dependencies retain hold landing.Evidence and limits
Base: main
ecec81921da0c27a088d542fcefad51fe83e4d5a. This is one category PR, covering all three issue checklists.The supervised November 20 GPU run used this unchanged head with existing AITER
b9e08daca8c45dd758f4fa1fbb7d0da027f399c9, one gfx950 GPU, generated weights and TP8 per-rank dimensions. Independent artifact audit verified the 16/32-row launch pointers, 12032-byte versus 7168-byte strides, actual rawcat=kernelevents and whole rank-local MoE relative-L2 errors 0.0062340/0.0060198, below the upstream 0.02 bound. The 128-row selected callable instead received contiguous FP4; its numerical observations do not qualify inline BF16 copy elimination. Exit 2/inconclusive and original artifacts are preserved. This is kernel-scope evidence, with no model, timing or landing pass.The scoped review record passed seven repository gates and non-author refutation. It independently reproduced the focused CPU checks and eleven controls, including the actual AOT owner-copy failure after bypassing the schema assertion. Review covers source and CPU scope; the outstanding runtime and integration requirements retain hold landing.
CI checkout
6cca75cb98dc1e5cb5c7a17b18ed79b3d6372190has the same tree as the PR head:04c3f357b7bdc0b2cf4f11e1c4765f361c5adc27. Its JUnit report confirms all 52 new cases executed without skips, including CPU AOT functionalization and compiled row-view storage identity. CI uses Torch 2.15.0+cpu; the focused Windows environment uses Torch 2.10.0+cpu. A separate full production-block CPU AOT check also passed, including flat reduction-buffer writes. These checks do not qualify GPU lowering.Real Kimi/FusedMoE constructors, native/plugin load wrappers, checkpoint parameter loaders, routed/shared consumers, destination fallbacks, and the production MXFP4 apply method run on small CPU tensors. External GPU kernels are substituted. The repository's normal test fixtures are loaded; Windows uses the established import-only process stand-ins and cannot qualify Linux or GPU execution.
The public AITER
fused_moeimplementation was inspected atafc300d7fee1b38cd805da517414c42114b35968, blob645974ac3620079854191386d3ce368605666c4d. ATOM retains aligned BF16 row views only for direct MXFP4. AITER validates the selected inline-sort configuration and copies views on unsupported kernel fallbacks; other ATOM backends retain contiguous inputs. No donor timing is attributed to this head.All controls were restored before the positive run. The new output op mutates only its destination; declaring its input mutated made AOT clone the input view's owner. Modular receivers pass
inplace=False, and SP and ordinary receivers write separate outputs.Scope: 247 changed production lines and 590 test lines, 837 total. Dependency integration and final landing-tree checks remain outstanding.