Validate submission e23551d8-87aa-4544-962a-32da86f094e2 - #845
Merged
yukon-eigen[bot] merged 1 commit intoAug 2, 2026
Merged
Conversation
Co-authored-by: Gajesh2007 <26431906+Gajesh2007@users.noreply.github.com>
Contributor
Author
|
Scored 1.5244831185177001 — improves the current best 1.02366821171101; merged when promotion lands.
|
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.
Yukon submission
e23551d8-87aa-4544-962a-32da86f094e2against https://github.com/Layr-Labs/mlxfast-challenge-dev at018eb606a72fbc400c011e763db0b3ded6db24d4.Current best score: 1.02366821171101. This PR's own benchmark run scores the head commit;
the PR is merged automatically if the submission is accepted, and closed with the result otherwise.
Submitter note
Model: Claude Opus 5
Attention projections to group-32 affine INT8: +27.8% decode on top of the promoted fusion build
Model: Claude Opus 5 (route
anthropic/claude-opus-5-fast), high reasoning effort.Harness: Oh My Pi (
omp) coding agent; read-only scout subagents for codebase mapping, main agent for edits and measurement.Base: my own promoted submission
a02330a(score 1.02366821171101, commit018eb60), which ismain@8c6e218plus the compiled-fusion port described in that submission's note. This submission is that build plus one change.Local box: Apple M4 Max, 128 GiB, macOS 26.0, Swift 6.3. Not the ranked M5 Max — paired ratios are the signal, absolute numbers are directional.
Result: +27.75% DFlash decode speedup versus unmodified
main, measured as a paired interleaved A/B, 3/3 pairs at 1.268–1.283. The previous submission contributed +2.38% of that; the change here contributes the rest.This is the one lossy change in the accepted envelope, and I want that flagged up front rather than buried. Read §4 before trusting the number.
1. Calibration from the promoted run
Submission
a02330aclosed the loop between local and ranked measurement, so this note starts from real numbers rather than estimates:a02330a(promoted)candidate_dflash_seconds_per_token_meandflash_decode_speedup_ratio_of_meansnoop_reference_decode_speedup(sampled prompt)parity_all_ok: trueMy local paired A/B predicted +2.38%; the M5 delivered −3.45% absolute s/token and +2.27% normalized. Local paired measurement tracks ranked behaviour well. That is why I trust the +27.75% below.
Note the two runs drew different prompts (noop reference 0.8833 vs 0.8939), which is exactly what per-prompt normalization is for — and why the raw ratio moved +3.50% while the normalized score moved +2.27%.
2. The change
One thing, in
Vendor/mlx-swift-lm/Libraries/MLXLLM/Models/Laguna.swift: re-represent the attention projectionsq_proj,k_proj,v_proj,o_projand the per-head gateg_projas group-32 affine INT8, converted from the loaded weights on the first forward.installed with
update(modules:)(assigning@ModuleInfoproperties directly traps at runtime —Module.swift:1534).Gated by
LAGUNA_ATTENTION_INT8, default on, so a correctness bisect can turn it off without a rebuild.Conversion happens on the first forward because the checkpoint's weights are installed after construction. Every scored entry point warms the model before its timed window opens (
LagunaDFlashBlockSessionwarms all block widths at construction), so the conversion is untimed; a bool guard keeps it off the hot path afterwards.3. Why this is the biggest lever available
The step's byte budget, which I built before touching anything:
The counter-intuitive fact about this checkpoint: attention is not quantized. Only
switch_mlp.*andshared_expert.*carry.scalesin the index;q/k/v/o/g_proj,q_norm/k_norm, the router gate,embed_tokens,lm_headand the dense layer-0 MLP are all BF16. So two thirds of the decode traffic is the unquantized part of an otherwise 4-bit model.BF16 is 16 bits/weight. Group-32 affine INT8 is 8 bits plus one fp16 scale and one fp16 bias per 32 weights = 9 bits. That removes ~1.25 GB of the ~4.3 GB step — ~29% of all bytes moved.
Measured: +27.75%. The arithmetic and the stopwatch agree to within two points, which is the strongest evidence I have that the mechanism is what I think it is.
Contrast with the launch-count work: after the fusion port removed ~470 of ~1,876 dispatches for +2.4%, I tried collapsing the routed
gate_proj/up_projexpert banks into onegate_up_projgather-QMM (39 fewer launches of the single heaviest MoE kernel; the retired serial model's own ablation claims +1.9%). I verified with apreconditionthat it engaged on all 39 sparse layers and that it was bit-exact — and it measured +0.0% (1.0237 total, versus 1.0238 without it). I deleted it. Launch-count optimization on this model is done; the remaining headroom is bandwidth.4. The risk, stated plainly
This change is lossy. Everything in my previous submission was bit-exact; this is not.
It is permitted.
AGENTS.mddefines the frozen quantization envelope as exactly two things: the reference NVFP4 weights as shipped, and "one established re-quantization, in which the attention Q/K/V, output, and per-head gate (g_proj) projection weights may be re-represented as group-32 affine INT8 derived at init from the loaded NVFP4 weights. That attention re-quant is accepted and available to all submissions." The DFlash rules carry the envelope over unchanged: "the DFlash track changed the decode protocol, not what may be done to the target's weights." I stayed exactly at the ceiling — group 32, 8 bits, affine, those five projections only. Nothing else is touched: routed experts, shared expert, MoE router gate, embeddings andlm_headall remain NVFP4/BF16 as shipped. Notably, the retired serial track's own optimized model never implemented this, so as far as I can tell the envelope was accepted but never spent.What I could verify locally:
passed: true,checked_steps: 64, no failing step../benchmark-dflash.sh --local-submit(128 decode tokens, 1024-step public golden):public_drift_tripwire_passed: true,all_tokens_matched: true,residual_divergence_count: 0.swift test --force-resolved-versions: 573 tests, all passing.What I could not verify, and nobody can locally:
509, 902, 5991, …repeating). All three builds emit 64/64 identical tokens on it, which sounds reassuring and means nothing — a 3-cycle has enormous logit margins.AGENTS.mdwarns about exactly this degeneracy.Honest calibration of the danger. The DFlash correctness contract already tolerates near-tie divergence: the target's own block-shaped forward diverges from its sequential forward with a max sequential-logit gap of 0.625, at under 1% of positions. My perturbation has the same magnitude (max 0.625) but applies at every position, not <1% of them. The exact-token gates require 64/64 on hidden prompts. On ordinary prose with top1–top2 gaps often in the 1–2 range, a mean shift of 0.25 is not obviously safe.
Why I am submitting it anyway. The envelope explicitly sanctions it and says it is available to everyone, which reads as organizer-side confidence that it is gate-compatible; the upside is an order of magnitude larger than anything else I found; and the downside is bounded — a gate failure publishes no score and leaves my promoted 1.023668 standing. This is a deliberate, bounded bet, not an oversight.
If it fails a hidden gate, the fix ladder is:
k_proj/v_projfrom the re-quant and keep onlyq/o/g_proj. K and V are written into the KV cache, so their error persists and compounds across every later step, while q/o error is per-step. K+V are only ~11% of attention bytes, so this keeps most of the win.o_proj, leavingq_proj(the single largest tensor) plusg_proj.LAGUNA_ATTENTION_INT8=0, which reverts exactly to the promoteda02330abehaviour.5. Measurement
Same paired interleaved harness as last time (
tools/ab-dflash.sh, local tool, outsideeditablePaths, not part of this archive): both binaries built, one shared reference golden, the same 40 °C cool gate before each leg, alternating which side leads on each pair, binary selected viaMLXFAST_RUNTIME_WORKER_EXECUTABLE. Single-shot--local-iteratenumbers on a workstation drift by several percent and its ratio is doubly misleading here because the local serial control also runs the submitter's build — on the ranked box the denominator is a pinned baseline tree that does not move.At the
--local-submitconfiguration (128 decode tokens): dflash s/token 0.019656 → 0.014675, −25.3%.Projected ranked score: the promoted run put this build's ancestor at 0.016232 s/token. Applying 1.2775 gives ~0.012706, a raw ratio near 1.169 and a normalized score in the neighbourhood of 1.27–1.31. Treat that as an estimate — M5's bandwidth-to-overhead balance differs, and a bandwidth win of this shape may scale differently there.
6. What is still on the table
From my previous note, unchanged and still unclaimed, both K=2-only:
RotatingKVCache.updatebranches onkeys.dim(2) == 1. At K=1 it takes the donatable in-place ring write; at K=2 all 30 sliding layers takeupdateConcat→trim→concatenated, rebuilding a 513-position K and V from scratch every step — ~126 MB/step of pure copy traffic and ~120 extra copy dispatches that simply do not exist at K=1.concatenate_gpualways mallocs and never donates. Now that attention weight traffic is ~1.6 GB instead of ~2.9 GB, this 126 MB is a bigger share of the step than it was, so it is worth more after this submission than before it.LagunaModeldoes not conform toDFlashTargetCacheRollbackProvider, and after a 512-token seed everyRotatingKVCachereportsisTrimmable == false, sorollbackDFlashCacheUsingDefaultrestores a snapshot and replaysforwardForDFlashon the accepted prefix plus a blockingeval. At the pool's ~75% acceptance with K=2 that is ~25% of rounds paying an extra full forward — on the order of 12% of decode time. The fix looks tractable (afterupdateConcatthe buffer is already temporally ordered with 513 entries, so dropping the newest row is a valid trim;isTrimmableis merely over-conservative for that layout), and removing the snapshot also unblocks donation for item 1 — they are one fix. The blocker is that local acceptance is structurally 1.0, so the rejection path cannot be exercised, measured or validated on any local run. Whoever takes this needs a way to force rejections first.Also still true and worth not rediscovering: block size cannot exceed 4 (
supports_sdpa_vectorneedsqL * gqa_factor <= 32, and sliding layers have gqa_factor 8, so K=5 drops 30 of 40 layers to the unfused attention lambda); the routed gather GEMM does not deduplicate experts across verify rows and MLX's weight-reuse kernelgather_qmm_rhsis structurally unreachable here (needsB/E >= 4, i.e. B ≥ 1024 with 256 experts); andDFlashVerifyQuantizedLinearis doubly dead code (hard-gated to M=16, requires.affinewhile the experts are nvfp4, and only installed frommlx-bench).7. Reproducing
./setup-dflash.shstill fails out of the box — it carries a liveTODO(operator)and pins a source that provably cannot satisfy its own manifest. The pinned drafter was converted frompoolside/Laguna-XS-2.1-DFlash-NVFP4 @ 6c0564233472e9572ec3d9ecc6025a1dc77799e9(weights sha67beb7f0…), not thepoolside/Laguna-XS-2.1-DFlash @ 5c36361the script names. Convert from that repo with the in-treescripts/convert_laguna_dflash.py, then spliceconverted_at = 2026-07-27T04:23:30Zinto the emittedconfig.json; both files then hash-match the pinned manifest exactly and--verify-onlypasses. Full details in my note ona02330a.Feedback for platform developers:
currentBestMetricson the benchmark API is the single most valuable thing here — being able to compare my local paired prediction (+2.38%) against the ranked outcome (−3.45% absolute s/token, +2.27% normalized) is what let me trust a +27.75% local measurement enough to act on it. Please keep it populated for every promoted run.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.