Repository navigation
serve --pm-router laya: Laya picks the expert before the PM's first round - #434
Conversation
…ore the PM's first round --pm alone leaves the expert choice to the served model (app/pm.cpp), which does not delegate on its own for a plain coding request. --pm-router laya asks the engine's existing Laya classifier (laya/route.cpp, the same scorer and the same checkpoint selection as --laya) which request class an incoming chat is, and looks that class up in the experts file's new pm.routes table (config/pm-experts.json): code -> code, long_doc -> code-heavy, prose -> reasoning, short -> the PM answers itself. A class the router is less sure of than pm.routes_min_confidence (default 0.16, the measured route policy's floor) is also left to the PM. The engine then makes the delegate call itself, as one normal tool round, so the PM composes the final answer from a real tool result; the reply's pm.routing object carries the class, the score, the router's decision time and the expert when one was chosen. The default router is unchanged, so --pm on its own behaves exactly as before; --pm-router needs --pm and takes model or laya. Tests: tests/pm_routes_test.cpp (the class -> expert table, the confidence floor, the flag values, and bad experts files), tests/pm_laya_route.sh (the real classifier plus the fake PM backend and fake Lemonade: a labelled code request routes to the table's expert and the expert's answer comes back, a labelled short request reaches no expert), tests/pm_route.sh gains the --pm-router refusals. docs/pm.md documents the flag, the table and the class names.
PR Reviewer Guide 🔍(Review updated until commit 5468076)Here are some key observations to aid the review process:
|
`ctest` runs whatever binaries the build step produced, so the new pm_routes test reported "Not Run" in CI — build/pm_routes_test was never built (the workflow lists every target a test invokes, and pm_routes_test was missing from it). Add it next to the other app/ unit tests. Reproduced from a clean build directory with the workflow's own configure line, target list and ctest: 31/31 tests passed, pm_routes among them.
|
Persistent review updated to latest commit 2b6a872 |
|
Persistent review updated to latest commit 354f42a |
|
Persistent review updated to latest commit 5468076 |
…awn_worker, census, #433) (#446) * docs: the 2026-10-17/18 merges (HRX pins, DwarfStar, PM router and spawn_worker, census, #433) The docs still described the pre-2026-10-18 line. - README status: HRX pinned to AMD e3e6a976 + llama.cpp 8d9ce2c1a with the measured gate numbers; DwarfStar pinned to 5b013dc1bb75 (1BP v5) and its hardware check; the PM gains --pm-router laya and --pm-spawn-url; the census numbers of 2026-10-17. - docs/PORTING.md: the HRX pin (step 2), the Laya source/revision bump (step 4), the 2026-10-17 census (step 5). - docs/registry.md: the 2026-10-17 census table, against registry/census.json, and the current unmapped list. - docs/hrx.md: the engine#433 finding next to the other HRX0 known issues (no abort in 60 fresh loads; the 458-token prompt cannot come from this model template). - docs/dwarfstar.md: what the 2026-10-17 pin was checked on, and that serve cannot set ds4 expert cache size. - .github/workflows/bump-hrx.yml: the loom-jit trap is now described as the step that guards it, with #441 as the validated hand move and #422 still open. Facts from merged PRs #441, #429, #438, #439, #434, #436 and the hardware comments on #441 (TPIN) and #429 (TDS4). * docs/hrx.md: the LoomC-symbol guard, which is the loom-jit trap, and #441 as the validated hand move The workflow comment that described the trap cannot be pushed with this token (no workflow scope), so the fact lives where the pin process is documented: docs/hrx.md, next to the hold. --------- Co-authored-by: pi-zayap2 <bcloud@localhost>
42b544465 hrx: the fused F16 routed-FFN decodes the table with the layout it was written with (engine#2861) (#445) cd5f6b570 hrx: revert #434's loomc builder rename, which moved the fork onto an API the pinned hrx-system predates (engine#2916) (#446) d102fbe02 test-hrx-ops: accept the HIP add-on route for a kquant-covered few-token MUL_MAT, and give the routed-MoE row its verdict (engine#2774) (#447) da1636929 hrx: a code object carries a content identity of its add-on tree (engine#2935) (#444) 3b7cbfb14 hrx: reuse the 2..8-token kquant kernel for 1-bit prefill, scoped by a measured format guard (engine#2832) (#443) a7fd21ac9 hrx: the routing layout follows the consumer, so the plan keeps one table (engine#2861) (#438) db6c8a9b3 Revert "hrx: select the existing 2..8-token kquant reuse kernel above the add-on's prefill matcher (engine#2832)" (#442) b021440f3 tests: a whole run of device cases answers 77 too, not 0 (engine#2912, the other half) (#441) f3db40313 tests: a skipped device case answers 77, not 0 (engine#2912) (#439) 1ac44fc38 hrx: select the existing 2..8-token kquant reuse kernel above the add-on's prefill matcher (engine#2832) (#440) registry/architectures.json regenerated by tools/registry_build.py; --check, --check-pins and copyright --check pass on the staged tree. hw-gate starts by itself for a pin-moving PR (engine#2759). Co-authored-by: bong-water-water-bong <[email protected]>
Adds
serve --pm-router laya. In--pmmode, the engine's Laya router now classifies the request before the PM's first round and picks the expert, instead of leaving the choice to the PM model.config/pm-experts.jsongets apm.routestable that maps a Laya class to an expert (code->code,long_doc->code-heavy,prose->reasoning,short-> none), pluspm.routes_min_confidence. Below the floor, the decision goes back to the PM.app/pm.cppvalidates the table and refuses a route that names an unlisted expert, a non-string route, a non-object table, or a floor outside 0..1. The reply carriespm.routingwith the class, score and router time.--pm-router,--pmbehaves as before (pm_routetest unchanged).Tests: new
pm_routes(unit) andpm_laya_route(needs a Laya checkpoint). Full ctest on Strix Halo: 34/34 passed.laya_classifystill passes its 95.5% gate.Live run on Strix Halo: a short arithmetic request routed to none and was answered by the PM. A coding request routed to
code(score 0.41, about 174 ms in the router), and the PM delegated to Qwen3-Coder-30B-A3B on hrx through Lemonade. A general question routed to none.Known limitation: Laya's confidence on long-form prose is low (0.09-0.23 on the labelled prose cases), so with the default floor those go back to the PM rather than to
reasoning.🤖 Generated with Claude Code