feat(moe): serve canonical Fruit QSRT atoms - #129
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe PR adds SiLU support, shared and per-expert SUH handling, allocation-free W4A8 scratch views, prepared multipart execution, dynamic QSRT geometry, stricter validation, and expanded Trellis MoE tests. ChangesTrellis MoE updates
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant WeightPreparation
participant PreparedInput
participant W4A8Runtime
participant ActivationKernel
participant Reduction
Caller->>WeightPreparation: prepare activation and QSRT metadata
Caller->>PreparedInput: validate inputs, routes, and SUH layout
PreparedInput->>W4A8Runtime: provide prepared operands and scratch views
W4A8Runtime->>ActivationKernel: apply silu or situ
ActivationKernel->>Reduction: provide activated expert outputs
Reduction->>Caller: return accumulated MoE output
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
b12x/moe/_shared/kernels/trellis_w4a8.py (1)
262-288: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winValidate
prepared.down_svhbefore FC2 launch.
_validate_prepared_partchecksgate_suhandup_suh, butrun_trellis_w4a8_moe_preparedpassesprepared.down_svhto_w4a16_topk_sum_launch_flatafter FC1, activation rotation, and FC2 routing already ran. A missing or malformeddown_svhraises an AttributeError and leaves scratch partially written. Adddown_svhto the_validate_prepared_partloop and include its row count in the shared/per-expert row check, since preps require the same(1, H)or(num_experts, H)shape.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@b12x/moe/_shared/kernels/trellis_w4a8.py` around lines 262 - 288, The _validate_prepared_part validation currently omits prepared.down_svh. Add down_svh to the tensor validation loop and include its row count in the shared_suh/per-expert expected-row check, requiring it to match gate_suh and up_suh as a contiguous fp16 tensor on the target device with shape (1|E, hidden_size) before FC2 launch.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@b12x/moe/_shared/kernels/trellis_w4a8.py`:
- Around line 262-288: The _validate_prepared_part validation currently omits
prepared.down_svh. Add down_svh to the tensor validation loop and include its
row count in the shared_suh/per-expert expected-row check, requiring it to match
gate_suh and up_suh as a contiguous fp16 tensor on the target device with shape
(1|E, hidden_size) before FC2 launch.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f2003ae0-333b-49fa-a1e6-17a0dc8df2b9
📒 Files selected for processing (2)
b12x/moe/_shared/kernels/trellis_w4a8.pytests/moe/test_fused_moe_trellis.py
🚧 Files skipped from review as they are similar to previous changes (1)
- tests/moe/test_fused_moe_trellis.py
4f59a3d to
1e886ab
Compare
1e886ab to
f4064d0
Compare
|
Rechecked immutable runtime head Master is two commits ahead ( Those upstream changes do not require a Fruit runtime or package-pin change. The sealed runtime image, QSRT package, and vLLM integration authenticate |
Summary
qsrt_atoms_v1geometry (H=1024,I=512, 96 fixed atoms per expert) through the public B12X MoE API.Current canonical head:
f4064d06f029240040a128388f32c861a535ad68.Hot path
Verification
The current head is the exact B12X source fingerprinted into the final runtime image and sealed publication. The full 2,816-expert Fruit Instruct package loaded every routed and MTP layer under vLLM
FULL_AND_PIECEWISECUDA graphs. Runtime-path evidence records W4A16 prompt/prefill and W4A8 decode graph capture and replay, including the packaged MTP layer.The sealed matched protocol used one immutable RTX 5090 image, launch order QSRT → BF16 → SIQ, TP1,
max_num_seqs=1, identical prompt tokens/settings, and three warmed repetitions per arm:These rates include serving/request overhead and are not decode-only or general-throughput claims. QSRT used 68.14% less loader weight memory than BF16 and 4.32% less than SIQ; its median rate was 4.35% below BF16 and 0.69% below SIQ under this exact protocol.
Across 5,870 full-vocabulary BF16-reference positions:
All three arms passed 0/8 focused absolute behavior contracts. The result qualifies storage, loading, bounded runtime execution, and relative fidelity—not assistant quality.
Publication
malaiwah/GLM-5.2-QSRT-Fruit-Instruct@cba27c73.2113af303f37cedf4b538dcf68eb699d5e31f7df.0429cb4c11ad7a67ec8b40b621eae061a363b6cb.sha256:e1b411c3c1ef02e0e8be966de31d727f04683f93d0c61711cb6ae703c9ee8a19.41f32656b7cc68e4c1bc6cec8c91964672ff2ff0ff989448a6d5f37e3b7fb9c3.c56f33b5da5e813d83152c5775288c5364c74205a3d70aacf528eafdc327ea78(B12X distribution1.2.3).Scope
Only TP1 physical serving is qualified. TP2 atom ownership is unit-tested but was not physically served on this single-GPU host. The sparse-prefill integration enforces
max_num_seqs=1; this PR does not claim broader concurrency, TP>1, long-context qualification, standardized benchmark quality, or general assistant capability.Depends on local-inference-lab/qsrt#4 and local-inference-lab/vllm#269.