[GH-ISSUE #23] Two-GPU GLM pack: ~11 ms fixed device time per call and a 9.2 ms host wait dominate the token #10

Closed
opened 2026-10-29 21:19:06 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @ZackO2o on GitHub (Oct 8, 2026).
Original GitHub issue: https://github.com/mw00/project-maya/issues/23

Batching / speculative-decoding off: decode is 4.1x faster than the streaming path on the same box

Context: I run a 2x 64 GB Ampere-class machine (GA100, 128 GB total, PCIe Gen2 x4) with
GLM-5.3-Flash-Maya-M fully resident in VRAM. Serve mode and --bench-style direct engine
invocation give very different numbers on identical settings, and the gap looks like it is in how
work is enqueued rather than in the model.

What I measured

Direct engine (server's own config, --spec 6 --native <shard> --kv int8, 32K context), 400
generated tokens, thinking off:

pure decode (400 tokens)      77.0 tokens/s   accept 97-98%
per-token breakdown (13.6 ms):
  wait tail      9.20 ms   <- 68% of the token
  enqueue head   1.85 ms
  draft + redo   1.56 ms
  enqueue tail   1.11 ms
CUDA1 DEVICE ~11.0-11.3 ms/call (99 calls)  — unchanged by --spec, --native or --kv

The last line is the one that puzzles me: CUDA1 DEVICE stays at ~11 ms per call whether or not
speculation is on, whether the two GPUs are both visible, and regardless of the KV dtype. For 21
layers of a 2-bit-expert MoE that is ~520 us/layer, while the expert bytes alone would be
8 experts x 8.98 MB = 71.8 MB per layer — ~48 us at the card's nominal bandwidth. So the device
side is running at roughly 9% of its memory bandwidth, and wait tail (the host-side wait before
the next layer's work can be enqueued) is the single largest term.

Why I am filing this

This looks like the same shape as another data point in your issue list / linked repos: a machine
where expert copies 12.4 ms + expert kernels 0.2 ms + dense/routers/sync 37.2 ms per token, i.e.
the ceiling is the dense/sync path, not the expert stream. Two questions:

  1. Is the fixed ~11 ms device time per call expected for the GLM-5.3 geometry on an sm_80 part, or
    does it look like the expert dequantize/dispatch path is serialising?
  2. Is there a supported way to make the two GPUs overlap (the token's layer-0..23 work on one card
    and 24..45 on the other being enqueued so that wait tail overlaps the other card's compute)?
    I tried --stream-token (it raised acceptance on short prompts but left CUDA1 DEVICE at
    11.25 ms) and --adapt-every, but I am not sure I am using them as intended.

If it would help, I can produce a STRATA_GLM_TIMING=1 trace with the per-phase numbers at a fixed
prompt and seed, so the two sides of the comparison are exactly reproducible.

Originally created by @ZackO2o on GitHub (Oct 8, 2026). Original GitHub issue: https://github.com/mw00/project-maya/issues/23 # Batching / speculative-decoding off: decode is 4.1x faster than the streaming path on the same box Context: I run a 2x 64 GB Ampere-class machine (GA100, 128 GB total, PCIe Gen2 x4) with `GLM-5.3-Flash-Maya-M` fully resident in VRAM. Serve mode and `--bench`-style direct engine invocation give very different numbers on identical settings, and the gap looks like it is in how work is enqueued rather than in the model. ## What I measured Direct engine (server's own config, `--spec 6 --native <shard> --kv int8`, 32K context), 400 generated tokens, thinking off: ``` pure decode (400 tokens) 77.0 tokens/s accept 97-98% per-token breakdown (13.6 ms): wait tail 9.20 ms <- 68% of the token enqueue head 1.85 ms draft + redo 1.56 ms enqueue tail 1.11 ms CUDA1 DEVICE ~11.0-11.3 ms/call (99 calls) — unchanged by --spec, --native or --kv ``` The last line is the one that puzzles me: `CUDA1 DEVICE` stays at ~11 ms per call whether or not speculation is on, whether the two GPUs are both visible, and regardless of the KV dtype. For 21 layers of a 2-bit-expert MoE that is ~520 us/layer, while the expert bytes alone would be `8 experts x 8.98 MB = 71.8 MB` per layer — ~48 us at the card's nominal bandwidth. So the device side is running at roughly 9% of its memory bandwidth, and `wait tail` (the host-side wait before the next layer's work can be enqueued) is the single largest term. ## Why I am filing this This looks like the same shape as another data point in your issue list / linked repos: a machine where `expert copies 12.4 ms + expert kernels 0.2 ms + dense/routers/sync 37.2 ms` per token, i.e. the ceiling is the dense/sync path, not the expert stream. Two questions: 1. Is the fixed ~11 ms device time per call expected for the GLM-5.3 geometry on an sm_80 part, or does it look like the expert dequantize/dispatch path is serialising? 2. Is there a supported way to make the two GPUs overlap (the token's layer-0..23 work on one card and 24..45 on the other being enqueued so that `wait tail` overlaps the other card's compute)? I tried `--stream-token` (it raised acceptance on short prompts but left `CUDA1 DEVICE` at 11.25 ms) and `--adapt-every`, but I am not sure I am using them as intended. If it would help, I can produce a `STRATA_GLM_TIMING=1` trace with the per-phase numbers at a fixed prompt and seed, so the two sides of the comparison are exactly reproducible.
Author
Owner

@mw00 commented on GitHub (Oct 8, 2026):

Thanks for the careful numbers. Your reading is right, and it's the main limit once every expert is in VRAM.

The ~11 ms per call is expected today. It isn't the experts. A decode step on a half runs, per layer:

  • the attention (the sparse indexer's projections, its scoring and top-k, the MLA attention over the selected cells; or the recurrent KDA update);
  • the router;
  • the routed experts' gate/up and down;
  • the shared expert;
  • the norms and hyper-connections.

That's a few dozen short, dependent kernels, each a few to a few tens of µs. So the time is launch and latency, not bandwidth: ~0.5 ms a layer on a V100 as on your GA100, and the bytes alone would take a tenth of that. We see the same ~11 ms of compute per half per token on 2x V100.

The wait tail is the critical path, not idle time. The two-GPU decode is already pipelined: while the tail finishes position q+1 (its layers, the MTP draft block and the output head), the head speculatively runs position q+2. The host waits on the tail because the tail carries the most work. Two things you can try now:

  • STRATA_GLM_SPLIT=25 or 26 puts more layers on the head to balance the halves (the default is the midpoint + 2);
  • updating from v1.0.6. Since then the CPU lane, prefill and tool calls changed a lot (v1.0.13 fixed GLM tool calls, which never worked before), though not this device time.

What will move it: capturing each half's per-token work as a CUDA graph (one launch instead of dozens) and fusing the small kernels (norm + quantize, router + top-k, the shared expert into the routed launch). That's now the top engine item on our list, because your machine and every fully resident setup is bound by exactly this. If you'd like to work on it, a PR is very welcome: see CONTRIBUTING.md. Your box, with everything in VRAM, is the ideal test bench for it.

(--spec, --native and --stream-token are Strata's engine flags. The GLM path doesn't use them, which is why CUDA1 DEVICE didn't move.)

<!-- gh-comment-id:6069348841 --> @mw00 commented on GitHub (Oct 8, 2026): Thanks for the careful numbers. Your reading is right, and it's the main limit once every expert is in VRAM. **The ~11 ms per call is expected today.** It isn't the experts. A decode step on a half runs, per layer: - the attention (the sparse indexer's projections, its scoring and top-k, the MLA attention over the selected cells; or the recurrent KDA update); - the router; - the routed experts' gate/up and down; - the shared expert; - the norms and hyper-connections. That's a few dozen short, dependent kernels, each a few to a few tens of µs. So the time is launch and latency, not bandwidth: ~0.5 ms a layer on a V100 as on your GA100, and the bytes alone would take a tenth of that. We see the same ~11 ms of compute per half per token on 2x V100. **The `wait tail` is the critical path, not idle time.** The two-GPU decode is already pipelined: while the tail finishes position q+1 (its layers, the MTP draft block and the output head), the head speculatively runs position q+2. The host waits on the tail because the tail carries the most work. Two things you can try now: - `STRATA_GLM_SPLIT=25` or `26` puts more layers on the head to balance the halves (the default is the midpoint + 2); - updating from v1.0.6. Since then the CPU lane, prefill and tool calls changed a lot (v1.0.13 fixed GLM tool calls, which never worked before), though not this device time. **What will move it:** capturing each half's per-token work as a CUDA graph (one launch instead of dozens) and fusing the small kernels (norm + quantize, router + top-k, the shared expert into the routed launch). That's now the top engine item on our list, because your machine and every fully resident setup is bound by exactly this. If you'd like to work on it, a PR is very welcome: see [CONTRIBUTING.md](https://github.com/mw00/project-maya/blob/main/CONTRIBUTING.md). Your box, with everything in VRAM, is the ideal test bench for it. (`--spec`, `--native` and `--stream-token` are Strata's engine flags. The GLM path doesn't use them, which is why `CUDA1 DEVICE` didn't move.)
Author
Owner

@ZackO2o commented on GitHub (Oct 9, 2026):

Follow-up on v1.0.16, as you suggested. Two things you can use, and one question.

Same machine as #22: 2x CMP 170HX (64 GB each, PCIe Gen2 x4, 74 SMs, driver 610.43.03), Maya-M with every
expert in VRAM, 32K context, Xeon E5-2690 v4, 91 GB RAM.

1. STRATA_GLM_SPLIT=25 is the better split here — confirmed, thank you

You were right that 25 balances the halves. Same harness (three questions of 256 tokens, greedy, thinking
off, one warm-up first), same machine, one boot per configuration, new build from source at v1.0.16 with
--native + --kv int8 + --spec 6:

configuration Q1 Q2 Q3 mean draft accept
v1.0.6, split 24 59.28 58.49 63.83 60.5 68 / 65 / 80 %
v1.0.16, split 24 65.73 54.97 70.96 63.9 86 / 87 / 97 %
v1.0.16, split 25 65.14 66.86 70.34 67.4 87 / 89 / 97 %
v1.0.16, split 26 63.58 65.93 69.69 66.4 86 / 90 / 97 %

So v1.0.6 -> v1.0.16 is +11.4% on mean decode at split 25, and most of it is the acceptance rate moving
from 65-80% to 86-97%. The per-call device time barely moved (11.12 -> 11.00 ms on the tail half), which is
what you said to expect. 26 has the lowest device time of the three (10.43 ms on the tail) but a lower
mean than 25.

2. The CPU lane is not idle here, and switching it off costs 12%

The glm fast: lines at start:

glm fast: CUDA0 CPU lane: 14 threads, an expert 0.415 ms on the CPU vs 5.536 ms over PCIe -> of 0..8 RAM-tier experts the CPU takes 0 1 2 3 4 5 6 7 8
glm fast: CUDA1 CPU lane: 14 threads, an expert 0.355 ms on the CPU vs 5.281 ms over PCIe -> of 0..8 RAM-tier experts the CPU takes 0 1 2 3 4 5 6 7 8

That PCIe figure is the interesting one on a Gen2 x4 link: 9.4 MB in ~5.5 ms is about 1.7 GB/s, which is
within 15% of what a Gen2 x4 link can do, so the measurement is honest. It also means the CPU lane takes
every RAM-tier expert it is offered.

STRATA_GLM_CPU_LANE=0 on the same build and split:

CPU lane Q1 Q2 Q3 mean ram fetches promotions
auto (14 threads) 67.06 67.10 71.37 68.5 0.00 /tok 0.00 /tok
off (=0) 52.98 63.60 64.58 60.4 0.23-0.62 /tok 0.23-0.62 /tok

With the lane off, experts leave VRAM and have to be brought back every token over that 1.7 GB/s link;
decode goes 14.9 -> 18.9-22.9 ms/token. Since the reports in the README describe the lane as something that
helps when experts don't fit, it may be worth a line in the docs that it is not a no-op on a fully
resident setup either — it is what keeps the last few promotions off the PCIe path. (I can send the full
glm stat: lines if useful.)

3. Question: what is the smallest piece of the graph work that would be a useful PR?

You mentioned capturing each half's per-token work as a CUDA graph and fusing the small kernels as the top
engine item. I have a sm_80 box with every expert in VRAM, so I am in the target case, and I would like to
work on it rather than just report.

My question is where to start so the PR is useful to you and not a rewrite I cannot validate:

  • Is the fusing side (norm + quantize, router + top-k, shared expert into the routed launch) the better
    first PR, or the graph capture side? The fused kernels look like they can be measured one at a time
    on the existing harness; a graph capture for a half's step looks harder to land incrementally.
  • For a graph capture, is there an obvious cut point in the code you would want it placed at — e.g. one
    graph per layer, or one per half per token? A per-token graph over the tail half is the shape I would
    guess, but I would rather build the one you can review.
  • Do you already have a branch or notes for it? I would rather extend your sketch than start a parallel one.
  • Anything you tried and rejected on this path that I should not spend time on.

I have the harness and the before/after discipline from CONTRIBUTING.md in place (same session, three
questions, and I keep the glm spec/glm stat lines plus the per-call DEVICE numbers, because the
acceptance rate moves around enough that the wall-clock alone is misleading).

Thanks again for the earlier answer — the split advice and the note about wait tail being the critical
path rather than idle time both changed what I was optimising for.

<!-- gh-comment-id:6075381062 --> @ZackO2o commented on GitHub (Oct 9, 2026): Follow-up on v1.0.16, as you suggested. Two things you can use, and one question. Same machine as #22: 2x CMP 170HX (64 GB each, PCIe Gen2 x4, 74 SMs, driver 610.43.03), Maya-M with every expert in VRAM, 32K context, Xeon E5-2690 v4, 91 GB RAM. ## 1. `STRATA_GLM_SPLIT=25` is the better split here — confirmed, thank you You were right that 25 balances the halves. Same harness (three questions of 256 tokens, greedy, thinking off, one warm-up first), same machine, one boot per configuration, new build from source at v1.0.16 with `--native` + `--kv int8` + `--spec 6`: | configuration | Q1 | Q2 | Q3 | mean | draft accept | |---|---:|---:|---:|---:|---:| | v1.0.6, split 24 | 59.28 | 58.49 | 63.83 | 60.5 | 68 / 65 / 80 % | | v1.0.16, split 24 | 65.73 | 54.97 | 70.96 | 63.9 | 86 / 87 / 97 % | | **v1.0.16, split 25** | 65.14 | 66.86 | 70.34 | **67.4** | 87 / 89 / 97 % | | v1.0.16, split 26 | 63.58 | 65.93 | 69.69 | 66.4 | 86 / 90 / 97 % | So v1.0.6 -> v1.0.16 is +11.4% on mean decode at split 25, and most of it is the acceptance rate moving from 65-80% to 86-97%. The per-call device time barely moved (11.12 -> 11.00 ms on the tail half), which is what you said to expect. 26 has the lowest device time of the three (10.43 ms on the tail) but a lower mean than 25. ## 2. The CPU lane is not idle here, and switching it off costs 12% The `glm fast:` lines at start: ``` glm fast: CUDA0 CPU lane: 14 threads, an expert 0.415 ms on the CPU vs 5.536 ms over PCIe -> of 0..8 RAM-tier experts the CPU takes 0 1 2 3 4 5 6 7 8 glm fast: CUDA1 CPU lane: 14 threads, an expert 0.355 ms on the CPU vs 5.281 ms over PCIe -> of 0..8 RAM-tier experts the CPU takes 0 1 2 3 4 5 6 7 8 ``` That PCIe figure is the interesting one on a Gen2 x4 link: 9.4 MB in ~5.5 ms is about 1.7 GB/s, which is within 15% of what a Gen2 x4 link can do, so the measurement is honest. It also means the CPU lane takes every RAM-tier expert it is offered. `STRATA_GLM_CPU_LANE=0` on the same build and split: | CPU lane | Q1 | Q2 | Q3 | mean | `ram fetches` | `promotions` | |---|---:|---:|---:|---:|---:|---:| | auto (14 threads) | 67.06 | 67.10 | 71.37 | 68.5 | 0.00 /tok | 0.00 /tok | | off (`=0`) | 52.98 | 63.60 | 64.58 | 60.4 | 0.23-0.62 /tok | 0.23-0.62 /tok | With the lane off, experts leave VRAM and have to be brought back every token over that 1.7 GB/s link; decode goes 14.9 -> 18.9-22.9 ms/token. Since the reports in the README describe the lane as something that helps when experts *don't* fit, it may be worth a line in the docs that it is not a no-op on a fully resident setup either — it is what keeps the last few promotions off the PCIe path. (I can send the full `glm stat:` lines if useful.) ## 3. Question: what is the smallest piece of the graph work that would be a useful PR? You mentioned capturing each half's per-token work as a CUDA graph and fusing the small kernels as the top engine item. I have a sm_80 box with every expert in VRAM, so I am in the target case, and I would like to work on it rather than just report. My question is where to start so the PR is useful to you and not a rewrite I cannot validate: - Is the **fusing** side (norm + quantize, router + top-k, shared expert into the routed launch) the better first PR, or the **graph capture** side? The fused kernels look like they can be measured one at a time on the existing harness; a graph capture for a half's step looks harder to land incrementally. - For a graph capture, is there an obvious cut point in the code you would want it placed at — e.g. one graph per layer, or one per half per token? A per-token graph over the tail half is the shape I would guess, but I would rather build the one you can review. - Do you already have a branch or notes for it? I would rather extend your sketch than start a parallel one. - Anything you tried and rejected on this path that I should not spend time on. I have the harness and the before/after discipline from CONTRIBUTING.md in place (same session, three questions, and I keep the `glm spec`/`glm stat` lines plus the per-call `DEVICE` numbers, because the acceptance rate moves around enough that the wall-clock alone is misleading). Thanks again for the earlier answer — the split advice and the note about `wait tail` being the critical path rather than idle time both changed what I was optimising for.
Author
Owner

@ZackO2o commented on GitHub (Oct 9, 2026):

One more measurement while I wait — I profiled the decode step with nsys on this machine so I could
size the three fusions you named before starting. The answer surprised me: on a fully resident
--native
setup most of them are already paid for, and the GEMV launches are where the time is. If my
reading is wrong, telling me now saves a wasted PR.

The step, measured

Build from source at v1.0.16, split 25, --native + --kv int8 + --spec 6, 32K context, Maya-M with
every expert in VRAM. Six answers x 60 tokens, nsys --trace=cuda. glm_link_wake is excluded (two
calls of 1.5 s at start, not per token).

kernel                      per token   per token   share
--------------------------- ----------  ----------  ------
mv_kernel_t<14>  (Q6_K)        135.5     8.84 ms    42.3 %
moe_gate_up_kernel<22>          36.5     3.92 ms    18.8 %
moe_down_kernel<18>             29.6     1.43 ms     6.9 %
hc3_kernel                      78.7     1.22 ms     5.9 %
mv_kernel  (generic)            87.5     1.14 ms     5.5 %
moe_route_kernel                37.2     0.95 ms     4.5 %
mla_split_kernel                10.3     0.72 ms     3.4 %
moe_down_kernel<21>              6.9     0.41 ms     2.0 %
kda_prep_kernel                 29.8     0.38 ms     1.8 %
headwise_gemv_kernel            20.6     0.37 ms     1.8 %
...  (the rest are each under 1.5 %)
--------------------------- ----------  ----------  ------
total GPU kernel time per token           20.9 ms

659 kernel launches per token, average 30 us. Per layer that is about 14.6 launches, which lines up
with the per-layer story you gave.

Sizing the three fusions you suggested

your suggestion kernel share here verdict
norm + quantize rms_q8_kernel 0.1 % 0.018 ms/token — almost nothing to win
router + top-k moe_route_kernel 4.5 % 0.95 ms/token; halving it is 0.47 ms (+3 %)
shared expert into the routed launch — 0.0 % already fused on the --native path

I suspect these are sized for the tiered path (experts leaving VRAM, the CPU lane, prefill) where they are
worth much more — I am not saying they are wrong in general, just that they are not what this box is paying
for. rms_q8_kernel runs 2 times a token here, so fusing norm into quantize touches something that is
already ~free.

What this box is actually paying for

mv_kernel_t<14> (135.5/token, 8.84 ms, 42 %) and mv_kernel generic (87.5/token, 1.14 ms, 5.5 %) —
223 small GEMV launches a token, 47.8 % of the GPU time between them. From ncu on a couple of them,
mv_kernel_t<14> reads 27-83 MB at 35-44 % of DRAM peak, so they are latency-bound rather than
bandwidth-bound, which matches your point that the bytes alone would take a tenth of the time.

So the two things I would actually work on, in this order:

  1. Collapse the per-layer GEMV launches. At 223/token, if a step's small kernels were captured as a
    graph (or just batched harder — kMaxMvJobs is 8 and a layer issues several mv() calls of 1-6 jobs),
    the launch count is the thing that moves. Simple experiment I already ran that supports this:
    raising MV_ROWS from 8 to 32 (blockDim 256 -> 1024) moved decode from 56.1 to 59.6 tok/s on the same
    session, so these kernels respond to being given more work per launch.
  2. hc3_kernel — 78.7 launches/token, 1.22 ms, 5.9 %. It wasn't in your list; is it fusable with a
    neighbour, or is it already at its floor?

The question

Given that, is graph capture over the per-layer small kernels the PR you want, or would you rather I
did the narrower "batch more GEMV jobs per launch" change first (kMaxMvJobs / MV_ROWS / grouping the
mv() call sites in a layer)? The second is a much smaller diff and I can measure it standalone; the
first is the one that removes the launch latency you described.

Either way I will send before/after on this machine with the harness CONTRIBUTING.md asks for, and say if
the outputs change (they should not for a launch change; a graph capture may change the last bits the way
a different expert placement does).

If you have the branch or notes for this already, point me at them and I will extend that instead of
starting a parallel one.

<!-- gh-comment-id:6076216411 --> @ZackO2o commented on GitHub (Oct 9, 2026): One more measurement while I wait — I profiled the decode step with `nsys` on this machine so I could size the three fusions you named before starting. The answer surprised me: on a **fully resident `--native`** setup most of them are already paid for, and the GEMV launches are where the time is. If my reading is wrong, telling me now saves a wasted PR. ## The step, measured Build from source at v1.0.16, split 25, `--native` + `--kv int8` + `--spec 6`, 32K context, Maya-M with every expert in VRAM. Six answers x 60 tokens, `nsys` `--trace=cuda`. `glm_link_wake` is excluded (two calls of 1.5 s at start, not per token). ``` kernel per token per token share --------------------------- ---------- ---------- ------ mv_kernel_t<14> (Q6_K) 135.5 8.84 ms 42.3 % moe_gate_up_kernel<22> 36.5 3.92 ms 18.8 % moe_down_kernel<18> 29.6 1.43 ms 6.9 % hc3_kernel 78.7 1.22 ms 5.9 % mv_kernel (generic) 87.5 1.14 ms 5.5 % moe_route_kernel 37.2 0.95 ms 4.5 % mla_split_kernel 10.3 0.72 ms 3.4 % moe_down_kernel<21> 6.9 0.41 ms 2.0 % kda_prep_kernel 29.8 0.38 ms 1.8 % headwise_gemv_kernel 20.6 0.37 ms 1.8 % ... (the rest are each under 1.5 %) --------------------------- ---------- ---------- ------ total GPU kernel time per token 20.9 ms ``` **659 kernel launches per token**, average 30 us. Per layer that is about 14.6 launches, which lines up with the per-layer story you gave. ## Sizing the three fusions you suggested | your suggestion | kernel | share here | verdict | |---|---|---:|---| | norm + quantize | `rms_q8_kernel` | **0.1 %** | 0.018 ms/token — almost nothing to win | | router + top-k | `moe_route_kernel` | 4.5 % | 0.95 ms/token; halving it is 0.47 ms (+3 %) | | shared expert into the routed launch | — | **0.0 %** | already fused on the `--native` path | I suspect these are sized for the tiered path (experts leaving VRAM, the CPU lane, prefill) where they are worth much more — I am not saying they are wrong in general, just that they are not what this box is paying for. `rms_q8_kernel` runs 2 times a token here, so fusing norm into quantize touches something that is already ~free. ## What this box is actually paying for **`mv_kernel_t<14>` (135.5/token, 8.84 ms, 42 %) and `mv_kernel` generic (87.5/token, 1.14 ms, 5.5 %)** — 223 small GEMV launches a token, 47.8 % of the GPU time between them. From `ncu` on a couple of them, `mv_kernel_t<14>` reads 27-83 MB at 35-44 % of DRAM peak, so they are latency-bound rather than bandwidth-bound, which matches your point that the bytes alone would take a tenth of the time. So the two things I would actually work on, in this order: 1. **Collapse the per-layer GEMV launches.** At 223/token, if a step's small kernels were captured as a graph (or just batched harder — `kMaxMvJobs` is 8 and a layer issues several `mv()` calls of 1-6 jobs), the launch count is the thing that moves. Simple experiment I already ran that supports this: raising `MV_ROWS` from 8 to 32 (blockDim 256 -> 1024) moved decode from 56.1 to 59.6 tok/s on the same session, so these kernels respond to being given more work per launch. 2. **`hc3_kernel`** — 78.7 launches/token, 1.22 ms, 5.9 %. It wasn't in your list; is it fusable with a neighbour, or is it already at its floor? ## The question Given that, is **graph capture over the per-layer small kernels** the PR you want, or would you rather I did the narrower "batch more GEMV jobs per launch" change first (`kMaxMvJobs` / `MV_ROWS` / grouping the `mv()` call sites in a layer)? The second is a much smaller diff and I can measure it standalone; the first is the one that removes the launch latency you described. Either way I will send before/after on this machine with the harness CONTRIBUTING.md asks for, and say if the outputs change (they should not for a launch change; a graph capture may change the last bits the way a different expert placement does). If you have the branch or notes for this already, point me at them and I will extend that instead of starting a parallel one.
Author
Owner

@mw00 commented on GitHub (Oct 9, 2026):

Thank you, the profile settles it, and your reading is right. On a fully resident --native setup the small GEMV launches are the cost, and the three fusions I named matter on the tiered path, not here.

Please do the narrower change first: more GEMV work per launch (kMaxMvJobs, MV_ROWS, grouping a layer's mv() calls).

  • It's a smaller diff, measurable on its own, and it helps every setup: splits, MTP and AMD included.
  • Your MV_ROWS 8 -> 32 run (56.1 -> 59.6 tokens/s) is a good sign. Please also check it doesn't slow down older or smaller cards; we'll A/B it on 1x and 2x Tesla V100 before merging.

Graph capture exists since v1.0.25 for one GPU: STRATA_GLM_KDA_GRAPH=1, from #59, described in docs/GLM-KDA-GRAPHS.md. It replays the KDA decode layers. DSA layers, splits and MTP still run direct. Extending that infrastructure to your two-GPU spec path would be a later PR, best started from that code rather than a parallel one.

hc3_kernel is already the third, fused version of the hyper-connection step. Merging it into its neighbouring norm might save part of its 1.2 ms, but that's worth less than the GEMV launches.

Please rebase on v1.0.27 (it has #39's synchronisation changes in the same file). Before/after with the CONTRIBUTING harness, plus a note on whether the tokens change, is exactly what we need.

<!-- gh-comment-id:6089312558 --> @mw00 commented on GitHub (Oct 9, 2026): Thank you, the profile settles it, and your reading is right. On a fully resident `--native` setup the small GEMV launches are the cost, and the three fusions I named matter on the tiered path, not here. **Please do the narrower change first:** more GEMV work per launch (`kMaxMvJobs`, `MV_ROWS`, grouping a layer's `mv()` calls). - It's a smaller diff, measurable on its own, and it helps every setup: splits, MTP and AMD included. - Your `MV_ROWS` 8 -> 32 run (56.1 -> 59.6 tokens/s) is a good sign. Please also check it doesn't slow down older or smaller cards; we'll A/B it on 1x and 2x Tesla V100 before merging. **Graph capture** exists since v1.0.25 for one GPU: `STRATA_GLM_KDA_GRAPH=1`, from #59, described in `docs/GLM-KDA-GRAPHS.md`. It replays the KDA decode layers. DSA layers, splits and MTP still run direct. Extending that infrastructure to your two-GPU spec path would be a later PR, best started from that code rather than a parallel one. **`hc3_kernel`** is already the third, fused version of the hyper-connection step. Merging it into its neighbouring norm might save part of its 1.2 ms, but that's worth less than the GEMV launches. Please rebase on v1.0.27 (it has `#39`'s synchronisation changes in the same file). Before/after with the CONTRIBUTING harness, plus a note on whether the tokens change, is exactly what we need.
Author
Owner

@mw00 commented on GitHub (Oct 12, 2026):

Closing this thread. The launch-overhead work you described is still welcome as a PR, rebased on v1.1.3, with the CONTRIBUTING harness before and after and a note on whether the tokens change.

<!-- gh-comment-id:6125947435 --> @mw00 commented on GitHub (Oct 12, 2026): Closing this thread. The launch-overhead work you described is still welcome as a PR, rebased on v1.1.3, with the CONTRIBUTING harness before and after and a note on whether the tokens change.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mw00/project-maya#10
No description provided.