feat(kernel_workflow): unify entry with mode dispatch (optimize/author/bakeoff) - #383
Draft
yueliu14 wants to merge 2 commits into
Draft
feat(kernel_workflow): unify entry with mode dispatch (optimize/author/bakeoff)#383yueliu14 wants to merge 2 commits into
yueliu14 wants to merge 2 commits into
Conversation
…r/bakeoff)
kernel_workflow.js becomes a single ENTRY POINT / dispatcher; the unchanged
single-language pipeline moves to kernel_lane.js (content identical, meta.name only).
- mode=optimize|author -> pass straight through to the kernel_lane worker (backward compatible)
- mode=bakeoff -> dispatcher IS the multi-backend bake-off orchestrator (pass
args.backends, or leave empty to auto-discover):
Freeze (oracle_freezer) -> Discover (op_benchmarker: probe + OFFLINE per-backend tune) ->
parallel one kernel_lane worker per backend language over the GPU pool ->
rank ALL candidates on the SAME frozen baseline and pick the fastest.
Candidates: input-language optimize lane, each authored language, AND the tuned
env backend (aiter/CK) -- all scored against the one frozen input kernel (anti-cheating).
- new roles/oracle_freezer.md: serving-agnostic freeze of a kernel dir into an
immutable op task dir (golden output + speedup denominator = the input kernel itself).
- standalone GEMM/quant tune is preserved WITHOUT editing the e2e op_benchmarker role:
the dispatcher prompt redirects Tier-B to run offline (shapes from the frozen oracle,
engagement verified in the isolated unittest), skipping only pure server-flag levers.
- e2e footprint is limited to the kernel_workflow.js -> kernel_lane.js repoint
(e2e_workflow.js + the expert-skills identity test); no other e2e file is touched,
so nested callers hit the worker directly and the fan-out stays at one nesting level.
- README updated for the dispatcher/worker split, bake-off mode, and offline tune.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
yueliu14
force-pushed
the
feat/kernel-workflow-mode-dispatch
branch
from
July 27, 2026 09:18
0fd3fb8 to
71beac3
Compare
…rop the `auto` mode Adds scripts/test_mode_dispatch.js — 38 assertions run against the REAL kernel_workflow.js source with the Workflow runtime globals stubbed, so it spawns no agent and needs no GPU (the runtime wraps a script body in an async fn; the harness rebuilds it the same way). Covered: - mode dispatch: default -> optimize, case/whitespace normalization, empty/null fallback, unknown mode THROWS (never a silent downgrade), every arg forwarded to the worker unchanged, required-arg validation. - bake-off lane routing: the live language optimizes its existing impl while other languages follow Discover's author_plan.route (rewrite -> optimize, author -> author); explicit args.backends overrides auto-discovery; comma-string backends parse and normalize; no viable lane aborts cleanly; the winner is the fastest lane on the one frozen baseline. - documents the `planByLang[lang] || 'author'` fallback: an explicitly requested backend that Discover did not plan gets AUTHORED even if an editable impl exists. Leave args.backends empty to let Discover pick the route. Also: - `auto` was never an implemented mode (kernel_workflow.js only accepts optimize|author| bakeoff) but a stale e2e_workflow.js comment advertised `mode=bakeoff/auto`. The multi-language fan-out is spelled `bakeoff` and only `bakeoff`; a negative assertion keeps `auto` rejected. - meta.whenToUse omitted `author` entirely — the one field a caller reads to map intent to args.mode. It now describes all three modes and states plainly that there is no natural-language mode detection: the caller picks. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Collapse kernel_workflow into a single entry point with mode dispatch, and add multi-backend bake-off.
to auto-discover.
Why
Kernel-only users had no entry for "one kernel, race several languages, keep the fastest", and e2e's existing bake-off wasn't reusable standalone. A single entry is friendlier for users while leaving the
single-language worker untouched.
How it stays correct
baseline_src/ → speedups are directly comparable (anti-cheating).
is never exceeded.