Add exact dense Qwen programs and shared operator improvements - #43
Closed
kiddyboots216 wants to merge 17 commits into
Closed
Add exact dense Qwen programs and shared operator improvements#43kiddyboots216 wants to merge 17 commits into
kiddyboots216 wants to merge 17 commits into
Conversation
Broly Security ScanNote ✅ Clean scan Note Re-scan this PR anytime with
|
kiddyboots216
force-pushed
the
feature/qwen3-dense-exact-kernels-20260810
branch
from
August 11, 2026 18:01
6da499e to
e5f91b1
Compare
kiddyboots216
changed the base branch from
main
to
chore/update-xorl-submodules
August 11, 2026 18:02
This was referenced Aug 11, 2026
kiddyboots216
force-pushed
the
feature/qwen3-dense-exact-kernels-20260810
branch
from
August 12, 2026 02:05
61d8222 to
f123869
Compare
kiddyboots216
added a commit
that referenced
this pull request
Aug 12, 2026
The cherry-picked #43-chain change makes fused_silu_and_mul one-round for EVERY caller (Qwen2/3, Llama3, OLMo2, DeepSeek-V3, GLM4/5, MoE defaults) — review measured 53,619/196,608 BF16 outputs changed on non-exact paths. An unblocking branch must not silently change non-exact model numerics, so: - src/xorl/ops/fused_silu_and_mul.py: the pre-landing TWO-ROUND module content is restored verbatim as the default program; the one-round FP32 program is ADDITIVE as exact_fp32_silu_and_mul (Hopper Triton kernel + differentiable eager fallback + analytic-backward autograd Function), byte-paired with serving's fp32_silu_and_mul. - qwen3_5 / qwen3_5_moe MLPs dispatch exact_fp32_silu_and_mul ONLY under _qwen35_exact_contract; the qwen3_5_moe serving-value shared-expert site (exact-lane-only code) uses it directly. - qwen3, qwen3_moe, glm5 modeling and the three GLM52 exact tests revert to da77725 byte-for-byte: zero change off the exact path. - tests/ops/test_fused_silu_and_mul_scoping.py pins both sides: default op == two-round reference bytes (and != one-round: discriminating), non-exact Qwen3_5MLP == pre-landing composition bytes, exact Qwen3_5MLP == one-round. Deliberate divergence from the #43 chain end-state (universal one-round), documented in the module docstring and LANDING.md; the chain supersedes this split when it lands.
kiddyboots216
added a commit
that referenced
this pull request
Aug 12, 2026
(cherry picked from commit 8a97bcb, origin/feature/qwen3-dense-exact-kernels-20260810, PR #43 chain — the trainer half of serving-side xorl-sglang f10b907d8, which reached cleanup-tests alone via pin advance d13788d and broke trainer<->sampler byte parity on the dense Qwen3.5-0.8B exact pair; hunt record: results/k3_first_divergence/LANE_LOG.md on branch k3-first-divergence) Adaptations for cleanup-tests (da77725): - src/xorl/ops/fused_silu_and_mul.py: context-anchoring conflicts only (cleanup-tests never modified this file since the chain fork); resolved to the 8a97bcb post-image verbatim. - tests/models/test_qwen35_exact_swiglu_policy.py: delete/modify conflict (file exists only on the #43 chain); took the 8a97bcb post-image. - Follow-up 32f6e6c 'Reconcile exact SwiGLU and RMSNorm dispatch gates' is NOT included: its test deletion targets a #43-chain-only file absent here, and its bi_families_v2.py retune presupposes the chain's earlier 4-arg _v2_norm_use_split (Hopper RMSNorm trainer work). That dispatch gate is perf-only per its own contract docstring, and byte-neutrality of the RMSNorm realizations is measured (16384/16384 pair equality at serving pin c4de30cba, which contains the serving-side Hopper routing 91c90570a). It lands with the full #43 chain.
kiddyboots216
added a commit
that referenced
this pull request
Aug 12, 2026
8a97bcb's diff presupposes its chain parent: the two Qwen3.5 MLP __init__ hunks that force the fused (one-round FP32) SwiGLU path whenever _qwen35_exact_contract is set, overriding _activation_native. On the #43 chain they land in 55548e7 ('Add exact Qwen3-8B training numerics'); this commit extracts EXACTLY those two hunks (nothing else — the Qwen3-8B exact admission, bi_families_v2 additions, and the since-deleted two-round test stay with the chain). With them, both files are byte-identical to the 8a97bcb post-image, and tests/models/test_qwen35_exact_swiglu_policy.py passes. Without this, the exact Qwen3.5 lane keeps activation_native=True and the two-round eager SwiGLU, and the trainer<->sampler byte divergence persists (the policy test catches it: _use_fused_silu False under the exact config).
kiddyboots216
added a commit
that referenced
this pull request
Aug 12, 2026
Restores the byte coverage deleted with the old two-round test (32f6e6c on the #43 chain), now asserting the intended end-state (user-confirmed): the DEFAULT fused_silu_and_mul == the one-round FP32 reference bytes and != the two-round reference (discriminating power), for exact and non-exact callers alike — a non-exact Qwen3_5MLP and the exact-contract Qwen3_5MLP both match the one-round composition bitwise. The non-exact byte change is deliberate, reviewed #43 intent; this gate pins it so a silent re-scoping or two-round regression fails loudly.
This was referenced Aug 13, 2026
Contributor
Author
|
Superseded by #57, which consolidates the complete exact trainer-serving stack directly onto main. |
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.
Summary
Stack
762205400ad0b136817c3a3f6658f39500d2ded11fc3396aa122e0f8eb7b1ea4fe0051250cf1bc3cf1238691852d5436541ec8ea0bcb8d5a018c3752Validation
ruff check: passed.git diff --checkand recursive submodule cleanliness: passed.git range-diffpreserves all 12 live payload commits plus the lifecycle repair; only the obsolete intermediate sampler-pin delta collapses into the corrected Update XoRL submodule branches and SGLang pin #41 base.