Repository navigation
Qualify complete Qwen3.8-27B standard-only VLM export - #758
titaiwangms wants to merge 5 commits into
Conversation
Add the public text-only mapping for the Qwen3.8-27B qwen3_5 composite, preserve its explicit FP32 recurrent-state policy, and apply the fixed HF Qwen3.5 L2 normalization epsilon of 1e-6. The offline evidence covers full-config standard graphs and reduced CUDA own-state parity with synthetic weights. This does not qualify official weights or a full checkpoint. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: titaiwang <titaiwang@microsoft.com>
Performance Comparison
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The text-only routing map omits the registered qwen3_5_vl_text model type, causing the public builder to reject that valid route.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Qualifies Qwen3.8-27B’s unquantized, text-only standard-ONNX export path.
Changes:
- Adds Qwen3.5 text-only routing and pinned Qwen3.8 configuration.
- Preserves configured recurrent-state precision and corrects Qwen3.5 DeltaNet normalization.
- Adds graph, serialization, CUDA parity, and documentation coverage.
| File | Description |
|---|---|
testdata/configs/qwen3_8-27b.json |
Adds the pinned official configuration. |
src/mobius/tasks/_causal_lm.py |
Documents mixed cache dtypes. |
src/mobius/tasks/_cache_utils.py |
Applies configured recurrent-state dtype. |
src/mobius/models/qwen38_standard_test.py |
Adds structural and numerical qualification tests. |
src/mobius/models/qwen35.py |
Adds Qwen-specific DeltaNet epsilon. |
src/mobius/components/_gated_deltanet.py |
Preserves legacy dtype fallback. |
src/mobius/_registry.py |
Adds Qwen3.5 text-only routing aliases. |
src/mobius/_configs/_base.py |
Extracts and validates state dtype policy. |
docs/design/qwen38-27b-standard-onnx.md |
Documents scope, ABI, and evidence. |
docs/cli_reference.md |
Documents CLI support and limitations. |
CHANGELOG.md |
Records qualification and compatibility changes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| "qwen3_5": "qwen3_5_text", | ||
| "qwen3_5_vl": "qwen3_5_text", | ||
| "qwen3_5_text": "qwen3_5_text", |
🏗️ Architecture Diff
qwen3_5_moe (hybrid-text-generation) / model — 33 change(s)Op summary: 265 → 269 nodes --- base
+++ head
@@ -42,11 +42,15 @@
Concat
Reshape
ReduceSumSquare
+CastLike
+Add
Sqrt
Div
Reshape
Reshape
ReduceSumSquare
+CastLike
+Add
Sqrt
Div
ReshapeAdded nodes:
Connectivity changes:
Interface changes:
Initializer changes:
qwen3_5_text (hybrid-text-generation) / model — 33 change(s)Op summary: 127 → 131 nodes --- base
+++ head
@@ -42,11 +42,15 @@
Concat
Reshape
ReduceSumSquare
+CastLike
+Add
Sqrt
Div
Reshape
Reshape
ReduceSumSquare
+CastLike
+Add
Sqrt
Div
ReshapeAdded nodes:
Connectivity changes:
Interface changes:
Initializer changes:
qwen3_5_vl (hybrid-qwen-vl) / decoder — 56 change(s)Op summary: 153 → 157 nodes --- base
+++ head
@@ -67,11 +67,15 @@
Concat
Reshape
ReduceSumSquare
+CastLike
+Add
Sqrt
Div
Reshape
Reshape
ReduceSumSquare
+CastLike
+Add
Sqrt
Div
ReshapeAdded nodes:
Connectivity changes:
Interface changes:
Initializer changes:
qwen3_5_vl (hybrid-qwen-vl) / embedding — 7 change(s)Op summary: 46 → 52 nodes --- base
+++ head
@@ -12,14 +12,20 @@
Gather
Constant
Equal
+Constant
+Equal
+Or
Unsqueeze
Cast
+Reshape
Constant
CumSum
Constant
Sub
Constant
Clip
+Shape
+Reshape
CastLike
Constant
ShapeAdded nodes:
Connectivity changes:
qwen3_5_vl (hybrid-qwen-vl) / vision_encoder — 35 change(s)Op summary: 251 → 252 nodes --- base
+++ head
@@ -1,3 +1,4 @@
+Cast
Reshape
Conv
ReshapeAdded nodes:
Modified attributes:
Connectivity changes:
qwen3_next (hybrid-text-generation) / model — 1 change(s)Op summary: 565 → 565 nodes No op-sequence changes. Interface changes:
Legend: ⚪ No change · 🔵 Minor (attrs/inits) · 🟡 Moderate (nodes added/removed) · 🔴 Major (interface changed) |
Publish the complete Qwen3.8-27B standard-only VLM graph with reduced qualification coverage. Update processor casting and global image/video offsets, and use FP32 learned normalization where required. Record the remaining official FP16 parity failures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: titaiwang <titaiwang@microsoft.com>
Publish metadata-only packaging and the existing runtime route with local processor and RGB double-swap root fixes while preserving global mixed caches. Correct GGUF unset policy fingerprint handling and mandatory Qwen4 FP32 state. Restore DeltaNet output dtype and skip only known FLOAT identity casts without changing precision or epsilon. Qualification notes: native-first 200 completes 174, HF 175, with 28 diagnosed resize-grid differences deferred runtime-side and FP16 parity unresolved. No readiness or all-CI-green claim. Signed-off-by: titaiwang <titaiwang@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Record the approved native AI2D results, numerical and historical CI context, and repeated-inference input-memory findings. Explicitly preserve the numerical, memory, and qualification limitations: task-answer agreement is evidence for this tested subset, not deployment qualification or a claim of full numerical parity. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: titaiwang <titaiwang@microsoft.com>

