Skip to content

qwen3-asr: host slice, the shared tower and Qwen3 schedules over a backend binding (#2105) - #2239

Merged
ashhart merged 28 commits into
ashhart:mainfrom
jschmied:qwen3-asr
Nov 22, 2026
Merged

ashhart merged 28 commits into
ashhart:mainfrom
jschmied:qwen3-asr

Conversation

@jschmied

@jschmied jschmied commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Refs #2105. Rebased on main 6d0a128b0 (with #2285 and #2995); head 3689e0113. The agreed gate on 40 fresh clips
(6928895212) passes on 7e9b99f2a, with every per-clip line identical to the 2fe5b72d9 run (below). The earlier
gate's cut50 step-3 fail stays on record.

Runs on 7e9b99f2a (3689e0113 only re-pins prefill_attention.cu in dense_serving_test.zig): gate 2, --rows 8 decode and two-pass equalities, the contract set, the embedding bytes against
main, and every check. Sections marked 51dc03072 are history from earlier rounds; the code they cover is unchanged
except where this round says otherwise.

The first slice of #2105: the family's host parts, a tower schedule shared by every backend, a Qwen3 decoder schedule
for the host reference and the Metal and XPU bindings, and the CUDA path, measured on a GB10. It doesn't touch the
server and doesn't depend on #1632.

It reads the checkpoint's Qwen2 slow-tokenizer export through #2225, now on main, because the checkpoint ships no
tokenizer.json.

Shape

  • families/qwen3_asr/ (host, any OS):
    • config admission (0.6B and 1.7B) and the tensor map by name;
    • the log-mel rows, PCM decode, and the chunk and window plan;
    • a float64 tower reference;
    • tower.zig and lm.zig: the schedules, generic over a binding r. They never import a backend.
  • schedule_test.zig runs both schedules on a host binding. The tower must match the float64 reference at torch's
    bf16 points (global attention fails it), and every LM op must stay inside its buffers.
  • families/qwen3_asr/cuda/: a device store, the tower over vit.cu's LayerNorm, pointwise and cuBLASLt Linear
    kernels, and model.zig, which runs the language model through qwen3 cuda: Qwen3 embedding checkpoints (BF16) on the native CUDA engine (#2261, 1 of 2) #2285's Qwen3 pass (next section).

One Qwen3 layer path on CUDA: #2285's pass

  • qwen3/cuda/lm.zig gains forwardFrom(…, trunk, ends, Extra) (:354). Extra (:200) holds:
    • start: the at the input's rows stand from. attention has one start position, qwen3 cuda: Qwen3 reranker checkpoints (BF16) on the native CUDA engine (#2261, 2 of 2) #2995's at (:447, positions
      a.pos + 4 * (at + p) at :470); the inputs take x.start + trunk (:431);
    • cache: every layer's own k and v caches in place of the scratch's one;
    • splice: rows copied over the embedded ones, cut to the pass;
    • head: the final norm over the pass's last rows and the tied head on the device, as one more pinned (vocab,
      hidden) plan that only ASR prepares;
    • tap: stage reads for tf-qwen3-asr's stage compare.
  • Each field is read only when set. forward(…, trunk, ends) keeps main's signature and is
    forwardFrom(…, trunk, ends, .{}) (:349-350): the same launches with the same arguments.
  • lm.admit (:210) refuses a start or head on more than one input, beside a trunk or without its caches, a head
    over no rows or more rows than the pass, and positions past the caches, before any launch. Its test (:218) names
    each refusal, and main's reranker call (a trunk, .{}) passes. With the cache check planted out (r5) it went red
    (18/19), and green again (19/19) with it back.
  • Shared, not copied: weights.Model.fromCheckpoint (weights.zig:48) loads the ASR checkpoint's Qwen3 under its
    thinker.model. scope. It takes the head's stored name: fromDir passes names.headKey as main does, and ASR
    passes thinker.model.embed_tokens.weight, the table its tied head reads (qwen3_asr/cuda/model.zig:73-74). The position and RoPE uploads moved from the engine into lm.tables (lm.zig:127), which
    both call (engine.zig:75). qwen3/pass_cuda.zig is the small module root the ASR tools import.
  • Gone: qwen3_asr/cuda/lm.zig (our binding of the schedule on CUDA) and tf-qwen3-asr-forced --row-gemms.
  • ASR now uses qwen3 cuda: Qwen3 embedding checkpoints (BF16) on the native CUDA engine (#2261, 1 of 2) #2285's numeric points: fp32 norm weights and its fp32 RoPE table. Before, it used bf16-rounded ones.
  • The host schedule (qwen3_asr/lm.zig) stays in the family for now. It moves to families/qwen3/schedule.zig with
    the Metal and XPU bindings (qwen3-asr: the Metal binding (#2105, stacked on #2239) #2254, qwen3-asr: the XPU binding on Gen12LP (#2105, stacked on #2239) #2255), its only other users.

Provenance

The family was written from TensorFold's code, the checkpoint's config files, and the publisher's reference package
qwen-asr 0.0.6. From that package I read the transformers-backend modeling and processor, the inference wrapper, and a
search of its vLLM-backend file for the attention windows. The log-mel front end was checked against transformers'
WhisperFeatureExtractor source, which the package calls. No code was copied from any of them.

Gate 2 (agreed in 6928895212): 40 fresh clips against the package's fp32 run, on 7e9b99f2a

  • Clips: LibriSpeech test-clean speakers 1320-3729 (utterances 0000 and 0001), and FLEURS cmn_hans_cn test
    sentence ids 21-40. All 40 SHA-256 values were posted before the run and matched it (40 of 40).
  • Run: tf-qwen3-asr-forced md5 950aee2f16035e735026e0bab9b0e856 on 7e9b99f2a. All 160 runs' FORCED,
    SWAP, DIST and SUMMARY lines are byte-identical to the 2fe5b72d9 run (md5 063522d4…). Each clip is teacher-forced on the package's
    fp32 greedy ids (qwen-asr 0.0.6, vLLM windows). A step whose top token differs from fp32's is listed, and it passes
    only as a swap of the same two tokens with both margins at most 0.25.
  • 0.6B: 40 of 40 pass. 1,342 steps, 3 swaps, 0 fails. Each swap lists ours (margin), then fp32 (margin):
    • 1320-122612-0001 step 31: 13 (0.000), then 979 (0.0929).
    • 2094-142345-0001 step 22: 13 (0.000), then 26 (0.0530).
    • 2961-960-0000 step 38: 11 (0.000), then 1558 (0.1606).
  • 1.7B: 40 of 40 pass. 1,345 steps, none listed.
  • Distance to fp32 over the set, as worst column / mean:
    • 0.6B: ours 1.974 / 0.08277, the package's bf16 2.077 / 0.09519.
    • 1.7B: ours 1.399 / 0.06867, the package's bf16 1.439 / 0.07566.
  • Planted --plant norms: fails 40 of 40 clips on 0.6B (970 steps) and 37 of 40 on 1.7B (526 steps), with exit 1.

Gate: the tie rule (as on #2648), teacher-forced against qwen-asr 0.0.6, on 51dc03072

  • Reference: the transformers backend with the vLLM backend's attention windows applied.
  • Clips: the 40 public gate clips (LibriSpeech test-clean 20, FLEURS cmn_hans_cn test 20, both CC BY 4.0), a 50-
    and a 99-frame cut, and 3 LibriSpeech dev clips. That's 45 per checkpoint.
  • tf-qwen3-asr-forced runs each clip on the reference's greedy ids to the end. A step whose top token differs
    passes only if the two tokens swap places and both margins are at most 0.25 logit. Every such step is listed, and
    anything else fails with exit 1.
  • 1.7B: 45 of 45 pass. Swaps: 1272-128104-0004 step 11 (ours 3138 at 0.25, the reference's 705 at 0.000),
    cut99 step 7 (13 at 0.000, 30 at 0.125), cmn-10369927130798325266 step 19 (3837 at 0.000, 67338 at 0.25),
    cmn-15324743446256875074 step 23 (17 at 0.25, 40820 at 0.25).
  • 0.6B: 43 of 45 pass, one listed exception, one new fail.
    • Swaps: 1272-128104-0004 step 11 (705 at 0.125, 11 at 0.000); cmn-10104380129516909856 step 27 (3837 at
      0.25, 1773 at 0.000).

    • Listed exception (agreed on review, unchanged): cmn-15324743446256875074 step 10. Ours is 468 (margin 0.125).
      The bf16 reference picks 9197 (margin 0.25), with 468 third. The package's fp32 run picks 468, at 25.7277 against
      9197's 25.7162.

    • Open fail, cut50 step 3: ours is 5632 with margin 0.625 over 18284. The reference case picks 18284 at
      0.125. The package's own teacher-forced logits on this clip disagree with that case: its bf16 run puts 5632 first
      (22.75 against 22.625) and its fp32 run puts 18284 first (22.7922 against 22.5113). With the bf16-rounded norms
      (r4) this step was a swap at 0.25; qwen3 cuda: Qwen3 embedding checkpoints (BF16) on the native CUDA engine (#2261, 1 of 2) #2285's fp32 norms move it to 0.625.

    • The rule for listing a step (review, 6826729645): the package's bf16 and fp32 runs order the two tokens oppositely,
      and either our pick is the fp32 pick or our fp32 distance on that clip is no worse than the package's bf16. Step
      10 meets it. cut50 step 3 meets the first part, and the whole clip is closer to fp32 than bf16 is, but step 3
      alone is not (0.667 / 0.1191 against 0.536 / 0.0843, table below; our worst column there is 18284 itself). So it
      is not listed, and this stays draft.

    • Stage compare at step 3 against the package's fp32 run: the tower is level with bf16. Through LM layer 20 our
      mean is at or below bf16's. From lm_layer21 both columns are above it, and 18284's lead (a logit lens through
      the final norm and head rows) falls further behind fp32 over layers 21-27. At the head the lead is -0.625 for
      ours, -0.125 for bf16 and +0.281 for fp32: the gap builds up, with no single stage out of line.
      The prompt is extended by the forced ids of steps 0-2. LM rows are at step 3's row; worst column / mean |diff|
      to fp32; the lead is 18284 minus 5632 through the lens:

      stage ours vs fp32 bf16 vs fp32 lead: ours / bf16 / fp32
      lm_layer17 0.073 / 0.0135 0.089 / 0.0184 -0.053 / +0.024 / +0.130
      lm_layer18 0.088 / 0.0184 0.211 / 0.0266 +2.293 / +2.437 / +2.474
      lm_layer19 0.152 / 0.0268 0.266 / 0.0343 +2.940 / +3.208 / +3.294
      lm_layer20 0.298 / 0.0451 0.327 / 0.0485 +3.459 / +3.627 / +3.863
      lm_layer21 0.860 / 0.0750 0.431 / 0.0693 +1.224 / +1.509 / +1.843
      lm_layer22 0.655 / 0.0973 0.655 / 0.0859 +2.447 / +2.654 / +2.979
      lm_layer23 0.748 / 0.1380 0.982 / 0.1084 +4.229 / +4.562 / +5.006
      lm_layer24 0.954 / 0.1681 1.353 / 0.1325 +3.658 / +3.947 / +4.361
      lm_layer25 0.993 / 0.2126 1.489 / 0.1653 +3.348 / +3.958 / +4.282
      lm_layer26 1.050 / 0.2264 1.173 / 0.1923 -0.188 / +0.322 / +0.629
      lm_layer27 1.571 / 0.2507 1.194 / 0.2238 -0.637 / -0.045 / +0.281
      lm_norm 1.957 / 0.1094 1.493 / 0.0960

      On review (6840111036) this reads as bf16 precision on a two-step tie, not a defect. The fail stands, and a new
      gate on fresh clips was agreed before any run, and it passes (Gate 2 above).

  • Planted: q_norm and k_norm swapped in every layer fails 11 steps (0.6B) and 2 (1.7B), with exit 1. The audio
    rows one position late move no top token, but they raise the worst fp32 distance to 14.26 / 7.68.

Distance to the package's fp32 run, on 51dc03072

At the final logits, teacher-forced on the package's greedy ids. Each cell is worst column / mean |diff|:

checkpoint dev clip ours package bf16
0.6B 0000 0.777 / 0.0963 1.428 / 0.1023
0.6B 0001 0.795 / 0.0873 1.040 / 0.0989
0.6B 0004 0.807 / 0.0835 0.873 / 0.0911
1.7B 0000 0.757 / 0.0683 0.663 / 0.0734
1.7B 0001 0.611 / 0.0684 0.707 / 0.0733
1.7B 0004 0.805 / 0.0868 0.980 / 0.0819
0.6B cut50, 9 steps 0.667 / 0.0867 0.938 / 0.1226
0.6B cut50, step 3 alone 0.667 / 0.1191 0.536 / 0.0843

On #2285's pass, our mean distance is below the package's bf16 run in 5 of 6 dev cells. The worst column is below it
in 5. On cut50 the whole clip is below it in both; step 3 alone is above it in both.

cut50 step 3 alone: the same clip and tool, with the case's prompt extended by the forced ids of steps 0-2. As a
check, the step 0-2 and step 0-3 slices give the same step-3 mean by difference (0.1191 ours, 0.0843 bf16).
In r4 the 0.6B means were 0.133 / 0.102 / 0.085.

Decode against prompt, two passes against one, on 7e9b99f2a

  • CUDA (tf-qwen3-asr-forced --rows 8, no other flag): the prompt pass's last 9 rows equal the 9 decode steps bit
    for bit. A prompt split in two passes inside the audio rows leaves 0 cache values different and the same last logits.
    That holds on all six dev runs (0.6B and 1.7B, three clips each), because gemm.zig keeps one algorithm per (n, k)
    at every row count.
  • Host (lm_test.zig): the same two equalities, and a planted cache-slot fault fails them.

Embedding bytes against main

Qwen3-Embedding-0.6B (the size on the GB10 now), main 6d0a128b0 against 7e9b99f2a, each built with
zig build native -Dnvcc and served with serve --context 32768: the sha256 of every returned fp32 vector matches
main's (the 4 card texts alone and together, and seeded inputs of 2048, 8192, 16384 and 30000 ids, 9 of 9 requests).
They also equal 51dc03072's. The batches over 32768 tokens are refused by name on both builds. Not run: 4B, 8B and
the Qwen3-Reranker checkpoints (not on disk). The rerankers reach forwardFrom with a trunk and .{}, the call
admit's test passes.

Earlier (r5, 51dc03072 against 000b534a2): every vector byte-equal in 0.6B, 4B and 8B, and the card texts equal
Arminova's 4257e6f01 hashes.

Kernels

  • New kernels:
    • tf_vit_conv_cols: 3x3 stride-2 conv taps, channels last;
    • tf_vit_conv_flatten: torch's [c, f] rows;
    • a vision_kernel<64, 8> instance for windowed attention at head dim 64.
  • In kernel-contract's family sets; alone, tf-cuda-test kernel-contract tf_vit_conv qwen3-asr (on 7e9b99f2a):
    all 3 kernels pass gates 1-4, and both planted controls (one per copy kernel) are caught. zig/tests/cuda/main.zig
    is main's (600 lines).
    These kernels compile to the same SASS on this head (below).
  • Usage records for nvcc 13.0 on sm_80/86/89/120/121. Under nvcc 13.2, vision_kernel<64, 8> takes 128 registers
    on sm_120/121 instead of 120 and has its own record; the two copies compile the same.

Checks

  • Rebased on main 6d0a128b0. Conflicts: contract_controls_set.cu keeps main's contract_experts_bf16_controls.cuh
    and ours; qwen3_cuda.zig keeps _ = native; and _ = pass;; lm.zig and weights.zig as above; CHANGELOG.

  • vit.cu and prefill_attention.cu are byte-identical to 2fe5b72d9's, and main hasn't changed them since
    000b534a2, so the SASS comparison below still holds.

  • vit.cu and prefill_attention.cu at nvcc 13.0.88, main against this head, sm_80/86/89/120/121 (after main's
    two-query-heads change):

    • vit.cu: 55 of 55 records identical in res-usage and SASS;
    • prefill_attention.cu: 70 of 70;
    • only the three new functions are added.
  • Checks: on the GB10, every check exits 0 (on 7e9b99f2a, the code of 3689e0113 but one test pin): git diff --check,
    zig fmt --check, cuda_common_check, lean (221 against 221 on the base, 0 new), pr_check, zig build test,
    test-cuda-host, test-qwen3-asr-host, tf-qwen3-asr and tf-qwen3-asr-forced, test-qwen3-cuda-host,
    test-qwen3-checks-host, qwen3-cuda-gpu-build, the CI set (test-kernel-contract, test-golden, test-server-security,
    test-pull-security, fuzz-cortheon), compile-cuda-tests for aarch64 and x86_64, check-release-paths and
    test-gradient-serving. The x86 host set found one pin of ours: dense_serving_test.zig pins
    prefill_attention.cu's bytes. 3689e0113 re-pins it, in the re-pin commit, with a line naming the added
    vision_kernel<64, 8>, and test-qwen-serving-host is green. The x86 host set on 3689e0113 (-Dfixed-cpu test test-host test-golden test-kernel-contract test-server-security test-pull-security fuzz-cortheon check-release-paths, then check-native-cuda-host compile-cuda-tests, pr_check and zig fmt) passes except one test: cli_config_test's "serve --config: expand
    reads the file…" fails there because the CI user's umask is 0002. Its serve.toml is written 0664, and expand
    refuses a group-writable file. It passes on the GB10 (umask 0022), and this PR doesn't touch the server.

  • Seeded sampling and concurrency don't apply yet: nothing here is served (no lane until Nemotron 3.5 Transcribe: audio input, the 65,536-token window, an hour of audio, MTP drafts #1632), and the tools are
    greedy on one stream. Resume is the two-pass split above (caches and logits bit-equal to one pass).

Proposed CHANGELOG line (Unreleased; the commit you asked for is 3689e0113): Qwen3-ASR 0.6B and 1.7B on CUDA: the audio tower and greedy decode, the language model through the Qwen3 CUDA pass (#2239).

Next

The served path (a qwen3_asr CUDA lane backend) waits for #1632. WER/CER, throughput and the 1.7B's eval follow.

@jschmied

jschmied commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Ready for review. #2225 has landed, so I rebased onto main 9200a3064 and dropped the two cherry-picked tokenizer commits. Five own commits, head 66d573976. On this head:

  • prompt ids equal qwen-asr's on the dev clips;
  • 38 of the 40 gate clips are byte-identical, with the same two near-ties as before;
  • the full verify is green (lean 0 new, zig build test and the CI set RC 0).

A Metal binding of the same schedules passes on an M3 Pro (3 dev clips byte-identical). It follows as its own PR, stacked on this one.

@ashhart

ashhart commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Thanks @jschmied. 38 of 40 clips byte-identical, the other two at a bf16 tie and a 0.125 near-tie, with stage-by-stage cosines beside them, is a strong first gate. Two things before it can go further. First, this adds the family and uses the shared-schedule layout from #2118, and both still need a decision on our side; we'll answer on #2105 and #2118, so please keep this as a draft until then. Second, a small one for whenever it moves: vit.cu and prefill_attention.cu are shared by other towers, so please show the existing kernels' records are unchanged against main at nvcc 13.0. Also, could mel.zig's header describe the computation (a centered, reflect-padded STFT and slaney mel filters) instead of naming transformers' functions? On the windowed reference, we'll answer with the family's gate.

@jschmied
jschmied marked this pull request as draft November 5, 2026 12:55
@jschmied

jschmied commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Thanks. Back to draft until #2105 and #2118 are answered.

Shared kernels at nvcc 13.0. I compiled vit.cu and prefill_attention.cu from main a6e25faea and from this head with the catalog's flags (glue for vit, -O3 --fmad=false for prefill attention, the torch defines) for sm_80, 86, 89, 120 and 121, then compared cuobjdump -res-usage and -sass per arch and function:

unit functions on main resource records identical SASS identical added here
vit.cu 11 x 5 archs 55 / 55 55 / 55 tf_vit_conv_cols, tf_vit_conv_flatten
prefill_attention.cu 9 x 5 archs 45 / 45 45 / 45 vision_kernel<64, 8>

So every kernel main already has compiles to the same registers, shared and constant bytes and the same instructions; the PR only adds the three functions, and their registry rows are in the PR. nvcc cuda_13.0.r13.0/compiler.36424714_0.

mel.zig. 5df1d8e7e rewrites the header and the four comments that named the reference's functions. They now describe the computation: periodic Hann frames of a centered, reflect-padded STFT, slaney triangles over 0 to 8 kHz, log10 floored at the clip's peak - 8, then (l + 4) / 4.

Also on this push: 8548b14de is zig fmt on four files, which turns the fmt job green. Verify on 5df1d8e7e: lean 0 new, zig build test, the no-GPU CI set and zig fmt --check pass.

@shuuul

shuuul commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Thanks — the host/CUDA split is easy to follow, and tapping every stage in the case generator is useful. I went through the host and CUDA paths and found two issues I think should be fixed before this is usable as a 0.6B/1.7B gate, plus a few smaller points.

1. A single chunk shorter than 100 frames uses the wrong convolution geometry

zig/src/families/qwen3_asr/tower.zig:150-171 and tower_ref.zig:88-149 always pass chunk_frames (100) as the convolution's time length. The package does not pad a lone short chunk: Qwen3ASRAudioEncoder.forward sets chunk_lengths[tail] = feature_lens % (n_window * 2) and then calls pad_sequence to the longest chunk. With one chunk under 100 frames the longest chunk is that chunk itself, so the convolutions see its real length; with two or more chunks the tail is padded to 100, which is what this PR currently does everywhere.

This is not only the shape of the conv dumps: the right-edge conv2/conv3 outputs read the extra padded rows, so the kept rows can differ. I reproduced it with a 50-frame (0.5 s) clip:

  • embed cos 0.993416, audio_rows cos 0.973611 against the package case;
  • the case comparison then stops with error: StageSize at the conv stages;
  • a 499-frame case and a 105-frame case with a 5-frame tail both pass, so the problem is specifically a single short chunk.

Suggested fix: when plan.chunks == 1 and plan.frames < chunk_frames, pass plan.frames as cf through the three convolutions (or zero the padded rows after conv1/conv2; the former also makes the stage dumps match the package's shapes). Please add a 50/99-frame case to the host checks.

2. tf-qwen3-asr-check cannot open the released 1.7B checkpoint

zig/qwen3_asr_check.zig:117 hardcodes MODEL_DIR/model.safetensors. The released Qwen/Qwen3-ASR-1.7B is sharded (model-00001-of-00002.safetensors, model-00002-of-00002.safetensors, plus model.safetensors.index.json), so the host checker fails with error: FileNotFound. The CUDA Model.load already uses core.Checkpoint.openModel; the host checker should use the same abstraction (or combine the shards) so the 1.7B gate is actually runnable.

If the host checker is intentionally 0.6B-only, please state that in the tool usage and PR description; otherwise this contradicts the stated 0.6B/1.7B scope.

3. Smaller points

  • zig/qwen3_asr_check.zig:145-146 returns 0 after printing the summary, and zig/tests/qwen3_asr_cuda.zig:196-198 returns 0 even when the transcript is different. My 499-frame case printed audio_rows cos 0.999099 and worst stage cosine 0.998624777, and still exited 0. If these are gates, add a threshold/transcript assertion and a non-zero exit; if they are report-only, please label them that way.
  • config.zig:111 admits audio.out independently from text.hidden; lm.zig:92 copies t.hidden-wide rows from the tower output, so a malformed config can read past the tower rows. Add audio.out == text.hidden to admission.
  • config.zig:118 accepts window_infer < chunk_frames; chunks.zig:36,45 then makes window_rows == 0 and divides by zero. Require window_infer >= chunk_frames. Likewise, Options.group == 0 makes front's first += w.group loop forever.
  • prompt.zig:25-31 claims to implement parse_asr_output, but it does not strip special tokens, fold repetitions, normalize the language name or handle a forced language. It is only used by its own test; either delete it from this slice or align it with the package.
  • qwen3_asr_case.py --ids-only produces no stage files, but the host checker has no switch for that mode and fails on the missing mel stage. The CUDA tool has --ids-only; the host checker should match it.
  • The CUDA path dumps conv1–conv3 but not conv_out, so the conv_out case tensor is never compared. Add it if the stage gate is meant to be complete.

Windowed vs global attention

Windowed attention is defensible because the vLLM backend uses windows, but the package's stock SDPA path is global and the case generator's default windowed mask comes from a hook. Please record this as an explicit decision and keep the --global-attention case checkable; at the moment tower_ref and the host checker only implement the windowed plan, so that path cannot be validated from the same case.

I ran zig build test-qwen3-asr-host, zig build tf-qwen3-asr-check and zig build tf-qwen3-asr successfully. I could not execute the CUDA kernels in my environment (the build reported BuiltWithoutKernels), so the CUDA execution numbers still need a machine run; the short-chunk issue is in the shared tower.zig schedule and the host reference.

@jschmied

jschmied commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @shuuul, all fixed on 85f93a15a, one commit a point:

  1. A lone short chunk (6130afa16). The plan now carries the longest chunk's frames, and both the shared tower schedule and tower_ref run the three convs at that length. So a single chunk under 100 frames is convolved at its own length, and with two or more chunks each one is padded to 100. I made cases with qwen3_asr_case.py from a 0.5 s and a 0.99 s cut of a dev clip. On the host check, audio_rows cosine is 0.99984 / 0.99992 on the 0.6B and 0.99993 / 0.99992 on the 1.7B, and the conv stages are at the package's shapes. The parent commit reproduces your result on the 50-frame case: audio_rows 0.889, then StageSize. The schedule test now also runs 50 and 99 frames against the float64 reference and asserts the conv1 length.
  2. Sharded 1.7B (c09b3dd66). tf-qwen3-asr-check opens the folder through core.Checkpoint.openModel. On the 1.7B it reports WEIGHTS ok for all 708 tensors.
  3. Smaller points:
    • Gates (4e3f90e83). Both tools exit 1 on failure. tf-qwen3-asr-check fails when the worst stage cosine is under --min-cos (default 0.995). tf-qwen3-asr with a case fails on a differing prompt or transcript, or a stage under --min-cos (default 0.99). SUMMARY prints PASS or FAIL.
    • Admission (6f9412133). Admission now requires audio.out == text.hidden and n_window_infer >= chunk_frames, and tower.Weights.load refuses group == 0. The modulo check already refused a window under one chunk, since the integer fields are at least 1. It is now explicit and tested, and a test admits the 1.7B's released geometry.
    • prompt.split (3a41880fb). Deleted. Nothing outside its own test used it.
    • --ids-only on the host check (f44218f08). With it, the tool checks the weights, the prompt ids and the reference reply's decode, and compares no stages.
    • conv_out (375eb01b7). When a sink is attached, the schedule runs conv_out once more without the positions and dumps it. tf-qwen3-asr compares it. The timed pass is unchanged.
    • Windowed vs global (59bb92507). Windowed attention is the decision, matching the vLLM backend and flash-attention-2, and chunks.zig records it. The case manifest names its attention, and tower_ref and tf-qwen3-asr-check run either kind. tf-qwen3-asr runs only windows, so it refuses a global case. On dev clip 0004 (4 windows) with the 0.6B, the --global-attention case passes at audio_rows 0.99987, and the same case checked with windows fails at 0.919.

Host checks on this head, each step with its own exit code, all 0: git diff --check, zig fmt --check, lean (0 new), zig build test, test-cuda-host, test-qwen3-asr-host, the no-GPU CI set (test-kernel-contract test-golden test-server-security test-pull-security fuzz-cortheon), compile-cuda-tests for aarch64 and x86_64, and check-release-paths. 85f93a15a only makes comments one line for the lean check.

The GPU on our box is down until a reboot. The CUDA re-run follows after it: the 0.6B and 1.7B 40-clip gates plus the 50- and 99-frame cases with stages. I'll post the results here.

@jschmied

jschmied commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

The CUDA gates on 85f93a15a are in, on a GB10: the 40 public clips plus the 50- and 99-frame cases and the others in gate-review (45 in all).

checkpoint byte-identical differs
0.6B 42 of 45 3
1.7B 44 of 45 1

All four differences are near ties against the package, with the top two logits at most 0.25 apart on either side:

clip first difference ours (margin) package (margin)
1.7B 1089-134686-0000 token 21 323 (0.25) 11 (0.00)
0.6B cmn-10104380129516909856 token 27 3837 (0.25) 1773 (0.00)
0.6B cmn-15324743446256875074 token 10 468 (0.125) 9197 (0.25)
0.6B cut50 (the new 50-frame case) token 3 5632 (0.25) 18284 (0.125)

The two cmn clips differ the same way on the gate before this review. cut50 is new, and it's a 0.5 s clip. Its audio rows match on the host at cosine 0.99984, so I read it as the same kind of tie, not as the geometry bug.

Since the tools now exit 1 on a differing transcript, these clips fail by exit code, which is what a gate should do. If you'd rather have a margin rule for exact and near ties, say which, and I'll add it.

@ashhart

ashhart commented Nov 10, 2026

Copy link
Copy Markdown
Owner

Thanks @jschmied for taking every point from @shuuul's review, and for the GB10 rerun with each difference listed with its margins. Thanks too, @shuuul, for the careful read. Nothing is needed from you while this is a draft. The family and layout questions on #2105 and #2118 are still with the maintainer, and we'll answer your margin-rule question with that decision. As we said on #2105, the audio route (#1632) comes first.

  • Synthena (Ash's Agent)

@ashhart

ashhart commented Nov 10, 2026

Copy link
Copy Markdown
Owner

Thanks @jschmied for the GB10 rerun with every margin listed, and @shuuul for the careful review. The family is a yes (#2105), and this layout is fine for a new family (#2118).

On your margin question, here is the rule. It's the one we used on #2648.

  • Teacher-forced. Run each clip on the reference's greedy ids to the end, so every step is compared on the same history. Byte-identical clips already pass, so only the four that split need their remaining steps checked.
  • A step where our top token differs passes only if the same two tokens swap places (our runner-up is the reference's pick and theirs is ours), and both top-1/top-2 margins are at most 0.25 logit.
  • Every such step is listed with clip, step, both tokens and both margins. Anything else fails and the tool exits 1. A planted change that moves a real token should fail it.

Before it leaves draft:

  1. Rebase on main. It conflicts in four shared files, and contract_controls.cu is already at 600 lines there, so the new include needs another home. Please repeat the vit.cu and prefill_attention.cu SASS comparison on the rebased head.
  2. One Qwen3 forward on CUDA. qwen3 cuda: Qwen3 embedding checkpoints (BF16) on the native CUDA engine (#2261, 1 of 2) #2285 lands first, and the language model here runs through its CUDA pass, adding the decode step and the audio-row splice there. Its projections pin one cuBLASLt algorithm per shape, so a row's bits don't depend on how many rows share a pass, and the served path needs that for resumed and concurrent requests. Where the backend-neutral schedule lives for Metal and XPU is yours to propose, as long as CUDA ends with one Qwen3 layer path and qwen3 cuda: Qwen3 embedding checkpoints (BF16) on the native CUDA engine (#2261, 1 of 2) #2285's embedding bytes don't move. @Arminova, your review there would be welcome.
  3. The decode step's logits equal the prompt pass's for the same rows, and a prompt run in two passes gives the same cache and logits as one.
  4. At the final logits, our distance to an fp32 run of the package, beside the package's own bf16 distance, worst column and mean, on the dev clips.
  5. A line in the description saying the family was written from TensorFold's code and the publisher's model description, not from another engine's code.

The windowed reference is right, with the global comparison listed as you have it. Since this doesn't touch the server, it can land before #1632. The served path waits for #1632.


  • Synthena (Ash's Agent)

@jschmied

Copy link
Copy Markdown
Contributor Author

@ashhart thanks. Everything below is on b435cccc3, rebased on main 33ada77c3. It's still a draft.

1. Rebase.

  • The four shared files resolved. The controls include moved to contract_controls_set.cu:5, so contract_controls.cu stays at main's 600 lines. The records join in registry_joins.zig:20 and :34, beside MOSS-Image's.
  • SASS at nvcc 13.0 (cuda_13.0.r13.0/compiler.36424714_0). I compiled vit.cu and prefill_attention.cu from main and from this head with the catalog's flags for sm_80, 86, 89, 120 and 121, then compared cuobjdump -res-usage and -sass per arch and function:
unit functions on main x archs res-usage identical SASS identical added here
vit.cu 11 x 5 55 / 55 55 / 55 tf_vit_conv_cols, tf_vit_conv_flatten
prefill_attention.cu 12 x 5 60 / 60 60 / 60 vision_kernel<64, 8>

Tie rule. tf-qwen3-asr-forced (zig/tests/qwen3_asr_forced.zig) runs each clip on the case's greedy ids to the end. Each step goes through forced.judge (zig/src/families/qwen3_asr/forced.zig:13), and every differing step is listed. Anything else fails with exit 1. When topk lists an exact reference tie (margin 0) the other way round, the greedy id counts as the reference's pick. I ran 45 clips per checkpoint: the 40 gate clips, the 50- and 99-frame cuts and the 3 dev clips.

checkpoint clip step ours (margin) reference (margin) verdict
0.6B cut50 3 5632 (0.25) 18284 (0.125) swap, pass
0.6B cmn-10104380129516909856 27 3837 (0.25) 1773 (0.000) swap, pass
1.7B 1089-134686-0000 21 323 (0.25) 11 (0.000) swap, pass
0.6B cmn-15324743446256875074 10 468 (0.125), runner-up 9197 9197 (0.25), runner-up 36 fail

So the 0.6B passes 44 of 45 clips and the 1.7B passes 45 of 45. Every other step matches. The failing step isn't a swap. In the package's bf16 run our 468 is third: 9197 25.75, 36 25.5, 468 25.375. The package's fp32 run of the same step puts 468 first, at 25.7277 against 9197's 25.7162. Under the rule as written it fails. I've left the rule alone and listed the step.

Planted changes on dev clip 0000:

  • q_norm and k_norm swapped in every layer (--plant norms): the 0.6B fails 11 steps and the 1.7B 2, with exit 1.
  • The audio rows one position late (--plant splice): no top token moves, so the tie rule passes it. The fp32 distance in item 4 catches it, with a worst column of 14.45 on the 0.6B and 8.06 on the 1.7B against about 1 unplanted.

2. One Qwen3 forward on CUDA through #2285. Here's what I propose. I'll build it once #2285 lands, and nothing here depends on it yet.

3. Decode against prompt, two passes against one.

  • forwardHeads (lm.zig:101) puts the head over a pass's last rows. The splice is cut to the pass (lm.zig:56), so a prompt can be split inside the audio rows.
  • On the host, a binding computes every op row by row (lm_test.zig:196, :212). Each decode step's logits equal the prompt pass's rows, and a prompt cut at 3, 5, 7 or 11 leaves the same caches and logits as one pass. A planted fault that writes k and v at the pass's row instead of its position fails the first test.
  • On CUDA, tf-qwen3-asr-forced --rows 8 runs the same two checks on each dev clip. With today's vit.Gemms, which chooses its cuBLASLt algorithm per row count, they aren't bit-equal: 0 or 1 of 9 rows equal (worst |diff| 0.375 to 1.625), and the two-pass cache differs on 0000 and 0001. With --row-gemms, every projection runs one row at a time on one algorithm. Then all 9 rows are bit-equal and no cache value differs, on all six runs. So the rest of the pass is already independent of the row count, and the gap is the per-row-count algorithm that qwen3 cuda: Qwen3 embedding checkpoints (BF16) on the native CUDA engine (#2261, 1 of 2) #2285 pins.

4. Distance to the package's fp32 run (teacher-forced on the package's greedy ids, final logits, worst column / mean |diff|). qwen3_asr_case.py --logits writes the package's bf16 and fp32 logits:

checkpoint dev clip ours package bf16 ours, --row-gemms
0.6B 0000 1.079 / 0.1329 1.428 / 0.1023 0.750 / 0.0899
0.6B 0001 0.970 / 0.1015 1.040 / 0.0989 1.024 / 0.0917
0.6B 0004 1.260 / 0.0851 0.873 / 0.0911 0.768 / 0.0849
1.7B 0000 0.968 / 0.0737 0.663 / 0.0734 0.757 / 0.0677
1.7B 0001 0.845 / 0.0687 0.707 / 0.0733 0.692 / 0.0827
1.7B 0004 0.667 / 0.0706 0.980 / 0.0819 0.942 / 0.0797

Today's path isn't uniformly closer to fp32 than the package's bf16. On 0.6B 0000 its mean is 0.133 against 0.102, and that's the clip where the multi-row algorithms differ most. One algorithm a shape brings that mean to 0.090. I'll repeat this table through #2285's pass.

5. Provenance. The description now has the line, worded to match what I actually read: TensorFold's code, the checkpoint's config files, and the publisher's own reference package qwen-asr 0.0.6. From that package I read its transformers-backend modeling and processor, its inference wrapper, and a search of its vLLM-backend file for the attention windows. I also checked the log-mel front end against transformers' WhisperFeatureExtractor source, which the package calls. No code was copied from any of them.

Verify on b435cccc3: git diff --check, zig fmt --check, lean (0 new), pr_check, zig build test, test-cuda-host, test-qwen3-asr-host, the CI set, compile-cuda-tests for aarch64 and x86_64, check-release-paths, and on the x86 box the host CI set, check-native-cuda-host and compile-cuda-tests, pr_check and zig fmt --check: all exit 0. The description is updated, provenance line included.

@ashhart

ashhart commented Nov 10, 2026

Copy link
Copy Markdown
Owner

Thanks @jschmied. The rebase, the SASS table, the tie-rule run with every split listed, the fp32 distances and the provenance line answer what we asked. The #2285 plan (one Qwen3 layer path on CUDA, the schedule in families/qwen3/schedule.zig, start, splice and head read only when set, plus an embedding hash on main against the head) is the shape we asked for.

Two decisions from our side:

  • 0.6B cmn-15324743446256875074 step 10: we count it as a listed exception, not a fail. Our pick (468) is the package's own fp32 pick, and the bf16 reference has it third; please keep it listed with that fp32 evidence in the description.
  • Provenance: reading the model's own release package for behaviour, with nothing copied and the notice you wrote, is fine. Before it lands we run our own copy check against those sources; nothing is needed from you for that.

One small thing for now: the exact-tie swap in tests/qwen3_asr_forced.zig:154 decides two of the listed steps, but nothing tests it. Could it move into forced.zig next to judge, with a unit test that fails without it?

Once it runs through #2285's pass, please post the tie-rule run, the fp32 distance table, and --rows without --row-gemms, each on that head.

  • Synthena (Ash's Agent)

@jschmied

Copy link
Copy Markdown
Contributor Author

@ashhart thanks. On 65b33d6f9, pushed on top of b435cccc3 with no rebase:

  • Exact-tie order. The tool's inline swap is now forced.reference (zig/src/families/qwen3_asr/forced.zig:20), next to judge. tests/qwen3_asr_forced.zig:152 calls it.
    • Its test (forced.zig:71) covers both orders of an exact tie, a non-zero margin with the greedy id second (refused), and a greedy id outside the pair (refused). It also covers the 1.7B 1089-134686-0000 step 21 case, which is a swap.
    • With the swap planted out, the test goes red (27/28 tests passed (1 failed)). With it back, test-qwen3-asr-host is green at 28/28.
  • Description. 0.6B cmn-15324743446256875074 step 10 is now a listed exception, with the fp32 evidence: our 468 is the package's fp32 pick (25.7277 against 9197's 25.7162), and the bf16 reference has it third. The tool still lists it and exits 1 on it.
  • After qwen3 cuda: Qwen3 embedding checkpoints (BF16) on the native CUDA engine (#2261, 1 of 2) #2285: on that head I'll post the tie-rule run, the fp32 distance table, and --rows without --row-gemms.

Verify on 65b33d6f9: git diff --check, zig fmt --check, lean (0 new), pr_check, zig build test, test-cuda-host, test-qwen3-asr-host, the CI set, compile-cuda-tests for aarch64 and x86_64, check-release-paths, and the x86 host set. All exit 0.

@Arminova

Copy link
Copy Markdown
Contributor

@jschmied yes, that shape works for us: one Qwen3 layer path on CUDA, the start, splice and head read only when set, and the embedding hashes on main against the new head.

Three things from our side:

For the embedding hashes: we're rerunning #2285's receipts for the 0.6B, 4B and 8B on its rebased head now, and we'll post the per-vector hashes with them, so your comparison has a fixed baseline.

@ashhart

ashhart commented Nov 10, 2026

Copy link
Copy Markdown
Owner

Thanks @jschmied. The exact-tie order now lives in forced.reference (zig/src/families/qwen3_asr/forced.zig:20-24), with its test at :71 covering both orders and the 1.7B step 21 swap, and the description lists the 0.6B step 10 exception with its fp32 evidence. That's everything we asked for now. Thanks too, @Arminova, for confirming the shape on the #2285 side.

Nothing is needed until #2285 lands. When you rebase onto it, two small things from today's main: contract_controls_set.cu now conflicts on one include line (main added contract_dense_controls.cuh beside yours), and main changed prefill_attention.cu for two query heads a block, so please redo that unit's SASS comparison on the rebased head, along with the tie-rule run, the fp32 table and --rows without --row-gemms.

  • Synthena (Ash's Agent)

@jschmied

Copy link
Copy Markdown
Contributor Author

@ashhart #2285 is in, so here is the rebase and the run through its pass. Head 51dc03072, on main 000b534a2.

  • Rebase. One conflict: contract_controls_set.cu's include line now has main's contract_dense_controls.cuh
    and ours, both kept.
  • SASS, prefill_attention.cu (after main's two-query-heads change), nvcc 13.0.88, sm_80/86/89/120/121, main
    against this head: 70 of 70 records are identical in res-usage and SASS. vit.cu: 55 of 55. Only our three new
    functions are added.
  • One Qwen3 layer path. The language model now runs qwen3 cuda: Qwen3 embedding checkpoints (BF16) on the native CUDA engine (#2261, 1 of 2) #2285's pass through forwardFrom(…, Extra)
    (zig/src/families/qwen3/cuda/lm.zig:343, Extra at :200): a start position, every layer's own caches, the
    audio splice, the tied head over the pass's last rows, and stage taps. Each is read only when set, so forward is
    forwardFrom(.{}) with the same launches and arguments as before.
    • lm.admit (:210) refuses a bad combination before any launch. Its test is at :218; with the cache check
      planted out it goes red (18/19).
    • qwen3_asr/cuda/lm.zig and --row-gemms are gone. The checkpoint loads through weights.Model.fromCheckpoint
      (weights.zig:46), and the position and RoPE uploads are lm.tables (lm.zig:127), which the engine calls too.
    • Part B isn't open yet, so the start is Extra.start for now. I'll move it onto B's attention offset when B
      lands.
  • --rows 8 without --row-gemms. On all six dev runs (0.6B and 1.7B), the prompt pass's last 9 rows equal the
    decode steps bit for bit. The two-pass split leaves 0 cache values different and the same last logits.
  • fp32 distance table: the means are below the package's bf16 run in 5 of 6 cells (0.6B 0000 is 0.0963 against
    0.1023; it was 0.133 on r4). The full table is in the description.
  • Tie rule: 1.7B passes 45 of 45 (four swaps listed). The 0.6B passes 43 of 45, with step 10 as the listed
    exception. One new fail needs your call: 0.6B cut50 step 3.
    • Ours is 5632 with margin 0.625. The reference case has 18284 at 0.125.
    • The package's own teacher-forced logits disagree with that case. Its bf16 run puts 5632 first (22.75 against
      22.625), and its fp32 run puts 18284 first (22.7922 against 22.5113).
    • On r4's bf16-rounded norms this step was a swap at 0.25. qwen3 cuda: Qwen3 embedding checkpoints (BF16) on the native CUDA engine (#2261, 1 of 2) #2285's fp32 norm weights move it to 0.625.
    • Should it be a second listed exception, or should the ASR keep bf16-rounded norms through a second norm point in
      the pass? We'd rather not add that point. It stays draft until you decide.
  • Embedding bytes: not run yet. The Qwen3-Embedding 0.6B/4B/8B checkpoints aren't on this box, and I'd need
    @Arminova's id lists for inputs 4-7. The launches are the same by construction. I'll post the 36 hashes against
    4257e6f01 once the checkpoints are here.

Verify on 51dc03072: Every check exits 0: git diff --check, zig fmt --check, cuda_common_check, lean (0 new), pr_check, zig build test, test-cuda-host, test-qwen3-asr-host, tf-qwen3-asr and tf-qwen3-asr-forced, test-qwen3-cuda-host, test-qwen3-checks-host, qwen3-cuda-gpu-build, the CI set (test-kernel-contract, test-golden, test-server-security, test-pull-security, fuzz-cortheon), compile-cuda-tests for aarch64 and x86_64, and check-release-paths. The x86 host set exits 0 too.
Receipts: the run log and per-clip logs for every row above, on this head.

jschmied and others added 21 commits November 22, 2026 08:24
…th (ashhart#2105)

The package pads every chunk to the longest one, so a clip of one chunk shorter than 100 frames goes through the
three convolutions at its own length; the right-edge conv2 and conv3 outputs then see no padded rows. The plan gives
that length (chunk_frames), and the shared tower schedule and the float64 reference both take it.

The schedule test runs 50- and 99-frame clips against the reference and checks the first convolution's length. On
cases from qwen3_asr_case.py for a 0.5 s and a 0.99 s cut of a dev clip, the 0.6B's host check at torch's points
gives audio_rows cosine 0.99984 and 0.99992, the conv stages at the package's shapes; at the parent commit the 50-frame
case gave audio_rows 0.889 and stopped with StageSize at the conv stages.
….Checkpoint (ashhart#2105)

The host check mapped MODEL_DIR/model.safetensors only, so the released 1.7B (two shards and an index) failed with
FileNotFound. It now opens the folder with core.Checkpoint.openModel, as the CUDA load does, and validates the names
of every shard as one set.

On the 1.7B: WEIGHTS ok (708 tensors), and the 50- and 99-frame cases give audio_rows cosine 0.99993 and 0.99992 at
torch's points.
…shhart#2105)

tf-qwen3-asr-check exits 1 when the worst stage cosine is under --min-cos (default 0.995; a token or prompt mismatch
already failed). tf-qwen3-asr with a case exits 1 when the prompt ids or the greedy transcript differ from the case's,
or a compared stage's cosine is under --min-cos (default 0.99). The SUMMARY line names the gate and PASS or FAIL.
…a window of whole chunks; no empty group (ashhart#2105)

The LM copies hidden-wide rows from the tower's output, so a config whose audio output_dim differs from the text
hidden size is refused. n_window_infer under one chunk is refused by name (the modulo already refused it, as the
integer fields are at least 1). tower.Weights.load refuses a group of 0 chunks, which encode steps through.

The 1.7B's released geometry (24 tower layers, 16 heads of 64, output 2048 = hidden 2048) is admitted in a test.
…its special-token, repetition and language handling (ashhart#2105)

Only its own test used it; the tools compare token ids and the decoded reply. A parser matching the package's can come
with the serving path that needs one.
…t#2105)

A case from qwen3_asr_case.py --ids-only holds no stage tensors, so the host check stopped at the missing mel stage.
With --ids-only it checks the weights, the prompt ids and the reference reply's decode, and compares no stage. On the
1.7B's gate case 1089-134686-0001: PASS.
…hhart#2105)

The package taps conv_out before the positions are added, and the schedule fuses the add into conv_out's Linear. When
a binding is dumping (a new dumping() on the binding), the schedule runs conv_out once more without the positions and
dumps it; the timed pass is unchanged. tf-qwen3-asr gathers it over the chunk groups as it does the convs. The
schedule test compares the host binding's conv_out with the float64 reference's.
…on case is checkable on the host (ashhart#2105)

The tower runs attention within n_window_infer windows, as the package's vLLM backend and flash-attention-2 path do;
the package's stock transformers SDPA path attends over every row. chunks.zig records that. The case's manifest names
its attention, Plan.attending(.global) is one window over every row, and the float64 reference and
tf-qwen3-asr-check run the case's kind. tf-qwen3-asr, which runs the windows, refuses a global case (exit 2).

On dev clip 1272-128104-0004 (2940 frames, 4 windows) with the 0.6B: the global case passes at audio_rows cosine
0.99987 (worst stage 0.99979), the windowed case at 0.99989; the global case checked with windows gives 0.919 and
fails the gate.
… prompt in two passes equals one (ashhart#2105)

The splice is cut to the pass, so a prompt can be split inside the audio rows. forwardHeads puts the head over a pass's last rows, the CUDA binding can keep each head row's logits and download its caches, and lm_test.zig checks both equalities on a computing host binding, with a planted cache slot that fails them.
…case's bf16 and fp32 logits (ashhart#2105)

Each clip runs on the reference's greedy ids to the end. A step whose top token differs passes only if the two tokens swap places and both margins are at most 0.25 logit; every such step is listed, anything else fails with exit 1. With logits_fp32 and logits_bf16 in the case (qwen3_asr_case.py --logits), it prints our distance to the package's fp32 run beside the package's own bf16 distance. --rows K checks the decode steps against one prompt pass and a prompt split in two passes against one, on CUDA.
…y round, plants swapped q and k norms, and --row-gemms (ashhart#2105)

topk may list an exact tie (margin 0) in either order; the greedy id is the reference's pick. --plant norms swaps q_norm and k_norm in every layer, a planted change that moves real tokens. --row-gemms runs every projection a row at a time, so --rows can tell cuBLASLt's per-row-count algorithms from the schedule's positions and caches.
…o forced.zig, with its test (ashhart#2105)

forced.reference takes the reference's step from its topk pair and greedy id: an exact tie (margin 0) listed the other way round is the greedy pick's; anything else whose first token is not the greedy id is refused. Its test fails without the swap.
…ith a start position, an audio splice and a tied head over chosen rows (ashhart#2105)

qwen3/cuda/lm.zig's forwardFrom takes an Extra: the input's first position, every layer's own k and v caches,
rows spliced over the embedded ones, the final norm and the tied head over the pass's last rows, and stage taps.
Each is read only when set: forward(.{}) issues the embeddings' launches with the same arguments.
qwen3_asr/cuda/lm.zig (the schedule's CUDA binding) goes; the ASR checkpoint loads through
weights.Model.fromCheckpoint under its thinker.model. scope, and the position and RoPE uploads are lm.tables,
shared with the engine. tf-qwen3-asr-forced drops --row-gemms: every projection keeps one algorithm per (n, k).
… its caches before any launch, with its tests

lm.admit names the refusals (InvalidBatch, ContextFull); its test and Splice.within's run in test-qwen3-cuda-host.
…s audio tower (ashhart#2105)

The three pinned serving sources gain only new code: a vision_kernel<64, 8> instance, tf_vit_conv_cols and
tf_vit_conv_flatten, and their wrappers. The existing kernels' SASS is unchanged on sm_80/86/89/120/121.
Follow main e54cb34 (cuda tests: split command help to keep the runner under 600 lines). Original ashhart#2239 mail24 removes its standalone contract command in favor of the existing kernel-contract words; remove only its temporary help row from the current module.
@ashhart
ashhart merged commit 7fb9fc6 into ashhart:main Nov 22, 2026
2 of 12 checks passed
ashhart added a commit that referenced this pull request Nov 22, 2026
Follow main e54cb34 (cuda tests: split command help to keep the runner under 600 lines). Keep every current usage entry and place original #2239 mail5 temporary ASR help beside them. The later original mail24 removes this command.
ashhart added a commit that referenced this pull request Nov 22, 2026
Follow main e54cb34 (cuda tests: split command help to keep the runner under 600 lines). Original #2239 mail24 removes its standalone contract command in favor of the existing kernel-contract words; remove only its temporary help row from the current module.
@ashhart

ashhart commented Nov 22, 2026

Copy link
Copy Markdown
Owner

Thank you @jschmied. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants