ggml-cuda : reuse routing IDs across MoE siblings - #42
Draft
GenerelSchwerz wants to merge 1 commit into
Draft
Conversation
Assisted-by: Codex
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.
Overview
Reuse routing IDs on the host across recognized sibling MoE matrix calls. The state is thread-local and bounded to one FFN consumer group, so later ubatches and graph executions cannot inherit a completed entry.
This draft is stacked on draft #41. Commit
0c5347236is the routing-ID change; after #41 lands, this PR will contain only that commit.Additional information
The implementation classifies generic gate, up, fused gate_up, and down tensor names. It supports gate/up in either order followed by down, fused gate_up followed by down, and ungated up followed by down. Reuse requires an identified layer and an exact device, data pointer, byte size, four-dimensional shape, and stride match. A mismatch, repeated kind, unknown kind, unknown layer, or down completion clears the pending state and falls back to a fresh device-to-host copy.
ABBA prompt throughput against
d39804ac1, with identical-ngl all -fit offplacement:At the high-slot points, prefill IDs synchronization fell from 2280 to 760 at 8K and from 7920 to 2640 at 32K. The low-slot fallback path also passed with 1914/2280 staged operations at 8K and 7305/7920 at 32K. Existing staged-path telemetry omits its IDs counters, so the reported low-slot synchronization counts cover only non-staged operations.
Correctness and lifecycle checks:
d39804ac1:1.0020 +/- 0.00013on both builds.d39804ac1:2.2860 +/- 0.10226on both builds.d39804ac1at 8K and 32K. SHA-256 hashes are28cff857cb93fc95031a77dbb01c6181916f3e23e45ff790836c42de132c79b7and20ddc55840791153b6f91d2ccf3b311e6651789efaf0c4387746dd0b7dda0c9d.CUDA_MoE_Cached,is_cached=1, with nonzero misses and evictions at both contexts.dbeb350d1PPL is1.0018 +/- 0.00011frozen and2.2851 +/- 0.10242varied. The candidate changes are 1.17 and 0.006 combined standard errors respectively. Its deterministic difference from dbeb is inherited from ggml-cuda : enable MMQ for cached MoE dispatch #41; this commit is byte-identical to ggml-cuda : enable MMQ for cached MoE dispatch #41 at both contexts.test-moe-cachepassed under the shared GPU lock, and all server lifecycles exited cleanly.Requirements