Goal and scope
Deliver the complete Qwen/Qwen3.8-27B vision-language package using standard ONNX operators only: 27-layer vision encoder, embedding/fusion, and the full 64-layer hybrid decoder (48 DeltaNet + 16 full-attention layers, dense MLP). Optional text-only export retains all hybrid decoder layers.
ModelBuilder/native operator equivalence and controlled performance remain deferred. Ordinary packaging and the existing
--runtime ort-genairoute are now covered by the bounded CUDA native qualification below; other runtime builds/platforms and full numerical equivalence remain unqualified. A complete real-weight standard-only artifact now exists; official FP16 numerical qualification is still failing.Changes
1e-6Q/K normalization epsilon.image_featuresinput contains visual rows in flattened batch/token placeholder order; no new graph input is required.1 + weightscaling until the final activation cast. A nonzero learned-offset test reproduced premature FP16 rounding before the fix.Offline and reduced-model evidence
The 14 reduced VLM CUDA combinations cover FP32/FP16 text, multi-image, video, and mixed media, including two-row batches. Actual saved/reloaded ONNX vision outputs feed ONNX fusion and the hybrid decoder. Prefill plus four reused-state decode steps compare full logits, exact greedy IDs, and all convolution/recurrent/KV states. CUDA profiling requires actual matrix execution, not merely provider registration; it does not assert every node runs on CUDA.
Pixels are nonzero synthetic packed inputs. HF supplies explicit MRoPE positions. These tests do not establish official processor/host-position correctness or official-checkpoint accuracy. The earlier text-only stage's 361-test evidence and baseline-equivalent MyPy diagnostics are prior-stage results, not fresh full-VLM-revision checks.
Official complete checkpoint export
1d4bf0f2ff6012fd82039f2fa52739d0dd7c60c0.191e0af232104ed8b65258cf3fb2b842e288008baca7633c11b82a1ac7203aab.decoder,vision_encoder,embedding, plus nine pinned processor/tokenizer/config assets.The first serialization attempt timed out on strided folded tensors. A real production-matrix probe verified byte-identical output after C-contiguous conversion. The successful operational exporter copies only non-contiguous storage, verifies all bits/shapes/dtypes, then saves/reloads. No installed-library patch or generic Mobius serializer change is included.
All checkpoint/export/cache/temp payloads stay on disk5. Approved prior home experiment/download payloads were relocated (276 files, 121,376,498,834 bytes), with source symlinks and matching destination sizes verified. Repository/package fixtures were explicitly excluded. The original dirty checkout's branch, HEAD, 21 statuses and hashes were preserved.
Official runtime failures — not cleared
Environment: A100 CUDA, Transformers 5.15.0, PyTorch 2.13.0+cu130, ORT 1.30.0. Tolerance stayed
rtol=atol=1e-2; failures were not hidden by changing it.Visual-only diagnosis strictly bound and checked all 333 official visual tensors. It reproduced extra FP16 rounding in separate
MatMul/Addversus HFLinear, and in half-precision rotary arithmetic. StandardGemmexactly matched the isolated QKV projection; FP32 rotary arithmetic matched locally. Their combined full-vision effect has not been established and neither is included as a claimed parity fix. Disabling optimization and wholesale FP32 execution also did not establish agreement with the original FP16 reference.The learned-offset norm correction is independently grounded and tested but does not resolve the remaining full-decoder divergence. A per-layer numerical investigation remains necessary.
AI2D paired 100-sample evaluation (October 7, 2026)
The user selected a fixed 100-question comparison rather than the full 3,088-row benchmark.
lmms-lab-encoder/ai2d, pinned revisionc83a9b9692933aff8349157c88a413df9d02c4e5, test indices 0–99.ai2ddefault MCQ prompt, filter and exact-match normalization at08affba133b97b19351897f4d42081ead2b3412e; greedy generation withmax_new_tokens=16.All 100 generated token sequences and decoded responses matched exactly. The valid-letter agreement metric is 98/100 because both models produced the same unparseable, 16-token-capped responses on indices 55 and 56; these were counted incorrect, not skipped. No sample was correct only in one backend. All 100 persisted records were independently re-scored and matched the summary.
This is a fixed-prefix subset result, not a full AI2D score or a general accuracy-equivalence claim. Logit parity remains failed: all 100 prefill last-position vocabulary comparisons exceeded the unchanged
rtol=atol=1e-2; maximum absolute error across these comparisons was 0.453125. Task-answer agreement does not clear those numerical differences. The timings include each backend's current vision/decoder/cache-transfer path and are not optimized-runtime benchmarks.Receipts:
ai2d/first100/summary.json,ai2d/first100/predictions.jsonl, andai2d/first100.logunder the disk5 export task root. The initial pilot was blocked by transient GPU occupancy before producing any rows; it was retained as a failed receipt, and successful runs used explicitly distinct GPU UUIDs without terminating other processes.AI2D paired 200-sample extension (October 7, 2026)
The same unchanged evaluator was run on test indices 0–199. This is HuggingFace
generate()versus raw ONNX Runtime CUDA EP, with Python managing the three exported graphs and cache/position feeds. It is not an onnxruntime-genai compatibility test.C; Torch generatedC([34, 248046]), ONNX generatedA([32, 248046]). This is one Torch-correct/ONNX-wrong case and a 0.5 percentage-point subset accuracy gap.rtol=atol=1e-2; maximum absolute error was 0.462890625.Receipts:
ai2d/first200/summary.json,ai2d/first200/predictions.jsonl, andai2d/first200.logunder the disk5 task root. The evaluator SHA256 remained0af276cb26c106f141d67e064732a74c186da9d097781446c62d89c7149b26cd.At the October 7 raw-ORT stage, readiness was limited to an executable standard-ONNX export/evaluation candidate. The larger subset now demonstrates an actual answer difference, not only floating-point differences; it does not establish full Torch equivalence, a full AI2D score, or GenAI runtime readiness on their own; see the October 9 native qualification below. Numerical qualification remains unresolved.
Earlier standard-export review and exclusions (historical)
Five scoped static review roles reported no grounded Critical/Major implementation findings. The raised mixed-media DeepStack coverage gap was addressed by the two sentinel regressions. No Critical/Major findings were overruled; the corresponding findings ledger is empty.
Non-blocking questions retained: the source of remaining official FP16 decoder divergence, full DeepStack decoder parity, and caller correctness when token IDs are missing or visual rows are supplied in the wrong order. The pinned official config supplies explicit image/video IDs.
Not qualified: complete official numerical/generation accuracy, real-weight video/mixed-media and independent processor/host positions, the full AI2D test split, BF16, MTP, quantization, ModelBuilder/GenAI compatibility, or memory/throughput. The AI2D subset does not establish per-step full-state/full-logit parity or a production accuracy qualification.
Native ORT GenAI integration (October 9, 2026)
The scope now also includes ordinary ONNX packaging and the existing
--runtime ort-genairoute, without a new Mobius CLI flag or automaticallyadding fused/custom graph operators. The three existing standard-only ONNX
graphs and their weights are unchanged. A metadata-only overlay uses the
existing writer's
ep="cuda"andog.Configprovider APIs.In the tested installed
0.16.0-devbuild, decoder provider overrides didnot change explicit auxiliary CPU sessions. The qualified overlay therefore
writes CUDA session metadata for decoder, vision and embedding together;
capture and shared KV buffers stay off. This does not qualify other native
builds or CPU/DML execution.
Implementation also recognizes unwrapped
qwen3_5_textVLM packages andloads the local pinned HF processor assets. A grounded RGB producer fix
removes Normalize's BGR-to-RGB swap after DecodeImage already emits RGB;
PatchImage continues to own patch packing. No manual tensor flip, pixel
substitution, weight permutation or real-model rebuild was used.
The opt-in native toy checks sparse global KV slots 3/7, FP16 convolution
and FP32 recurrent states, state-driven
[0,4,8]tokens, fresh-generatorreset, and every element of an asymmetric uniform RGB image before prefill.
The complete native toy suite passed all four tests. The proof is a local
operator attestation, not binary-identity verification; rerun it after any
native binary change.
Corrected-RGB native AI2D first 200
All 200 pinned examples completed with native GenAI image processing,
positions, caches and greedy generation, thinking disabled and 16 new
tokens. HF supplied only the unchanged chat template and independent
diagnostics, never model inputs. Torch/raw ORT below are the frozen October 7
references, not fresh reruns.
Native IDs, image grids and pixel shapes equal HF for 172/200, not all
200. All 28 grid mismatches are explained by native smart-resize
half-away rounding versus HF ties-to-even rounding; both models predict
their respective observed grids for all 200 records. Index 130 has original
width 400: native resizes to 416, HF to 384 (factor 32), and native answers B
versus HF/raw ORT D. This coincidence is not proof that resizing alone caused
the answer difference. At index 124, native matches HF C while raw ORT
answered A.
Among the 172 shape-comparable records, maximum pixel absolute error is
0.0156863928 and minimum correlation is 0.9999995187. The 28 different-shape
records are not counted as pixel-parity passes. Runtime-side resize alignment
is deferred and explicitly documented; no unsupported metadata flag or
caller-side pre-resize workaround was introduced.
This is completed execution/task evidence, not preprocessing or full-logit
parity, production accuracy, or a full 3,088-example AI2D score. The prior
official FP16 numerical blocker and unchanged
1e-2tolerances remain.Regression and review status
independently passed above, three uncached integration cases deselected.
Four failures were a legacy fingerprint fixture still including the new
unset state-policy field; its original-byte reference was corrected. The
fifth required a real CUDA device for BF16 vision. All five focused
reruns passed. The other two failures reproduce on the exact PR base in
this environment: missing GenAI distribution metadata in the pinned
0.15.2 evidence test, and a GGUF shard-identity mutation expectation.
They are not claimed fixed or hidden by new skips.
exits 0 with no warnings/blockers: Gemma2 105 -> 105 nodes; Qwen3.5 text
127 -> 131, with the required Q/K epsilon retained. Only positively known
FLOAT identity casts are removed; FP16/unknown-type FP32 math remains.
Critical/Major Mobius implementation findings.
No Critical/Major finding was rejected. Attributed non-blocking questions
remain: critical/integration reviewers' binary-attestation automation and
inherited processor-load fallback policy; deep review's legacy text alias
numerical equivalence and unused ABI template computation; integration
review's future concurrent symlink replacement (no actual writer mutation);
deep review's future stale dtype annotations (not a current defect).
Not checked/qualified: actual Windows execution, broad CPU/DML, full official
logit/state parity, real-weight video/mixed-media, full AI2D, ModelBuilder,
PagedAttention/fused-MoE alignment, MTP/quantization, capture/serving or
controlled throughput. The local utility assumes operator-controlled paths
and receipts, not a hardened concurrent service.
Receipts remain on the qualification disk:
genai-integration/ai2d-native-rgb-fixed-first200-01/,genai-integration/native-smart-resize-diagnosis.json,genai-integration/review-f3-receipt.json, andgenai-integration/ci-benchmark-exact-comparison.txt.The original dirty checkout is preserved. The superseded 54,779,725,653-byte
ONNX export was removed; the corrected 54,779,987,399-byte package is retained.
Input-size and repeated-inference findings (October 11, 2026)
The completed native AI2D200 result remains 174/200 (87%), compared with frozen HF 175/200 (87.5%) and raw ORT 174/200 (87%). Native/HF tokens matched 199/200 and native/raw tokens 198/200. AI2D used one process and one Model for all 200 questions, with a fresh Generator per question; it was not a per-question process-isolation run.
Generation was capped at 16 tokens. These are bounds of the tested subset, not dataset-wide maxima or a validated deployment-safe limit.
A separate large-image memory diagnostic used 4,875 prompt tokens, 19,200 patch rows, and a 128-token cap. The first call completed; a second identical call on the same Model with a new Generator failed at decoder layer 3
Attention_node_335, requesting 4,563,000,320 bytes. After the first call, GPU usage was 81,133 MiB with only 20 MiB free; deleting the Generator and GC did not reduce usage while the Model stayed alive. Process exit restored 81,150 MiB free / 4 MiB used. The first call exactly matched the standalone tokens, text, processor tensors, and prompt.This diagnostic used an isolated GenAI build, source
265917c09ffe68198a026e086d21e694cc938298, with a one-line last-token logits allocation correction and package-local$ORIGINRPATH; actual loaded installed ORT SHA256 remained5a2e81ad05259bce596e29d6361fe76750b6c2c9569b8cdddf709ab0d944b0ee. Graphs, weights, images, and generation policy were unchanged. It is not the installed GenAI binary used for AI2D200; the installed GenAI source origin is unknown. The external GenAI correction is not included in this Mobius PR and does not resolve repeated-inference OOM.The decoder export has 16 standard Attention nodes, explicit FP16 masks, dynamic KV ports, and no TensorScatter. The inspected ORT unfused workspace formula exactly matches the allocation:
2 * align256(24 * 4875 * 4875 * 4) = 4,563,000,320. The local dispatch excludes Flash with an explicit mask and excludes MEA for a masked KV stride not divisible by four (4875 % 4 = 3). This strongly supports an unfused-workspace attribution, not a directly captured installed-binary dispatch trace; the inspected ORT source-to-binary correspondence remains unverified. Other large-image attempts also failed in the vision encoder.The repeated-inference memory blocker is reproducible, but live tensor ownership, arena retention, and fragmentation are not yet distinguished. A KV-cache leak is not proven, and static TensorScatter cache has not been A/B tested. Deployment requires validated processor-output limits, generation/concurrency budgets, and repeated mixed-size request testing, rather than assuming a successful isolated inference or AI2D subset qualifies serving stability.
Per the narrowed publication scope, no MMMU accuracy result is claimed. Existing official FP16 numerical parity failures, native/HF resize differences, and incomplete historical L4/L5 CI remain open; this update does not declare merge/deployment readiness. Detailed evidence and historical CI disposition are recorded in
docs/design/qwen38-27b-standard-onnx.md. Qualification-disk receipts includegenai-runtime-fix-01/probes/candidate-case56-repeat01/{receipt,execution}.jsonand the unchanged AI2D200 artifacts.