Repository navigation
Conversation
Qwen3-ASR's 0.6B and 1.7B admitted from config.json: the audio tower's geometry (chunks of 100 frames, windows of n_window_infer frames) and the Qwen3 language model's, its interleaved M-RoPE refused unless its sections span the head (audio positions are equal on all three axes, so it is plain RoPE). Every stored tensor checked by name, shape and dtype, none left over; the stored lm_head must be bit-equal to the tied embedding. WhisperFeatureExtractor's log-mel rows in float64, and the tower in float64 stage by stage, either exact or at torch's bf16 rounding points. The checkpoint ships no tokenizer.json; the shared tokenizer reads its slow export (#2225). tf-qwen3-asr-check compares weights, prompt ids, the reply's decode, mel rows and every tower stage with a case from tools/zig/qwen3_asr_case.py (the qwen-asr 0.0.6 package's transformers backend, hooked stage by stage).
…ing (#2105) tower.zig and lm.zig load weights by name through the binding's put and run the schedule through r.conv, r.linear, r.attention and the rest; they import no backend. schedule_test.zig runs both on a host binding: the tower matches the float64 reference at torch's points (global attention fails it), and the LM's ops stay inside their buffers.
…s-only case (#2105) A transcript that differs from the package's is listed with the reference's margin where it first differs; the gate set's cases keep only the prompt, the greedy ids and the margins.
The input norm, the attention before o_proj, o_proj, the post-attention norm and the MLP of the first decoder layer, so a wrong LM stage is found inside its first layer.
…#2105) families/qwen3_asr/cuda/ binds the shared schedules: a device store for the weights by name and the scratch, the tower over vit.cu's LayerNorm, pointwise and cuBLASLt Linear kernels, and the LM over the shared rows (addRmsTail, qk_rows, Nemotron's chunked GQA attention, SwiGLU). New kernels: tf_vit_conv_cols (3x3 stride-2 conv taps, channels last), tf_vit_conv_flatten (torch's [c, f] rows) and vision_kernel<64, 8>; qwen3-asr-contract registers all three, each copy with a planted control, and their usage is recorded for nvcc 13.0 and 13.2. The LM schedule dumps its stages (lm_embed, layer 0's steps, lm_layer{i}, lm_norm), and its first post-attention norm takes the embeddings as the stream (the input norm writes no h without a residual). tf-qwen3-asr runs a clip against a case: on 40 public clips (LibriSpeech test-clean, FLEURS cmn test) 38 greedy transcripts are byte-identical to the package's windowed reference; the two others split at near-ties (margins 0.000 and 0.25 on the reference's side).
…ence's functions (#2105)
…th (#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 (#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.
…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 (#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 (#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.
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.
) 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 (#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 (#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 (#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 (#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 (#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.
…tart position, an audio splice and a tied head over chosen rows (#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 (#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.
…ds, so main.zig stays within 600 lines (#2105)
… the computation (#2105)
… its row copies and put_slot (#3570)
…F_GLM_MOE_DIRECT (#3659)
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.
CI for a landing train: #2239 #3659 stacked on main in that order. Nothing merges from this PR: each PR above lands on its own once this tip is green, and this PR is then closed.