Skip to content

Document current deferred GDN replay and retire stale RFC scaffolding - #198

Closed
linson007 wants to merge 4 commits into
incoai:mainfrom
linson007:rfc/190-deferred-gdn
Closed

linson007 wants to merge 4 commits into
incoai:mainfrom
linson007:rfc/190-deferred-gdn

Conversation

@linson007

@linson007 linson007 commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Feasibility review completed on 2026-10-23 against current main 3135ab45b3da525a8a2dbb8a1aa72ce095dda8a9.

Closing this PR because its original optimization is already implemented by 48a94aaa. Main folds the previous step's retained GDN rows into the next fused decode, reads/writes the recurrent state once per step, and has removed the standalone commit dispatch. The current PR adds only docs/rfc/190-deferred-gdn.md; its runtime, developer tools/tests, build file, server and installer trees are identical to its merge base. It therefore offers no incremental runtime performance improvement.

The original scaffold is not a candidate to restore: it counted discarded rows (proposed - accepted) instead of the retained prefix including the anchor. In the shipped implementation, even full retention leaves eight pending rows because the stored state precedes the current step. Marking it built or skipping those rows would violate the state/tape contract.

Fresh local validation on Apple M5 Pro (20 GPU cores, 48 GB), macOS 26.6:

  • Built current main in an isolated checkout.
  • gdn-decode, gdn-metal and qwen-state-storage all pass with MTL_SHADER_VALIDATION=1, covering the existing recurrence, pending replay, batch changes and FP32/BF16 state paths.
  • decode-profile completes for Qwen3.8-27B MLX 4-bit, INT8 KV, FP32 state, 2,048 prompt tokens, four cycles per width at B1-B4, without shader validation. It reports 48 verify_gdn_fused dispatches per decode cycle and no verify_gdn_commit. This is baseline attribution, not a new A/B speedup result.

Further GDN arithmetic pruning would be a separate optimization. The existing experiment #511 already records passing correctness but no serving gain above its noise-adjusted promotion gate on this machine; that historical evidence was reviewed, not rerun here. This review does not establish that every possible GDN optimization is exhausted. No additional implementation or replacement PR is justified within #198's scope. Issue #190 is left unchanged.

Upstream issue incoai#190. Default off, no behavior change.
ReplayState/DeferredReplay/onVerify with static_asserts. No new
.metal: verify_gdn_fused* is the existing resolve target.

Upstream issue incoai#190, PR incoai#198.
@linson007 linson007 changed the title rfc/190: deferred GDN replay scaffolding Document current deferred GDN replay and retire stale RFC scaffolding Oct 21, 2026
@linson007
linson007 force-pushed the rfc/190-deferred-gdn branch from a7ddcdd to 2159f78 Compare October 21, 2026 18:16
@linson007 linson007 closed this Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant