feat(gpt-oss): expert offloading Phase 2 — MXFP4 dequant-on-copy execution - #152
Merged
Conversation
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
added 2 commits
August 14, 2026 19:44
…o feat/gpt-oss-offload-phase2 # Conflicts: # core/parallel/expert_module.cpp # core/parallel/expert_module.h # setup.py
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.
Implements Phase 2 of RFC #137 (Option A: dequant-on-copy). Stacked on Phase 1 (#151).
Changes:
extensions/kernel/v4_fp4/mxfp4_dequant.cu+ binding) — dequantizes fetched packed experts to bf16core/parallel/expert_module.cpp) reusing the bf16 expert GEMM; dedicated dispatcher expert typemxfp4_dequantize(golden test, rel-err 0.0)Numerical review (Oracle): the native
ForwardHelperis algebraically faithful to the resident path (scales, bias,[N,K//2]layout, gate/up split, clamped-SwiGLU, fp32-accumulate). A prior full-forward parity test was passing only by zeroing gate weights (gutted coverage). Replaced with a rigorous fp32-golden + magnitude-envelope parity test using REAL weights (full scale range), verified non-vacuous (injecting a real defect makes it fail). Suite: 16 passed, ruff + LSP clean.Follow-ups (Oracle-flagged, not blocking):
ForwardHelperend-to-end yet (only the Python dequant+matmul proxy) — add a native-dispatch GPU parity test.expert_module.cppcopies inputs via rawcudaMemcpyAsyncinto adtype_buffer — correct for bf16 gpt-oss, but add a dtype guard.Phase 3 (wire
SyncGptOssMLP+device_memory_ratiotunable) remains. Plan:docs/superpowers/plans/2026-08-14-gpt-oss-expert-offloading.md.