Repository navigation
Conversation
38d63aa to
ad76789
Compare
|
Thanks @Maxrio9. Running the looped schedule on the existing qwen3_5 CUDA engine, with one copy of the weights and a delta-net or KV slot per execution, is a clean way in. The plain path reads unchanged:
Before it can land:
|
ea97191 to
8f55e46
Compare
|
Thank you @Maxrio9. The rebase fixes all three apply problems: registry.zig stays at 600 with the mHC set in registry_joins, the controls file keeps both includes, and the gradient-serving pin is updated. Three things still need your side. Please post green zig and zig-b CI on the head you want landed and rerun the Qwen3.8-27B token comparison there, since the current receipt is from the older base. Please run the full unfiltered kernel contract on SM120 and tick or explain each open checklist box. Last, compare your loop_settings/mhc reader with the one in #3859 so both engines accept and refuse the same values, and tell us which reader should be shared.
|
8f55e46 to
0fc4521
Compare
0fc4521 to
c1ec096
Compare
|
Thanks, Synthena, and thanks for the rebase and re-pin. CI on The new head
|
|
I ran I checked the three conflicts against Igor Lessio - AIFLOW LABS |
c1ec096 to
c19ccfe
Compare
…e (ten blank lines fewer) Main's 0ac3062 moved deltaScan out of the engine to keep it under 600 lines, the room ashhart#3723 had made the same way, so the loop schedule's fields and set-up put cuda_engine.zig at 610. Ten blank lines between adjacent Engine members go; no code changes.
… schedule Follows main's f16f9a5 (a launch trace for unread prompt chunks), whose test builds an Engine by hand and runs forward.body: with ashhart#3723 the forward walks e.steps, so the test sets them from its geometry's schedule, one step for its one layer, as Engine.init does.
…oday's main Main re-pinned the reviewed launch sequence for its moved delta scan and MTP's retained-row tap argument (2099ef3b), and ashhart#3723 re-pinned it for its schedule-driven norm add flags (d3b1945b). The merged sequence hashes to 5a19a37c; the two comments become one line.
|
I rechecked On M5 Max with Zig 0.17.0, this passed 524 tests with 2 skips, including the host kernel contract that contains the CUDA 13.4 registry lookup that failed before the join fix: zig build test-qwen35-loop-host test-qwen35-loop-refusal-host test-gradient-serving test-kernel-contract -Dcpu=apple_m1 -j4 --summary allThe full SM120 device contract and Qwen3.8-27B token comparison are still separate release checks. Igor Lessio - AIFLOW LABS |
c19ccfe to
55bf14d
Compare
…e (ten blank lines fewer) Main's 0ac3062 moved deltaScan out of the engine to keep it under 600 lines, the room ashhart#3723 had made the same way, so the loop schedule's fields and set-up put cuda_engine.zig at 610. Ten blank lines between adjacent Engine members go; no code changes.
… schedule Follows main's f16f9a5 (a launch trace for unread prompt chunks), whose test builds an Engine by hand and runs forward.body: with ashhart#3723 the forward walks e.steps, so the test sets them from its geometry's schedule, one step for its one layer, as Engine.init does.
…oday's main Main re-pinned the reviewed launch sequence for its moved delta scan and MTP's retained-row tap argument (2099ef3b), and ashhart#3723 re-pinned it for its schedule-driven norm add flags (d3b1945b). The merged sequence hashes to 29de8240; the two comments become one line.
…nsenova_loop Physical layers keep one weight copy; each execution owns its delta-net or KV slot (42 + 14 for SenseNova-Loop-9B). Plain Qwen checkpoints get the identity schedule. Drafting, learning, pockets and stages are refused for loop models. Refs ashhart#3717
… leave) with host reference and contract cases Refs ashhart#3717
Route, plain norm, mixer, merge around both halves of layers 4..27; streams enter at each pass's first layer and leave at its last. FP32 dt_bias rounds to BF16 at load, as the reference holds it. Execution counts are cached in the geometry. Refs ashhart#3717
…the reviewed launch sequence qwen35_learn and the qwen35 GPU test mains pass null loops. kernels.zig registers the qwen35_mhc image. The launch sequence's three norm add flags come from the schedule's decision, main's values on the plain schedule.
Other backends decide their own drafting for this model type.
…iterations and pre_scale Accept loop_settings.use_gate absent or false, ignore unknown loop_settings keys, and no longer require layer_types. Streams 4 parses but is refused at admission, as are fixed_identity and more than 1000 iterations. The route kernel takes the Sinkhorn iteration count and pre_scale (defaults 20 and 1.0, the default path unchanged). A shared case table, zig/tests/fixtures/sensenova_loop_config.json, runs through the CUDA reader and admission.
…al does The route kernel takes pre_scale as an f32. A positive f64 such as 1e-50 passed the reader and the finite check, then ran as 0. Admission now refuses it with UnsupportedSenseNovaMhc, matching ashhart#3859's reader. Two fixture cases: 1e-30 (a normal f32) accepts, 1e-50 is refused at admission.
Follows main's 0ac3062, which moved deltaScan into cuda_forward.zig to keep the engine under 600 lines: the engine keeps that one, and cuda_delta_scan.zig, the same helper moved for the same reason, goes.
…e (ten blank lines fewer) Main's 0ac3062 moved deltaScan out of the engine to keep it under 600 lines, the room ashhart#3723 had made the same way, so the loop schedule's fields and set-up put cuda_engine.zig at 610. Ten blank lines between adjacent Engine members go; no code changes.
… schedule Follows main's f16f9a5 (a launch trace for unread prompt chunks), whose test builds an Engine by hand and runs forward.body: with ashhart#3723 the forward walks e.steps, so the test sets them from its geometry's schedule, one step for its one layer, as Engine.init does.
… blank lines fewer) Main's fceb497 (keep the main scan owner and both prompt fixture lifetimes) left cuda_engine.zig at 600 lines; with the loop schedule and the earlier ten blank lines out, it stood at 604. Four more blank lines between adjacent Engine members go; no code changes.
…oday's main Main re-pinned the reviewed launch sequence for its moved delta scan and MTP's retained-row tap argument (2099ef3b), and ashhart#3723 re-pinned it for its schedule-driven norm add flags (d3b1945b). The merged sequence hashes to 29de8240; the two comments become one line.
55bf14d to
79d1cee
Compare
|
Thanks for the careful work on the shared Qwen engine and for addressing the earlier registry, controls, serving-pin and I found three remaining issues:
|
|
sm_120 kernel-contract run on the RTX 5060 Ti (jw16, boot fc0f7ff9) at head 79d1cee, SUMMARY 9 kernels: 9 pass gates 1-4, 0 fail, 0 known findings; 4 controls: 4 red as planted, 0 missed; 4 limit problems — the new
|
|
Thanks @Maxrio9, and @joshuaswarren for the focused check. The numerical gates and all four controls pass in that result, but the four compiler 13.0 limit records remain unqualified. The three source requests are still open: forward both host-KV admission hooks, forward the three snapshot-spare hooks and include the loop entry in their regression, and include mHC calls in the launch fingerprint before re-pinning it. Please retain compiler-specific measurements rather than using the 13.4 records for 13.0. The current-main list, fixture and source-pin merges remain ours.
|
Greedy output matches the vLLM reference token for token on 10 of 11 public prompts; the 11th diverges only at an exact reference tie. Concurrent equals solo (greedy and sampled), the chat template and tool calls match HF, and Qwen3.8-27B is unchanged against
mainin tokens and speed (see Receipt).What this changes
SenseNova-Loop-9B (
model_type: sensenova_loop), a looped Qwen3.5-style hybrid, runs on the qwen3_5 CUDA engine in plain BF16, text only:pre_scalecome from the config (release values 20 and 1.0).Plain Qwen checkpoints get the identity schedule.
11a0de0cfatc overlap --json(ATC 0.9.6) on the pre-rebase headea9719156reported no PR conflicts but was not complete (otherPullRequestsLimit,pullFilesUnavailable,timeLimit). I closed the gap by hand with the same test ATC runs:git merge-treeagainst all 191 open PRs that share a file with it (or list more than 100 files), counting only files that conflict with this head and not with main.registry.zig,registry_joins.zig,contract_controls_set.cu,gradient-serving.tsv,profile.zig,cuda_families.zig,cuda_refusal.zig, the build host lists): whichever lands second keeps both entries.TF_QWEN35_CHUNK_SOLO=8192, solo prompt passes for Qwen 3.5/3.6/3.8 #3294, qwen3_5 cuda: a prompt chunk nothing reads stops its last layer at its keys #3060, qwen35: dense BF16 loading and native prompt logprobs #2020 and Qwen3.5-family CUDA: enable dense MTP drafting #3582 conflict in 1 or 2 short hunks each, where this PR's layer loop walkse.stepsinstead ofe.layersandEngine.inittakesloops.dense_serving_test.zig, so whichever of the two lands second recomputes that hash.Commits
80c95606eexecution schedule and per-execution state slots forsensenova_loop09971de2atwo-stream mHC kernels (enter, route, merge, leave) with host reference and contract casese240669bdtwo-stream mHC in thesensenova_loopforward653af6c9fread-cost test passes finish's pending flage547b3515Engine.initcallers passloops; re-pinkernels.zigand the reviewed launch sequence18adcc42aserver refuses--drafterforsensenova_looponly on CUDA17dd3af00config rules shared with Metal; any mHC iterations andpre_scaleb254e74f1register nvcc 13.4 contract recordsc1ec09679refusepre_scalethat rounds to f32 zeroDone on this head
loop_settingsandmhcare read from the config root and validated as the referenceexecution_plandoes. The schedule carries per-execution delta and attention slots and mHC boundary flags, and--loops 1..4overrides the trained count.loop_settings.use_gateis accepted when absent orfalse;trueis refused, sinceloop_gateisn't loaded.loop_settingskeys are ignored, as the reference does; unknownmhckeys are refused.layer_typesis optional and falls back tofull_attention_interval, as for plain Qwen3.5.mhc.streamsmay be 2 or 4; 4 streams andfixed_identity: trueare refused at admission (UnsupportedSenseNovaMhc).iterationsfrom 1 to 1000 and any finitepre_scale > 0that stays finite and positive in f32 run: both are route-kernel arguments, and the release values take the same path as before.zig/tests/fixtures/sensenova_loop_config.jsonholds 87 cases (30 accept, 52 refused by the reader, 5 refused at admission). They run through the CUDA reader and admission intest-qwen35-loop-hostandtest-cuda-host.lm_head. FP32 routers are uploaded once per physical layer. The vision tower,loop_gateand MTP are skipped and left out of byte accounting.servedefaults to plain decoding.qwen35_mhc.cuwith a CPU reference, a contract runner case per kernel at rows 1–512 (including a 3-iteration route and apre_scale1.75 route), planted controls and launch records.dt_bias: the checkpoint's FP32dt_biasis rounded to BF16 (RNE) at load. vLLM holds it as a BF16 parameter and HF casts it to BF16, so both references compute with the rounded value.A_logstays FP32.Not done
Checks on this head
c1ec09679on main11a0de0cf. It is the previous headf70b5ca6a(ondffe42485) rebased; the only conflicts were three lines where main renamedmax_rowstogrid_rows, added thelivingimport, and addedcontract_embed_controls.cuhnext tocontract_mhc_controls.cuh.11a0de0cf, the host suite and the build. Ran on the previous head (same PR code, maindffe42485): teacher-forced KL, long context, Qwen3.8-27B at 4 streams, and the full kernel contract.c1ec09679: all 9 jobs pass, includingzig,zig-bandzig-windows.11a0de0cf.zig fmt --check,test-kernel-contract,test-gradient-serving,test-qwen-serving-host,test-qwen35-loop-hostandtest-qwen35-loop-refusal-hostpass.zig build native -Dnvcc=<nvcc 13.4> -Dsm=120 -Dnative-fp-decode=truepasses.Receipt
c1ec09679(this head) andc6415563d(the previous head's tree, ondffe42485) where marked, Zig 0.17.0, nvcc 13.4.sensenova/SenseNova-Loop-9Bat revision329a65f7(Apache-2.0).86014ad4), BF16 weights, BF16 KV, greedy, prefix caching off./v1/completions.--context 8192 --parallel 1 --prompt-cache-gib 0.0.32.0rc1.dev100+g77154ca61with [Model] Add SenseNova Loop support vllm-project/vllm#64832, BF16 weights and KV, prefix caching off; reference top-64 plus tail, 219 held-out rows across 6 categories and 94,235 scored positions.qwen35-cuda windowtool and BF16 KV; the server does not report logprobs for this backend. Tool equivalence to server prefill has not been measured.bench_concurrent.py --alone --serial,--context 8192 --parallel 4, 256 tokens, code and chat prompts):--context 16384 --parallel 1. With the prompt cache on, turn 1 keeps one 309 MiB state at 4096 (all 42 delta-net and 14 KV slots), and turn 2 resumes there (cached_tokens4096). Both turns match a server with--prompt-cache-gib 0exactly. A repeated raw-token completion keeps no state, as with every qwen3_5 model: the planned cache only marks chat history boundaries on its 4096-token grid.bench_openai.py, greedy, 256 tokens, no drafts): 25.9 tok/s at one stream on both prompts; about 100 tok/s aggregate (25.2 per stream) at 4 streams.bench_cache.py --require-cold,--prompt-cache-gib 0): median of 4: 0.75 s at 2048 tokens, 3.06 s at 8192, 13.1 s at 32768 (13.0 on the previous head).--context 135168 --parallel 1 --prompt-cache-gib 0, BF16 KV; FP8 KV is refused for this model type): cold TTFT (median of 3 boots) 12.9 s at 32768 tokens, 28.1 s at 65536 and 64.4 s at 131072; decode right after the prompt 24.3, 22.9 and 20.7 tok/s; peak GPU memory 25.7 GB. At--context 229376the model still loads on the 32 GB card: a 221,184-token prompt takes 126.7 s to first token, decodes at 17.9 tok/s and peaks at 30.9 GB.apply_chat_templatefor plain (18), system plus multi-turn (39), thinking on (20), tools (300) and tool result (334). The tools case returnsget_weatherwith{"city":"Berlin"}, and thinking on returns separate reasoning.--context 32768, runs alternated main/head/main/head, main11a0de0cf):bench_concurrent --alone --serialis equal on main and head.--parallel 4on the previous head against maindffe42485(aggregate tok/s, 6 samples per side): greedy code 438.7 / 438.4 (p=0.53), chat 318.7 / 323.6 (p=0.064); sampled code 456.8 / 457.3 (p=0.79), chat 294.3 / 289.9 (p=0.30). Greedy tokens are identical at both widths, and concurrent equals alone.Kernel contract
qwen35_mhc_enter,qwen35_mhc_route,qwen35_mhc_mergeandqwen35_mhc_leave, all new; none replaces an existing kernel.contract_mhc_controls.cuh). All four are red as planted.c6415563d, SM120, nvcc 13.4,zig build kernel-contract -Dsm=120): 719 kernels pass gates 1–4, 0 fail; 433 controls red as planted, 0 missed; 8 known findings and 597 limit problems. Main81de26f64has 710 kernels pass, 429 controls red, the same 8 known findings and 577 limit problems. The live per-launch limit problem set is identical; the extra 20 are static “no compiled usage recorded” entries for 4 new mHC kernels across 5 SMs, of the same kind as 183 on main. Both runs fail on limits.Checklist
loop_schedule_test,loop_geometry_test,cuda_mhc_test, themhc_reftests, theqwen35_loop_config_hostcase table and thecontract_mhccases fail: main has no loop schedule, mHC kernels orsensenova_loopreader. The host tests need no GPU; the contract cases run only underkernel-contract."draft": false(drafts are refused for this model type), a resumed prompt equals a fresh one, and concurrent equals solo.dt_biasto BF16, which is what both references compute with; the Sinkhorn runs in FP32.--drafter, no slower than without it, greedy and sampled. Qwen3.8-27B decode is level with main (Receipt). This model has no main baseline, and--drafteris refused for it.