perf(k3): fold situ/gate epilogues into the Q8_0 their consumer needs - #153
Closed
marktech0813 wants to merge 4 commits into
Closed
perf(k3): fold situ/gate epilogues into the Q8_0 their consumer needs#153marktech0813 wants to merge 4 commits into
marktech0813 wants to merge 4 commits into
Conversation
The decode graph's hottest node is still the activation quantiser. Three producers — kda_gate_out, mla_gate_out, and situ — exist only to feed one projection a few microseconds later; folding the producer into that quantise removes both launches per site and stays bit-identical to the split path.
The fused Q8 path is the only consumer outside debug tags. Passing nullptr for the float mirror drops ~186 HBM writes/token/rank without changing the Q8 bytes the projection reads.
CI Relative links resolve walks paths from the file's directory. Links in docs/technical.md pointed at repo-root paths, so the configs + docs job failed with 21 broken links on an otherwise clean merge.
|
Contributor
Author
|
Closing: gittensor-ai-lab/sparkinfer-k3 is not in the current active master_repositories.json emission set (only gittensor-ai-lab/sparkinfer is weighted). Refocusing on scored sparkinfer speedups. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hoist_actalready stops the shared attn/ffn norms from being re-quantised. What is left are activations that are written by one kernel and immediately re-read byquantize_q8_0for a single consumer:Each fold does the producer arithmetic and the warp Q8_0 emit in one launch, then the forward calls
k3_proj_q8act_f32on that scratch. On the hot path the float mirror is skipped unless a debug tag needs it.Rebased onto current
mainafter batched prefill (#144/#136/#148). The fold is wired on the single-token path (a_tok == 1/n_tok == 1) — decode and any n_tok=1 call — and declines cleanly so the chunk/tile prefill path keepssitu/gate+proj_b. Bit-identical Q8 to the split path.SPARKINFER_K3_EPILOGUE_Q8=0restores the pair.Also includes a docs-only fix for
docs/technical.mdroot-relative links that were failing theconfigs + docsCI job (same breakage exists onmain).Not the MLA slice fill (#133), not phase-major / batch tile prefill (#144/#136/#148).
Replaces #128 — that PR was mergeable (
behind_by=0) but carried a stalemerge-conflictlabel contributors cannot clear (bot-owned; only clears on the next eval round).What kind of change is this?
ciworkflow, no node neededruntime/,kernels/,moe/,server/,CMakeLists.txt) — needs a node run belowreference.lock, a*.sha256manifest) — needs the backingbench/results/*.jsoncommittedNode run
sm_90)Prefill tok/s @ 32k — the scored metric.
Decode tok/s @ 128k — the guard, not the tier. Must stay within 1% of the frontier.
Known problems
Needs a same-session 8× H200 A/B against post-#148
mainbefore any box can be ticked. The fold targets the single-token path (decode guard + n_tok=1); whether it moves scored prefill now that ingestion is batched is an open measurement question.Checklist
main(conflicts with batched prefill resolved; fold gated ton_tok/a_tok== 1)k3_epilogue_q8_gpu_testconfigs + docsgreen (technical.md relative links)