Repository navigation
refactor(zoo): drop privacy-filter's unused CPU-routed MoE path - #71
Merged
Merged
Conversation
xxpopielxx
approved these changes
Oct 27, 2026
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.
Description
privacy-filter had two MoE paths. The old one read the router logits back to the CPU, picked the top 4 experts per token in JS, grouped tokens by expert and ran one matmul per expert. Nothing has called it since the GPU path (
moeUp/moeDown) landed. This PR deletes it and makes the GPU path the only one.routing.ts(routeTop4,groupByExpert,parseTopk) and the oldforward,expertMatmulandgateColumnShapeinmoeMlp.ts.EagerMoeMlp.forwardGathertoforward.model.tscalls it.The code that runs at inference is unchanged, so there is no performance change and no benchmark. Weights are unchanged: no parameter was added, removed or renamed, and
stateDictHooks.tsis untouched. The hosted f32, f16 and int8 files load as before.Prepares the privacy-filter migration in #70: one MoE path to move to the new weight format instead of two.
Introduces a breaking change?
EagerMoeMlpandrouting.tsare privacy-filter internals, not exported fromrunntime/zoo.Type of change
Testing instructions
pnpm typecheck && pnpm lint && pnpm --filter runntime test:unitpnpm --filter runntime test:gpu: same results asmain(1439 passed, 16 failures that also fail onmain).Not checked: the full hosted model end to end in the Redact demo.
Related issues
#70
Checklist