Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
345 commits
Select commit Hold shift + click to select a range
9fbc51f
[None][fix] Kimi K3 collective state: create() frees its communicator…
vsabavat Oct 3, 2026
b30c349
[None][chore] Stack on the modeling_v2 catalog conventions and comm/m…
vsabavat Oct 3, 2026
4ca4bfe
[None][feat] Kimi K3 DSpark drafter attention (trtllm::k3_drafter_att…
vsabavat Oct 3, 2026
a6a8cb7
[None][feat] modeling_v2 catalog: attention/k3_drafter_attn, k3_draft…
vsabavat Oct 3, 2026
90638fd
[None][fix] Kimi K3 collective state: create() involves its TP group'…
vsabavat Oct 3, 2026
90158d9
[None][doc] MNNVL catalog contracts: MnnvlWorkspace.create involves t…
vsabavat Oct 3, 2026
068241f
[None][feat] modeling_v2 Kimi K3 target: attention outputs for fused …
vsabavat Oct 3, 2026
10f4a6e
[None][feat] modeling_v2 Kimi K3 tp16_moetp16ep1: tp16_moetp4ep4's mo…
vsabavat Oct 3, 2026
ae282b3
[None][chore] Merge G1 9926793012: modeling_v2 catalog conventions fo…
vsabavat Oct 3, 2026
120913c
[None][chore] Merge G6 a6a8cb73a3: Kimi K3 DSpark drafter attention a…
vsabavat Oct 3, 2026
03df8ee
[None][fix] modeling_v2 Kimi K3 target: route the MXFP4 checkpoint as…
vsabavat Oct 3, 2026
35eccac
Merge #19839's follow-ups f01a46b67f and 03df8ee849 (the trim; the MX…
vsabavat Oct 3, 2026
fa24aca
[None][chore] modeling_v2 Kimi K3 tp16_moetp16ep1: carry the trim and…
vsabavat Oct 3, 2026
de63263
[None][feat] modeling_v2 Kimi K3 target: KDA attention outputs on eve…
vsabavat Oct 3, 2026
cce3f46
[None][test] Kimi K3 latent exchange: the one-process test checks the…
vsabavat Oct 3, 2026
0dcbdaf
[None][test] Kimi K3 wide MoE test: a seeded skewed routing instead o…
vsabavat Oct 3, 2026
a2d912b
[None][chore] Merge u5b fa24aca986: Kimi K3 route B (tp16_moetp16ep1)…
vsabavat Oct 3, 2026
ba296fc
[None][test] Kimi K3 modeling_v2 target: run the decode-step test in …
vsabavat Oct 3, 2026
df6da9d
[None][doc] modeling_v2 catalog: 18 entries carry sm_100 receipts
vsabavat Oct 3, 2026
06e5078
[None][doc] modeling_v2 catalog: state the 6 sm_100 receipts
vsabavat Oct 3, 2026
10eaa93
[None][chore] Merge u5-route-a-next df6da9d9b0: #19839's follow-ups (…
vsabavat Oct 3, 2026
db8ca58
[None][test] modeling_v2 Kimi K3 collective and MoE entries: sm_100 r…
vsabavat Oct 3, 2026
5c37c10
[None][chore] Merge G4 db8ca58bd0: Kimi K3 collective decode kernels …
vsabavat Oct 3, 2026
37a8c92
[None][feat] Kimi K3 MoE: trtllm::k3_moe_m1 / k3_moe_m2, the routed e…
vsabavat Oct 3, 2026
45cbb24
[None][feat] Kimi K3 MoE: k3_moe's push build into the latent exchange
vsabavat Oct 3, 2026
81a0235
[None][test] Kimi K3 MoE: the push builds at 4 ranks against MNNVLAll…
vsabavat Oct 3, 2026
82fc8ad
[None][feat] modeling_v2 catalog: moe/k3_moe_m1 and moe/k3_moe_m2 ove…
vsabavat Oct 3, 2026
a04ec2e
[None][test] Kimi K3 kernel lints: the k3_moe_m1 and k3_moe_m2 kernels
vsabavat Oct 3, 2026
f0fd94c
[None][feat] modeling_v2 catalog: moe/k3_moe's push form
vsabavat Oct 3, 2026
9f7ad02
[None][chore] Merge RB f0fd94cfbd: Kimi K3 route B MoE engines (k3_mo…
vsabavat Oct 3, 2026
ebfd380
[None][fix] modeling_v2 Kimi K3 target: declare the long GEMV and SiT…
vsabavat Oct 3, 2026
85c2399
[None][chore] Merge u5-route-a ebfd38001c: #19839's declared-ops fix …
vsabavat Oct 3, 2026
f32084b
[None][fix] modeling_v2 Kimi K3 tp16_moetp16ep1: declare the long GEM…
vsabavat Oct 3, 2026
0102a35
[None][fix] MNNVL all-reduce: keep a replaced workspace only if a cap…
vsabavat Oct 3, 2026
b122103
[None][fix] Kimi K3 k3_kda_attn: refuse a device with fewer than 128 SMs
vsabavat Oct 3, 2026
49a9715
[None][test] Kimi K3 MLA decode view test: list it in l0_cpu, not l0_…
vsabavat Oct 3, 2026
0ad2406
[None][test] modeling_v2 kda_decode entry test: drop the import-time …
vsabavat Oct 3, 2026
ba20fa1
[None][fix] DSpark GQA drafter: keep the checkpoint's trained mask-to…
vsabavat Oct 3, 2026
4bf2378
[None][fix] DSpark GQA drafter: keep the checkpoint's trained mask-to…
vsabavat Oct 3, 2026
05ab11d
[None][doc] Kimi K3 collective contracts: the 16-rank runs passed
vsabavat Oct 3, 2026
9dd1f27
[None][chore] Merge G4 05ab11d9e8: the collective contracts record th…
vsabavat Oct 3, 2026
a55d13f
[None][doc] Kimi K3 MoE push form: the 16-rank runs passed
vsabavat Oct 3, 2026
e30477f
[None][fix] KV cache manager V2: take the per-token KDA states out of…
vsabavat Oct 3, 2026
86eac6c
[None][test] modeling_v2 thop_attention: Kimi K3 MLA generation cell
vsabavat Oct 3, 2026
83924f8
[None][fix] Kimi K3 k3_moe: compile on routing that requires grad
vsabavat Oct 3, 2026
73692a6
[None][test] modeling_v2 thop_attention: sm_100 receipt
vsabavat Oct 3, 2026
d017fc9
[None][chore] Merge G4 83924f8281: k3_moe compiles on routing that re…
vsabavat Oct 3, 2026
05e14ea
[None][chore] Merge RB a55d13f0fc: the push form's 16-rank runs passed
vsabavat Oct 3, 2026
8ae58f7
[None][chore] Merge u5-route-a-c2 de6326362e: the Kimi K3 target's at…
vsabavat Oct 3, 2026
eefd225
[None][feat] modeling_v2 Kimi K3 target: a decode step's attention-re…
vsabavat Oct 3, 2026
93f0ad3
[None][feat] modeling_v2 Kimi K3 target: the post-attention all-reduc…
vsabavat Oct 3, 2026
d1f297a
[None][feat] modeling_v2 Kimi K3 target: the post-attention step of a…
vsabavat Oct 3, 2026
3ad8c5a
[None][feat] modeling_v2 Kimi K3 target: the decode path's one-shot c…
vsabavat Oct 3, 2026
d99cbd6
[None][feat] modeling_v2 Kimi K3 target: the MoE layers of a decode s…
vsabavat Oct 3, 2026
1c9c287
[None][test] modeling_v2 Kimi K3 target: the decode path's collective…
vsabavat Oct 3, 2026
ba1db7e
[None][chore] modeling_v2 Kimi K3 tp16_moetp16ep1: carry C3 into the …
vsabavat Oct 3, 2026
ba53c84
[None][fix] modeling_v2 Kimi K3 target: the MoE decode path hands its…
vsabavat Oct 3, 2026
7dc60cc
[None][feat] SpecDecOneEngineForCausalLM: build the drafter through a…
vsabavat Oct 3, 2026
31d76e0
[None][feat] modeling_v2 Kimi K3 target: decode GEMV sites for the DS…
vsabavat Oct 3, 2026
a867199
[None][feat] modeling_v2 Kimi K3 target: its DSpark drafter on the dr…
vsabavat Oct 3, 2026
b79745b
[None][test] modeling_v2 Kimi K3 target: the DSpark drafter against t…
vsabavat Oct 3, 2026
592ea1a
[None][test] Kimi K3 drafter attention: the R x 7 splits
vsabavat Oct 3, 2026
31b6275
[None][test] Kimi K3 drafter attention tests: name the splits they run
vsabavat Oct 3, 2026
18f1edd
[None][doc] modeling_v2 catalog: the Kimi K3 drafter attention certif…
vsabavat Oct 3, 2026
0d16d09
[None][feat] modeling_v2 Kimi K3 target: the DSpark drafter takes R x…
vsabavat Oct 3, 2026
706cf2d
[None][test] Kimi K3 kernel lints: the KDA, MLA and drafter kernels' …
vsabavat Oct 3, 2026
f0e7d4c
[None][test] Kimi K3 SiTU MoE: the TP16 shard (192 values, padded to …
vsabavat Oct 3, 2026
ea84b23
[None][perf] Mamba state metadata: skip unchanged per-step uploads
vsabavat Oct 3, 2026
77be712
[None][test] Kimi K3 MLA decode view test: list it in l0_cpu, not l0_…
vsabavat Oct 3, 2026
87c7e70
[None][test] modeling_v2 MNNVL op matrices: run on sm_100 only
vsabavat Oct 3, 2026
52ca9fa
[None][test] Kimi K3 MLA decode view test: list it in l0_cpu, not l0_…
vsabavat Oct 3, 2026
8e852d2
[None][test] modeling_v2 Kimi K3 routing and claims tests: list them …
vsabavat Oct 3, 2026
543ebb3
[None][test] modeling_v2 Kimi K3 construction and drift tests: list t…
vsabavat Oct 3, 2026
871ef64
[None][test] modeling_v2 Kimi K3 routing and claims tests: list them …
vsabavat Oct 3, 2026
8806ae3
[None][chore] modeling_v2 Kimi K3 tp16_moetp16ep1: carry C4 into the …
vsabavat Oct 3, 2026
32a581a
[None][feat] Kimi K3 DSpark decode: k3_spec_accept, k3_ctx_kv and k3_…
vsabavat Oct 3, 2026
aaef4b7
[None][doc] k3_markov: state the co-residency assumption
vsabavat Oct 3, 2026
a1d336d
[None][feat] DFlash / DSpark worker: Kimi K3 decode kernels behind k3…
vsabavat Oct 3, 2026
e85d7a6
[None][feat] modeling_v2 Kimi K3 tp16_moetp4ep4: the speculative work…
vsabavat Oct 3, 2026
4166788
[None][doc] modeling_v2 Kimi K3 tp16_moetp4ep4: the spec-worker gate'…
vsabavat Oct 3, 2026
2b465f6
[None][chore] modeling_v2 Kimi K3 tp16_moetp16ep1: carry the speculat…
vsabavat Oct 3, 2026
32d419b
[None][feat] DFlash metadata: capture_view, a captured layer's slot o…
vsabavat Oct 3, 2026
1447397
[None][perf] DFlash: the draft block's rows as a view where its slots…
vsabavat Oct 3, 2026
33d3586
[None][test] Kimi K3 DSpark decode kernel tests: list them in l0_b200…
vsabavat Oct 3, 2026
5c193ac
[None][test] Kimi K3 Markov chain test: run its checks under pytest o…
vsabavat Oct 3, 2026
490f289
[None][test] Kimi K3 sharded k3_spec_accept test: run under pytest on…
vsabavat Oct 3, 2026
f85b709
[None][perf] modeling_v2 Kimi K3 tp16_moetp4ep4: split the DSpark dra…
vsabavat Oct 3, 2026
135ab0c
[None][perf] modeling_v2 Kimi K3 tp16_moetp4ep4: the DSpark drafter's…
vsabavat Oct 3, 2026
00e4394
[None][perf] DFlash / Kimi K3 DSpark drafter: the gen requests' page-…
vsabavat Oct 3, 2026
ac6e287
[None][doc] modeling_v2 Kimi K3 tp16_moetp4ep4: the drafter gate requ…
vsabavat Oct 3, 2026
147b87d
[None][test] k3_ctx_kv test: drop the base-port identity cases, zero …
vsabavat Oct 3, 2026
b7ea3f6
[None][chore] modeling_v2 Kimi K3 tp16_moetp16ep1: carry the DSpark d…
vsabavat Oct 3, 2026
19ef779
[None][test] Kimi K3 kernel tests: make their pool workers' functions…
vsabavat Oct 3, 2026
428f6f2
[None][perf] modeling_v2 Kimi K3 tp16_moetp4ep4: the DSpark tap from …
vsabavat Oct 3, 2026
fe9eaf5
[None][chore] modeling_v2 Kimi K3 tp16_moetp16ep1: carry the sandwich…
vsabavat Oct 3, 2026
4bf3512
[None][perf] modeling_v2 Kimi K3 target: the decode MoE's latent all-…
vsabavat Oct 3, 2026
41b2245
[None][test] Kimi K3 k3_moe push test: route A's expert layout
vsabavat Oct 3, 2026
aed1c94
[None][chore] modeling_v2 Kimi K3 tp16_moetp16ep1: carry the latent p…
vsabavat Oct 3, 2026
d6613a1
[None][feat] modeling_v2 Kimi K3 tp16_moetp16ep1: the MoE decode path…
vsabavat Oct 3, 2026
3656bcd
[None][perf] Kimi K3 generic MoE path: the fused route + MXFP8 quant …
vsabavat Oct 3, 2026
74839d1
[None][perf] Kimi K3 targets: route the generic MoE outside the TRTLL…
vsabavat Oct 3, 2026
4657c20
[None][test] Kimi K3 decode-comm matrix: route A's shared-expert slic…
vsabavat Oct 3, 2026
0da8a02
[None][fix] Kimi K3 decode MoE warm-up: no back-to-back k3_moe calls …
vsabavat Oct 3, 2026
546e567
[None][perf] DFlash: skip unchanged slot-buffer copies on decode steps
vsabavat Oct 3, 2026
a9938c2
[None][fix] KV cache manager V2: count the live-floor KDA token-state…
vsabavat Oct 4, 2026
54b87a2
[None][fix] KV cache manager V2: refuse per-token KDA states off the …
vsabavat Oct 4, 2026
459e446
[None][doc] Kimi K3 sandwich: polled input and fold store before the …
vsabavat Oct 4, 2026
c954d6a
[None][test] Kimi K3 noaux_tc MXFP8 quant graph test: free each captu…
vsabavat Oct 4, 2026
1e6eb67
[None][fix] KV cache manager V2: keep a suspended request's KDA repla…
vsabavat Oct 4, 2026
10fd5cf
[None][fix] KV cache manager V2: refuse a KV pool rebalance with the …
vsabavat Oct 4, 2026
c48e85e
[None][test] Kimi K3 decode-comm matrix: free a graph's outputs befor…
vsabavat Oct 4, 2026
2f25c1d
[None][fix] DSpark K3 Markov path: release the step's acceptance and …
vsabavat Oct 4, 2026
3411d48
[None][test] Kimi K3 DSpark drafter test: give the one-rank drafter's…
vsabavat Oct 4, 2026
b3b4e27
[None][test] Kimi K3 k3_ctx_kv: back-to-back calls share the arrival …
vsabavat Oct 4, 2026
ae6e9a9
[None][test] Kimi K3 k3_spec_accept and k3_markov: arrival counters a…
vsabavat Oct 4, 2026
b521431
[None][test] MNNVL catalog matrices: armed checks wait for every rank
vsabavat Oct 4, 2026
13b26f4
[None][doc] Kimi K3 k3_spec_accept and k3_ctx_kv: calls on a device a…
vsabavat Oct 4, 2026
50ac9d6
[None][fix] kda_prefill: release evicted scratch with its cache entry
vsabavat Oct 4, 2026
a0509b3
[None][fix] LoRA overlap: leave the output record to maybe_execute_in…
vsabavat Oct 6, 2026
77a450e
[None][doc] multi_stream_utils: note the compiled path and the error'…
vsabavat Oct 6, 2026
c3ced8d
[None][test] test_multi_stream_utils: bound the capture's block count
vsabavat Oct 6, 2026
f39f875
[None][perf] Kimi K3 attn_res_fwd online kernel: double-buffer ws_sta…
vsabavat Oct 6, 2026
b2a6af4
Kimi K3 KDA prefill: K1 warps finish reading sPartialLast before the …
vsabavat Oct 2, 2026
2e598e1
[None][feat] One-model speculative decoding: the worker produces the …
vsabavat Oct 1, 2026
b12bfad
DFlash: empty the dummy slot in the drafting step, not in prepare()
vsabavat Oct 6, 2026
ce1ae63
[None][feat] KDA: commit pending accepted drafts into the live pools
vsabavat Oct 6, 2026
f9d32b4
[None][fix] KV cache manager V2: commit a suspended request's KDA rep…
vsabavat Oct 6, 2026
93c0b28
MNNVL all-reduce: remove LamportFlags' unused cluster-arrival mode
vsabavat Oct 7, 2026
0c9ab14
Merge main 70193ec43b into k3-up/u1-engine-host-gap
vsabavat Oct 7, 2026
eda9db2
[None][fix] DSpark GQA drafter: check the kept mask row at load and c…
vsabavat Oct 7, 2026
a0fa306
[None][fix] Mamba2 metadata: upload CPU-tensor state indices through …
vsabavat Oct 7, 2026
fd37763
[None][test] copy_to_device_if_changed: check skipped copies in debug…
vsabavat Oct 7, 2026
bea6002
[None][perf] spec_step_copies: run on the SM 100 family (SM 100, 103,…
vsabavat Oct 7, 2026
0e29964
[None][perf] spec_step_copies: drop the staged host-to-device copies,…
vsabavat Oct 7, 2026
0cbb559
[None][fix] DSpark GQA drafter: keep no mask row for DFlash's default…
vsabavat Oct 7, 2026
b83f960
[None][fix] DSpark GQA drafter: keep the trained row of the worker's …
vsabavat Oct 7, 2026
d0c47c2
[None][chore] Merge #19827's head b12bfad22c: DFlash empties the dumm…
vsabavat Oct 7, 2026
25fd87a
[None][fix] Kimi K3 DSpark drafter: empty the dummy slot after k3_ctx_kv
vsabavat Oct 7, 2026
2c331d5
[None][fix] Kimi K3 KDA verify: kda_state_tok holds the drafts' records
vsabavat Oct 7, 2026
c95eac1
[None][fix] KDA suspend: read the drafts' records as [slots, 3, num_s…
vsabavat Oct 7, 2026
dc903ae
[None][fix] KDA verify: size kda_state_tok for the drafts' records
vsabavat Oct 7, 2026
c05a0c3
[None][fix] KDA verify: drop the replay caches the drafts' records re…
vsabavat Oct 7, 2026
44a06db
Merge main a1f562a696 into k3-up/u1-engine-host-gap
vsabavat Oct 7, 2026
003f8d0
[None][fix] KDA suspend: commit and relocate without the replay caches
vsabavat Oct 7, 2026
de2f7e1
[None][fix] KV cache manager V2: count every live-floor SSM slot in t…
vsabavat Oct 7, 2026
04c6f56
[None][doc] Kimi K3: kda_state_tok holds the last verify's draft records
vsabavat Oct 7, 2026
fd476e7
Merge main 4a36c5b2fb into k3-up/u4-g3-stateful
vsabavat Oct 7, 2026
3f54e9d
Merge main 4a36c5b2fb into k3-up/k3-rest
vsabavat Oct 7, 2026
547f6bf
Merge #19831 (P1) at c3ced8d8c1 into the main fixes branch
vsabavat Oct 8, 2026
70bb2a3
Merge #19828 (P2) at 0102a35eea into the main fixes branch
vsabavat Oct 8, 2026
0778b55
Merge #19836 (P3) at 93c0b28bbd into the main fixes branch
vsabavat Oct 8, 2026
adce84a
Merge #19829 (P4) at f39f875fa8 into the main fixes branch
vsabavat Oct 8, 2026
cb4a371
Merge #19826 (P5) at b2a6af4680 into the main fixes branch
vsabavat Oct 8, 2026
2cc72d5
Merge #19827 (P7) at b12bfad22c into the main fixes branch
vsabavat Oct 8, 2026
21462e1
Merge #19840 (P8) at adb66182fa into the main fixes branch
vsabavat Oct 8, 2026
ddff9e8
Merge #19835 (P9) at 5e238440d7 into the main fixes branch
vsabavat Oct 8, 2026
ca4918f
Merge #19837 (P10) at 936f38fbe7 into the main fixes branch
vsabavat Oct 8, 2026
67a3ad5
Merge #19842 (P11) at b83f960a1d into the main fixes branch
vsabavat Oct 8, 2026
989766a
Merge #19846 (P12a) at f9d32b4c4d into the main fixes branch
vsabavat Oct 8, 2026
347d22f
Merge #19854 (P13) at 50ac9d64e4 into the main fixes branch
vsabavat Oct 8, 2026
dc76338
Merge #19816 (U1) at 44a06db574 into the runtime branch
vsabavat Oct 8, 2026
8002879
Merge #19814 (U3) at 2e598e10cb into the runtime branch
vsabavat Oct 8, 2026
a0712cb
Merge #19846 (P12) at 003f8d088d into the runtime branch: its two com…
vsabavat Oct 8, 2026
fa41a16
Merge #19817 (U2) at de2f7e12ef into the runtime branch
vsabavat Oct 8, 2026
bbd3d04
Merge #19833 (G2) at b28044256d into the specialized kernels branch
vsabavat Oct 8, 2026
d67d88e
Merge #19832 (G3) at fd476e7662 into the specialized kernels branch
vsabavat Oct 8, 2026
b803497
Merge #19834 (G5) at c954d6ad6f into the specialized kernels branch
vsabavat Oct 8, 2026
d586d7e
Merge #19839 (U5) at 8e852d2da2 into the Kimi K3 model branch
vsabavat Oct 8, 2026
864a430
Merge #19841 (k3rest) at 3f54e9d96d into the Kimi K3 model branch
vsabavat Oct 8, 2026
84dfe86
Merge k3-cons/b-runtime (format fix) into k3-cons/c-kernels
vsabavat Oct 8, 2026
0d83ef5
Runtime branch: the blank line ruff-format wants between two merged t…
vsabavat Oct 8, 2026
9ba3b3d
Merge k3-cons/c-kernels (format fix) into k3-cons/d-model
vsabavat Oct 8, 2026
e4b9968
modeling_v2 catalog: count G5's sm_100 receipts in the receipt status
vsabavat Oct 8, 2026
e69dacd
Merge k3-cons/c-kernels (receipt count) into k3-cons/d-model
vsabavat Oct 8, 2026
35433fb
[None][fix] thop_attention catalog test: do not probe a context lengt…
vsabavat Oct 8, 2026
eedff8c
Merge k3-cons/a-main-fixes (thop_attention test fix) into k3-cons/b-r…
vsabavat Oct 8, 2026
c9d0cd4
Merge k3-cons/b-runtime (thop_attention test fix) into k3-cons/c-kernels
vsabavat Oct 8, 2026
0bbf728
Merge k3-cons/c-kernels (thop_attention test fix) into k3-cons/d-model
vsabavat Oct 8, 2026
bcef591
Merge main f891b3d9ba into k3-cons/a-main-fixes
vsabavat Oct 8, 2026
338f9d0
Merge k3-cons/a-main-fixes (main f891b3d9ba) into k3-cons/b-runtime
vsabavat Oct 8, 2026
73a9e90
Merge k3-cons/b-runtime (main f891b3d9ba) into k3-cons/c-kernels
vsabavat Oct 8, 2026
65ddf59
Merge k3-cons/c-kernels (main f891b3d9ba) into k3-cons/d-model
vsabavat Oct 8, 2026
c53ffc8
Merge main 3beeef3a5f into k3-cons/b-runtime
vsabavat Oct 8, 2026
3ac75a7
Merge k3-cons/b-runtime (main 3beeef3a5f) into k3-cons/c-kernels
vsabavat Oct 8, 2026
28cfb12
Merge k3-cons/c-kernels (main 3beeef3a5f) into k3-cons/d-model
vsabavat Oct 8, 2026
bdadd40
[None][test] List the MNNVL capture-guard test in l0_dgx_b200.yml
vsabavat Oct 9, 2026
305118f
Merge k3-cons/a-main-fixes (l0_dgx_b200 move) into k3-cons/b-runtime
vsabavat Oct 9, 2026
b395762
Merge k3-cons/b-runtime (l0_dgx_b200 move) into k3-cons/c-kernels
vsabavat Oct 9, 2026
9e19e8a
Merge k3-cons/c-kernels (l0_dgx_b200 move) into k3-cons/d-model
vsabavat Oct 9, 2026
cd21be6
[None][fix] Enable the spec step-copy kernels on SM 100 only
vsabavat Oct 9, 2026
54ff61f
[None][fix] Make the attn_res decode kernels' early PDL trigger opt-in
vsabavat Oct 9, 2026
97f7072
[None][fix] Reject linear_beta=0.0 in trtllm::k3_situ_mul
vsabavat Oct 9, 2026
4aa7153
Merge k3-cons/c-kernels (attn_res early_trigger opt-in, k3_situ_mul l…
vsabavat Oct 9, 2026
b16c3c2
[None][fix] Opt the Kimi K3 targets' fused attn_res calls into the ea…
vsabavat Oct 9, 2026
55f0635
Merge k3-cons/b-runtime (SM 100 step-copy fix) into k3-cons/c-kernels
vsabavat Oct 9, 2026
4c1439a
Merge k3-cons/c-kernels (SM 100 step-copy fix) into k3-cons/d-model
vsabavat Oct 9, 2026
c14508c
[None][chore] Move k3_mla_decode_view into the Kimi K3 MLA kernel pac…
vsabavat Oct 9, 2026
f5c3ae3
Merge k3-cons/c-kernels (k3_mla_decode_view in cute_dsl_kernels/k3_ml…
vsabavat Oct 9, 2026
1bc8d8b
[None][chore] Keep main's route + quant op in the TRTLLM-Gen W4A8 MXF…
vsabavat Oct 9, 2026
b330f1c
[None][refactor] Move the Kimi K3 MNNVL ops out of the stock MNNVL al…
vsabavat Oct 9, 2026
06d34b7
[None][refactor] Kimi K3 targets own their DFlash / DSpark worker and…
vsabavat Oct 9, 2026
3a990dc
Merge main 24d0f2716f into k3-cons/b-runtime
vsabavat Oct 9, 2026
4612146
Merge k3-cons/b-runtime (main 24d0f2716f) into k3-cons/c-kernels
vsabavat Oct 9, 2026
9190f8b
Merge k3-cons/b-runtime (main 24d0f2716f) into k3-cons/c-kernels
vsabavat Oct 9, 2026
deb3d65
Merge k3-cons/c-kernels (main 24d0f2716f) into k3-cons/d-model
vsabavat Oct 9, 2026
4552c8d
[None][feat] DSpark: load speculators-format drafter checkpoints
vsabavat Oct 6, 2026
c6cd921
Merge main (01a3a967a9) into k3-cons/a-main-fixes
vsabavat Oct 9, 2026
c44c900
Merge k3-cons/a-main-fixes (speculators DSpark loader, main 01a3a967a…
vsabavat Oct 9, 2026
edc6351
Merge k3-cons/b-runtime (new A c6cd921256) into k3-cons/c-kernels
vsabavat Oct 9, 2026
2a91b19
Merge k3-cons/c-kernels (new A c6cd921256) into k3-cons/d-model
vsabavat Oct 9, 2026
0fd5a3a
[None][fix] Ragged spec sampler tests: give the stub sampler B's stor…
vsabavat Oct 9, 2026
4c8533c
[None][test] Kimi K3 MNNVL comm test: reach the ops through _trtllm()…
vsabavat Oct 9, 2026
6157fb8
Merge k3-cons/b-runtime (ragged sampler test fix) into k3-cons/c-kernels
vsabavat Oct 9, 2026
657aa25
Merge k3-cons/c-kernels (ragged sampler test fix) into k3-cons/d-model
vsabavat Oct 9, 2026
d639ec5
Merge main fcc4432bef into k3-cons/b-runtime
vsabavat Oct 10, 2026
bca86ba
Merge k3-cons/b-runtime (main fcc4432bef) into k3-cons/c-kernels
vsabavat Oct 10, 2026
47a20a2
Merge k3-cons/c-kernels (main fcc4432bef) into k3-cons/d-model
vsabavat Oct 10, 2026
145def6
Merge main 16df7eaf25 into k3-cons/a-main-fixes
vsabavat Oct 11, 2026
0ed2dfd
Merge k3-cons/a-main-fixes (main 16df7eaf25) into k3-cons/b-runtime
vsabavat Oct 11, 2026
23a02c1
Merge k3-cons/b-runtime (main 16df7eaf25) into k3-cons/c-kernels
vsabavat Oct 11, 2026
b648542
Merge k3-cons/c-kernels (main 16df7eaf25) into k3-cons/d-model
vsabavat Oct 11, 2026
42ff681
[None][refactor] Kimi K3 route targets: one decode/generic dispatch p…
vsabavat Oct 12, 2026
6d9951a
[None][test] Kimi K3 path test: compare against each target's own Dec…
vsabavat Oct 12, 2026
6a95a9e
[None][fix] KV cache manager V2: do not commit an unseeded disagg gen…
vsabavat Oct 12, 2026
6b07622
Merge k3-cons/a-main-fixes (unseeded disagg KDA replay suspend fix) i…
vsabavat Oct 12, 2026
ee481ee
Merge k3-cons/b-runtime (unseeded disagg KDA replay suspend fix) into…
vsabavat Oct 12, 2026
856a455
Merge k3-cons/c-kernels (unseeded disagg KDA replay suspend fix) into…
vsabavat Oct 12, 2026
6514585
Merge k3-cons/d-model (unseeded disagg KDA replay suspend fix) into t…
vsabavat Oct 12, 2026
63aa7a2
[None][chore] KV cache manager V2: separate KDA draft-record accounti…
vsabavat Oct 12, 2026
83becf9
Merge k3-cons/b-runtime (KDA draft-record accounting review follow-up…
vsabavat Oct 12, 2026
b646dca
Merge k3-cons/c-kernels (KDA draft-record accounting review follow-up…
vsabavat Oct 12, 2026
b984e33
Merge main d7882af43f into k3-cons/d-model
vsabavat Oct 12, 2026
a486e00
Merge main fced9ff984 into k3-cons/a-main-fixes
vsabavat Oct 13, 2026
52a3283
Merge k3-cons/a-main-fixes latest-main compatibility into k3-cons/b-r…
vsabavat Oct 13, 2026
520ae9c
Merge branch 'mr11/b' into mr11/c
vsabavat Oct 13, 2026
379cdf6
Preserve K3 numeric contracts through model-owned operation migration
vsabavat Oct 13, 2026
9024a43
Merge latest-main kernel migration into k3-cons/d-model
vsabavat Oct 13, 2026
1695372
Propagate preserved K3 numeric contracts into k3-cons/d-model
vsabavat Oct 13, 2026
2ede9d6
Preserve phase-target presence coverage for phase-dispatched models
vsabavat Oct 13, 2026
cdbba03
test: isolate MNNVL workspace lifecycle from CUDA capture state
vsabavat Oct 13, 2026
0202519
test: align hybrid fixtures and CUDA requirements with main
vsabavat Oct 13, 2026
40df45e
Merge commit 'cdbba03f749f6012d8288d71c915c7af7f863ea6' into mr11/b
vsabavat Oct 13, 2026
be9f0e4
Merge commit '40df45e324fdeb290aa058d4a0af4e571d729bb5' into mr11/c
vsabavat Oct 13, 2026
8bdeec3
Merge commit 'be9f0e4a1008d35641f7e176309a460099b76e1c' into mr11/d
vsabavat Oct 13, 2026
72bb8ca
test: remove obsolete MNNVL workspace dictionary assertion
vsabavat Oct 13, 2026
951048b
Merge commit '72bb8ca0b8ad4f5086f6fe4e1162afc6de533f61' into mr11/b
vsabavat Oct 13, 2026
1cf3ae6
Merge commit '951048b17591f880cf89bd63161cf70dd0ec4921' into mr11/c
vsabavat Oct 13, 2026
ae7c7a9
Merge commit '1cf3ae64e76cc753212b3f34494a0310aedd2af1' into mr11/d
vsabavat Oct 13, 2026
46d2b3d
Add NVFP4 Kimi K3 model and agentx support (By Agent)
VALLIS-NERIA Oct 14, 2026
5c870f5
Share Kimi K3 modeling across FP4 formats and support SM103 (By Agent)
VALLIS-NERIA Oct 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
64 changes: 13 additions & 51 deletions cpp/tensorrt_llm/common/lamportUtils.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
#include <cuda_runtime.h>
#include <type_traits>

#include <cooperative_groups.h>

#include "tensorrt_llm/common/cudaTypeUtils.cuh"

TRTLLM_NAMESPACE_BEGIN
Expand Down Expand Up @@ -196,17 +194,16 @@ struct LamportBufferLayout
(lamportIndex * numStages + stageIndex) * static_cast<size_t>(bytesPerBuffer / numStages)));
}
};

// Current Index
// Dirty Index
// bytes_per_buffer
// Dirty num_stages
// Dirty bytes_to_clear = {stage0, stage1, stage2, stage3} # We fix this to 4 stages
// offset_access_ptr

namespace cg = cooperative_groups;

// PackedType is the one used in kernel for Lamport buffer (LDG.128 or LDG.64)
template <typename PackedType = float4, bool UseCGA = false>
template <typename PackedType = float4>
struct __attribute__((aligned(32))) LamportFlags
{
public:
Expand Down Expand Up @@ -258,63 +255,28 @@ public:

__device__ void ctaArrive()
{
if constexpr (UseCGA)
#if (defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 700))
uint32_t const barrierThreads
= ((static_cast<uint32_t>(blockDim.x) + kWARP_SIZE - 1U) / kWARP_SIZE) * kWARP_SIZE;
if (threadIdx.x < kWARP_SIZE)
{
#if (defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 900))
cg::cluster_group cluster = cg::this_cluster();
__cluster_barrier_arrive();
if (cluster.block_rank() == 0 && threadIdx.x < kWARP_SIZE)
{
__cluster_barrier_wait();
arriveCounter(threadIdx.x);
}
#else
__syncthreads();
asm volatile("barrier.cta.sync 1, %0;" ::"r"(barrierThreads) : "memory");
arriveCounter(threadIdx.x);
#endif
}
else
{
#if (defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 700))
uint32_t const barrierThreads
= ((static_cast<uint32_t>(blockDim.x) + kWARP_SIZE - 1U) / kWARP_SIZE) * kWARP_SIZE;
if (threadIdx.x < kWARP_SIZE)
{
asm volatile("barrier.cta.sync 1, %0;" ::"r"(barrierThreads) : "memory");
arriveCounter(threadIdx.x);
}
else
{
asm volatile("barrier.cta.arrive 1, %0;" ::"r"(barrierThreads) : "memory");
}
asm volatile("barrier.cta.arrive 1, %0;" ::"r"(barrierThreads) : "memory");
}
#else
__syncthreads();
arriveCounter(threadIdx.x);
__syncthreads();
arriveCounter(threadIdx.x);
#endif
}
}

__device__ void waitAndUpdate(uint4 bytesToClearPerStage)
{
bool isLastCtaT0{false};
int targetCount{0};
if constexpr (UseCGA)
{
#if (defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 900))
cg::grid_group grid = cg::this_grid();
// Use the first thread instead of the last thread as the last thread may exit early.
isLastCtaT0 = grid.thread_rank() == 0;
targetCount = grid.num_clusters();
#else
isLastCtaT0 = threadIdx.x == 0 && blockIdx.x == 0 && blockIdx.y == 0 && blockIdx.z == 0;
targetCount = gridDim.x * gridDim.y * gridDim.z;
#endif
}
else
{
isLastCtaT0 = threadIdx.x == 0 && blockIdx.x == 0 && blockIdx.y == 0 && blockIdx.z == 0;
targetCount = gridDim.x * gridDim.y * gridDim.z;
}
bool const isLastCtaT0 = threadIdx.x == 0 && blockIdx.x == 0 && blockIdx.y == 0 && blockIdx.z == 0;
int const targetCount = gridDim.x * gridDim.y * gridDim.z;
if (isLastCtaT0)
{
uint4* flagPtr = reinterpret_cast<uint4*>(mBufferFlagsPtr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ struct MnnvlAllReduceKernelParams
uint32_t* bufferFlags;
bool waitForResults;
QuantizationSFLayout layout;
bool earlyTrigger;
};

template <typename PackedType, typename T>
Expand Down Expand Up @@ -590,15 +591,20 @@ __global__ void __launch_bounds__(1024) oneshotAllreduceFusionKernel(MnnvlAllRed
int threadOffset = token * params.tokenDim + packedIdx * kELTS_PER_THREAD;

cudaGridDependencySynchronize();
if (params.earlyTrigger)
{
cudaTriggerProgrammaticLaunchCompletion();
}
#else
int packedIdx = blockIdx.y * blockDim.x + threadIdx.x;
int token = blockIdx.x;
// Offset w.r.t. the input shard
int threadOffset = token * params.tokenDim + packedIdx * kELTS_PER_THREAD;
#endif

// We only use 1 stage for the oneshot allreduce
LamportFlags<PackedType, true> flag(params.bufferFlags, 1);
// We only use 1 stage for the oneshot allreduce. Arrivals are counted per CTA: the RMSNorm epilogue's cluster
// reduction below must be each thread's only phase of the cluster barrier.
LamportFlags<PackedType> flag(params.bufferFlags, 1);
T* stagePtrMcast = reinterpret_cast<T*>(flag.getCurLamportBuf(params.mcastPtr, 0));
T* stagePtrLocal = reinterpret_cast<T*>(flag.getCurLamportBuf(params.inputPtrs[params.rank], 0));
bool const inBounds = packedIdx * kELTS_PER_THREAD < params.tokenDim;
Expand Down Expand Up @@ -710,11 +716,12 @@ __global__ void __launch_bounds__(1024) oneshotAllreduceFusionKernel(MnnvlAllRed
fullSum = 0.F;
// Need to reduce over the entire cluster
int const blockRank = cluster.block_rank();
// Every CTA of the cluster must have started before another CTA writes its shared memory.
cluster.sync();
if (threadIdx.x < numBlocks)
{
cluster.map_shared_rank(&sharedVal[0], threadIdx.x)[blockRank] = blockSum;
}
// cluster.sync();
cluster.barrier_wait(cluster.barrier_arrive());
for (int i = 0; i < numBlocks; ++i)
{
Expand Down Expand Up @@ -841,7 +848,7 @@ void oneshotAllreduceFusionOp(AllReduceFusionParams const& params)
MnnvlAllReduceKernelParams<T> kernelParams{output, residualOut, input, residualIn, gamma, ucPtrs,
reinterpret_cast<T*>(params.bufferPtrLocal), mcPtr, params.quantOut, params.scaleOut, params.scaleFactor,
numTokens, tokenDim, params.nRanks, params.rank, static_cast<float>(params.epsilon), params.bufferFlags,
false, params.layout};
false, params.layout, params.earlyTrigger};

switch (params.nRanks)
{
Expand Down Expand Up @@ -890,7 +897,7 @@ __global__ __launch_bounds__(128) void twoshotAllreduceKernel(MnnvlAllReduceKern
#if (defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 900))
cudaGridDependencySynchronize();
#endif
LamportFlags<PackedType, false> flag(params.bufferFlags, MNNVLTwoShotStage::NUM_STAGES);
LamportFlags<PackedType> flag(params.bufferFlags, MNNVLTwoShotStage::NUM_STAGES);

T* scatterBufLocal
= reinterpret_cast<T*>(flag.getCurLamportBuf(params.inputPtrs[params.rank], MNNVLTwoShotStage::SCATTER));
Expand Down Expand Up @@ -1016,7 +1023,9 @@ __global__ __launch_bounds__(1024) void rmsNormLamport(MnnvlAllReduceKernelParam
T* smemResidual = reinterpret_cast<T*>(&smem[smemBufferSize]);
T* smemGamma = reinterpret_cast<T*>(&smem[2 * smemBufferSize]);

LamportFlags<float4, UseCGA> flag(params.bufferFlags, MNNVLTwoShotStage::NUM_STAGES);
// Arrivals are counted per CTA: with UseCGA the RMSNorm cluster reduction below must be each thread's only phase
// of the cluster barrier.
LamportFlags<float4> flag(params.bufferFlags, MNNVLTwoShotStage::NUM_STAGES);
T* input = reinterpret_cast<T*>(
flag.getCurLamportBuf(reinterpret_cast<void*>(params.bufferInputPtr), MNNVLTwoShotStage::BROADCAST));

Expand Down Expand Up @@ -1137,11 +1146,12 @@ __global__ __launch_bounds__(1024) void rmsNormLamport(MnnvlAllReduceKernelParam
fullSum = 0.F;
// Need to reduce over the entire cluster
int const blockRank = cluster.block_rank();
// Every CTA of the cluster must have started before another CTA writes its shared memory.
cluster.sync();
if (threadIdx.x < numBlocks)
{
cluster.map_shared_rank(&sharedVal[0], threadIdx.x)[blockRank] = blockSum;
}
// cluster.sync();
cluster.barrier_wait(cluster.barrier_arrive());
for (int i = 0; i < numBlocks; ++i)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ struct AllReduceFusionParams
void* scaleOut = nullptr; //!< NVFP4 scale-factor output (used by NVFP4 fusion patterns)
float const* scaleFactor = nullptr; //!< Quantization scale factor
QuantizationSFLayout layout = QuantizationSFLayout::SWIZZLED; //!< NVFP4 scale-factor layout
bool earlyTrigger = false;
cudaStream_t stream; //!< CUDA stream for asynchronous kernel execution

//! @}
Expand Down
58 changes: 44 additions & 14 deletions cpp/tensorrt_llm/kernels/kimiK3AttnRes/attnResFwd.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1046,12 +1046,18 @@ __global__ void __launch_bounds__(256, 1) attn_res_fwd_s1_single_cta_kernel(bf16
bf16_t const* __restrict__ layer_res, bf16_t const* __restrict__ layer_res_add, bf16_t const* __restrict__ res_w,
bf16_t const* __restrict__ rms_w, bf16_t const* __restrict__ output_rms_w, bf16_t* __restrict__ updated_layer_res,
bf16_t* __restrict__ output, float* __restrict__ rsigma_out, float* __restrict__ probs_out,
float* __restrict__ logits_out, float rms_eps, float output_rms_eps, int num_tokens)
float* __restrict__ logits_out, float rms_eps, float output_rms_eps, int num_tokens, bool early_trigger)
{
#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ >= 1000
if constexpr (ENABLE_PDL)
{
cudaGridDependencySynchronize();
// The dependent grid still waits for this one to complete before reading its
// output; triggering here lets it launch and stream its weights while this kernel runs.
if (early_trigger)
{
cudaTriggerProgrammaticLaunchCompletion();
}
}

constexpr int H = 7168;
Expand Down Expand Up @@ -1321,7 +1327,10 @@ __global__ void __launch_bounds__(256, 1) attn_res_fwd_s1_single_cta_kernel(bf16

if constexpr (ENABLE_PDL)
{
cudaTriggerProgrammaticLaunchCompletion();
if (!early_trigger)
{
cudaTriggerProgrammaticLaunchCompletion();
}
}
#else
if (cute::thread0())
Expand All @@ -1331,11 +1340,17 @@ __global__ void __launch_bounds__(256, 1) attn_res_fwd_s1_single_cta_kernel(bf16
#endif
}

// Decode handoff options for the s1 kernels (see AttnResFwdParams).
struct S1Handoff
{
bool early_trigger = false;
};

template <int N, bool FUSE_OUTPUT_RMS_NORM = false, bool FUSE_LAYER_ADD = false>
static void launch_s1_single_cta(bf16_t const* block_residual, bf16_t const* layer_residual,
bf16_t const* layer_residual_add, bf16_t const* res_weight, bf16_t const* rms_weight,
bf16_t const* output_rms_weight, bf16_t* updated_layer_residual, bf16_t* output, float* rsigma, float* probs,
float* logits, float rms_eps, float output_rms_eps, int num_tokens, cudaStream_t stream)
float* logits, float rms_eps, float output_rms_eps, int num_tokens, cudaStream_t stream, S1Handoff handoff = {})
{
if (tensorrt_llm::common::getEnvEnablePDL())
{
Expand All @@ -1351,14 +1366,14 @@ static void launch_s1_single_cta(bf16_t const* block_residual, bf16_t const* lay
config.numAttrs = 1;
cudaLaunchKernelEx(&config, kernel, block_residual, layer_residual, layer_residual_add, res_weight, rms_weight,
output_rms_weight, updated_layer_residual, output, rsigma, probs, logits, rms_eps, output_rms_eps,
num_tokens);
num_tokens, handoff.early_trigger);
}
else
{
attn_res_fwd_s1_single_cta_kernel<N, FUSE_OUTPUT_RMS_NORM, FUSE_LAYER_ADD, false>
<<<num_tokens, 256, 0, stream>>>(block_residual, layer_residual, layer_residual_add, res_weight, rms_weight,
output_rms_weight, updated_layer_residual, output, rsigma, probs, logits, rms_eps, output_rms_eps,
num_tokens);
num_tokens, false);
}
}

Expand All @@ -1380,13 +1395,22 @@ __global__ void __launch_bounds__(256, 1) attn_res_fwd_s1_splitk_kernel(bf16_t c
bf16_t const* __restrict__ layer_res, bf16_t const* __restrict__ layer_res_add, bf16_t const* __restrict__ res_w,
bf16_t const* __restrict__ rms_w, bf16_t const* __restrict__ output_rms_w, bf16_t* __restrict__ updated_layer_res,
bf16_t* __restrict__ output, float* __restrict__ rsigma_out, float* __restrict__ probs_out,
float* __restrict__ logits_out, float rms_eps, float output_rms_eps, int num_tokens)
float* __restrict__ logits_out, float rms_eps, float output_rms_eps, int num_tokens, bool early_trigger)
{
#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ >= 1000
if constexpr (ENABLE_PDL)
auto const wait_for_previous_grid = [&]
{
cudaGridDependencySynchronize();
}
if constexpr (ENABLE_PDL)
{
cudaGridDependencySynchronize();
// See attn_res_fwd_s1_single_cta_kernel.
if (early_trigger)
{
cudaTriggerProgrammaticLaunchCompletion();
}
}
};
wait_for_previous_grid();

namespace cg = cooperative_groups;
constexpr int H = 7168;
Expand Down Expand Up @@ -1439,6 +1463,7 @@ __global__ void __launch_bounds__(256, 1) attn_res_fwd_s1_splitk_kernel(bf16_t c

float sq[N] = {};
float dot[N] = {};
// Every candidate in one pass, so all loads are in flight together.
#pragma unroll
for (int ki = tid; ki < K_PER_CTA; ki += THREADS)
{
Expand Down Expand Up @@ -1638,7 +1663,10 @@ __global__ void __launch_bounds__(256, 1) attn_res_fwd_s1_splitk_kernel(bf16_t c

if constexpr (ENABLE_PDL)
{
cudaTriggerProgrammaticLaunchCompletion();
if (!early_trigger)
{
cudaTriggerProgrammaticLaunchCompletion();
}
}
#else
if (cute::thread0())
Expand All @@ -1652,13 +1680,14 @@ template <int N, int GROUPS = 8, bool FUSE_OUTPUT_RMS_NORM = false, bool FUSE_LA
static void launch_s1_splitk(bf16_t const* block_residual, bf16_t const* layer_residual,
bf16_t const* layer_residual_add, bf16_t const* res_weight, bf16_t const* rms_weight,
bf16_t const* output_rms_weight, bf16_t* updated_layer_residual, bf16_t* output, float* rsigma, float* probs,
float* logits, float rms_eps, float output_rms_eps, int num_tokens, cudaStream_t stream)
float* logits, float rms_eps, float output_rms_eps, int num_tokens, cudaStream_t stream, S1Handoff handoff = {})
{
constexpr int K_PER_CTA = 7168 / GROUPS;
constexpr int WARPS = 8;
constexpr size_t smem_size
= (size_t) N * K_PER_CTA * sizeof(float) + (size_t) WARPS * N * sizeof(float2) + (size_t) N * sizeof(float);
bool const enable_pdl = tensorrt_llm::common::getEnvEnablePDL();
bool early_trigger = enable_pdl && handoff.early_trigger;
auto kernel = enable_pdl ? &attn_res_fwd_s1_splitk_kernel<N, GROUPS, FUSE_OUTPUT_RMS_NORM, FUSE_LAYER_ADD, true>
: &attn_res_fwd_s1_splitk_kernel<N, GROUPS, FUSE_OUTPUT_RMS_NORM, FUSE_LAYER_ADD, false>;
static std::once_flag attrs_set[2][64];
Expand All @@ -1678,7 +1707,7 @@ static void launch_s1_splitk(bf16_t const* block_residual, bf16_t const* layer_r
void* args[] = {const_cast<bf16_t**>(&block_residual), const_cast<bf16_t**>(&layer_residual),
const_cast<bf16_t**>(&layer_residual_add), const_cast<bf16_t**>(&res_weight), const_cast<bf16_t**>(&rms_weight),
const_cast<bf16_t**>(&output_rms_weight), &updated_layer_residual, &output, &rsigma, &probs, &logits, &rms_eps,
&output_rms_eps, &num_tokens};
&output_rms_eps, &num_tokens, &early_trigger};
cudaLaunchConfig_t config{};
// One cluster per token. clusterDim stays GROUPS, so clusters are contiguous
// spans of the grid and each token's DSM exchange stays within its own.
Expand Down Expand Up @@ -1887,18 +1916,19 @@ static void launchAttnResDecodeRmsNorm(AttnResFwdParams const& params, cudaStrea

auto const* layer_residual_add = FUSE_LAYER_ADD ? params.layerResidualAdd : nullptr;
auto* updated_layer_residual = FUSE_LAYER_ADD ? params.updatedLayerResidual : nullptr;
S1Handoff const handoff{params.earlyTrigger};

if constexpr (N <= 4)
{
launch_s1_single_cta<N, true, FUSE_LAYER_ADD>(params.blockResidual, params.layerResidual, layer_residual_add,
params.resWeight, params.rmsWeight, params.outputRmsWeight, updated_layer_residual, params.output, nullptr,
nullptr, nullptr, params.rmsEps, params.outputRmsEps, params.seqLen, stream);
nullptr, nullptr, params.rmsEps, params.outputRmsEps, params.seqLen, stream, handoff);
}
else
{
launch_s1_splitk<N, 8, true, FUSE_LAYER_ADD>(params.blockResidual, params.layerResidual, layer_residual_add,
params.resWeight, params.rmsWeight, params.outputRmsWeight, updated_layer_residual, params.output, nullptr,
nullptr, nullptr, params.rmsEps, params.outputRmsEps, params.seqLen, stream);
nullptr, nullptr, params.rmsEps, params.outputRmsEps, params.seqLen, stream, handoff);
}
}

Expand Down
1 change: 1 addition & 0 deletions cpp/tensorrt_llm/kernels/kimiK3AttnRes/attnResFwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ struct AttnResFwdParams
int hiddenSize; // H
float rmsEps;
float outputRmsEps;
bool earlyTrigger = false;
};

//! Launches the fused attention-residual forward on the supplied stream.
Expand Down
Loading
Loading