mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4812] [Engine] opt-in per-expert router bias from a routing profile (a graded, fixed STRATA_ROUTE_PRIOR) #2206
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#2206
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 @oisee on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4812
Area
[Engine] (speed, kernels, models, the server and API)
What do you want to do?
Run Qwen3.8-Flash-Next for one kind of work (in our case a coding agent) and hold the router to the experts that work
actually uses, by a fixed amount per expert taken from an offline profile of that work.
Today the only routing knob that steers towards a set of experts is
STRATA_ROUTE_PRIOR: one flat bonus for whateveris resident at the moment. That set moves with the adaptive tier, and the bonus is the same for an expert the workload
uses a lot and one it never uses.
The proposal:
STRATA_ROUTE_BIAS=<file.strb>, a table with one bias per (layer, expert), built offline from therouting of the user's own workload (
--dump-routingtraces, astools/collect_profile_traces.pyalready makes them).Each layer picks its top-10 by
logit + bias; the weights stay the router's, as with the prior. Kept experts get 0;cold experts get a graded negative bias by how far below the keep line they are, down to a cap. Opt-in, off by
default; unset, no kernel runs and the output is unchanged. CUDA (HIP compiles the same code); the Mac and SYCL engines
refuse the variable.
Measured on current main (
c62d5e3a+ the patch, 2 x RTX 4060 Ti 16 GB, IQ3_S), withtools/quant_quality.pyandtools/ab_engine.py:0.225.
and -9% / -1%; with different texts per arm and a few percent run-to-run spread we claim no speed change. At the
same KL the prior is faster on one card (0.5: +26%, 0.7: +25%). So this is not a speed feature: what it offers is a
fixed per-expert selection from a workload profile, independent of the adaptive tier and of the VRAM size.
cap -1 interleaved, 8 of 8 solved; no unbiased arm was run there.
It is related to #4445 (runtime expert exclusion with masks): a hard mask is the
-infcase of this table. This changedoes not touch placement or memory; it only moves the picks.
A draft PR is ready (code,
tools/make_route_bias.py, tests, docs, measurements). Is this in scope, given that theprior is faster at equal KL? If not, we keep it in our fork.
What do you do today instead?
A fork with the patch, or
STRATA_ROUTE_PRIOR.🤖 Generated with Claude Code