mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #5366] [Engine] Opt-in reduced expert Top-k with Top-10 normalization and idle switching #3198
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3198
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @LinneRELLa on GitHub (Nov 6, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5366
User problem
On a Ryzen 7 5700X / 64 GB DDR4 / RX 9070 XT 16 GB Windows PC, I have been trying an explicit speed/quality tradeoff for native Flash-Next IQ3_S: evaluate fewer routed experts during generation, while leaving checkpoint files and the shared expert unchanged. Restarting and reloading the model to compare full Top-10 and reduced Top-6 is inconvenient.
Would an opt-in experimental reduced expert width, initially HIP-only, be in scope? I have working prototype code and local measurements. I am asking about scope before opening a feature PR, as CONTRIBUTING.md requests.
Proposed behavior
10 <-> 6between requests, retaining loaded weights and expert caches. Allocate buffers at Top-10 capacity, rebuild width-dependent execution graphs and clear sequence state when changing mode. A subsequent request must prefill again.A startup-only option could be a smaller first PR, with idle switching in a follow-up. Public option/API names are not settled.
Prototype and evidence
Code: https://github.com/LinneRELLa/Strata/tree/proposal/flash-next-runtime-topk
Design, reproduction details and limits: https://github.com/LinneRELLa/Strata/blob/proposal/flash-next-runtime-topk/docs/experiments/FLASH_NEXT_RUNTIME_TOPK.md
Saved measurement projections and router results: https://github.com/LinneRELLa/Strata/tree/proposal/flash-next-runtime-topk/bench/results/2026-11-05-rx9070xt-topk-prototype
The prototype is based on
c62d5e3a15b40ea51c96aae9e8d36928965f53ab(engine 0.1.55), not current main. It is provided for discussion, not as a ready-to-merge patch. The local Python HTTP/controller integration used for the tests is outside this branch; the engine-side switch and arithmetic changes are included. An upstream service interface would need a separate, general implementation.Local validation
Environment: Windows, Ryzen 7 5700X, 64 GB DDR4, RX 9070 XT 16 GB (
gfx1201), HIP Release build, native ISTA-DASLab original GSQ-RCO IQ3_S, ROCm SDK clang 22 with the MSVC toolchain.Passed, on the recorded local build:
topk_reference 10 10andtopk_reference 6 10on 2026-11-06 returned zero failures and zero maximum absolute error; this rerun used the existing binary, not a new build.10 -> 6 -> 10 -> 6 -> 10, same engine PID, four checks per round: arithmetic, same-mode prefix reuse, structured tool call and execution of generated Python. Twenty checks completed.STRATA_SPEC_COST=1,STRATA_ROUTE_TAIL_SKIP=0, temperature 0, seed 8167, reasoning off. Aggregate = output tokens / decode seconds, excluding prefill and loading. Different outputs and MTP acceptance make this a small behavioral throughput comparison, not a fixed-trajectory benchmark or a general 50% speedup claim.Failed during development / quality limitations:
sink_.capfixed that observed failure before the successful five-round test.Not run: current-main build or model execution; CUDA, SYCL or Metal builds; a complete default-off byte-identity comparison of this patch; teacher-forced KL/PPL, large quality evaluations or a controlled long-context agent benchmark. HIP router parity does not establish these checks. No backend compatibility beyond the recorded Windows HIP path is claimed.
Scope and tradeoffs
The prototype is single-GPU, native IQ3_S, single-slot only. It rejects batch/pipeline/peer/multi-GPU combinations. It contains local experiment plumbing and a Windows HIP diagnostics lookup workaround that should be removed or split before any feature PR. The older startup sweep also permits reference=K, but its snapshot fingerprint is not general enough for that mode; a first upstream version could expose only reference=10.
I searched open and closed issues/PRs for Top-k, reduced activated experts, reference normalization and expert pruning. #4445 is related but asks for per-workload expert exclusion and a lower host-memory footprint. This proposal keeps every expert available and changes active compute width, so it has a different interface and goal.
Is a clearly labelled experimental mode acceptable in principle? If so, would you prefer a startup-only option first, or include idle switching and state invalidation in the initial scope? If this is intentionally outside Strata's routing contract even when explicitly enabled, I can keep the experiment in the fork.
AI assistance was used for the local implementation and this write-up. The reported observations are from saved local runs; this proposal does not claim unperformed validation or maintainer acceptance.