feat(gpt-oss): expert offloading Phase 3 — wire dispatch + device_memory_ratio tunable - #153
Merged
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>
added 2 commits
August 14, 2026 19:44
…o feat/gpt-oss-offload-phase3 # Conflicts: # core/parallel/expert_module.cpp # moe_infinity/runtime/model_offload.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 3 of RFC #137 — makes gpt-oss expert offloading actually usable + tunable. Stacked on Phase 2 (#152).
Changes:
_gpt_oss_offload_enabled()selects resident vs offload fromdevice_memory_ratio(< _GPT_OSS_RESIDENT_RATIO⇒ offload). Resident stays the default and is byte-identical when offload is off.expert_executor/expert_prefetcherintoSyncGptOssMLPand route through the Archer dispatcher when offload is enabled;_load_resident_gpt_ossretained as fallback.ForwardHelperparity test (exercises the C++ path, not just the Python proxy) +cudaMemcpyAsyncdtype guard inexpert_module.cpp.Validation: Phase 1/2 + native regression 18 passed; Phase 3 policy/wiring 14 passed; extension builds (SM120); ruff + LSP clean; fp32-golden envelope intact.
The cached gpt-oss-20b smoke is blocked before inference by a Phase 1 limitation: per-expert expansion assumes all 6 packed components (gate_up/down blocks+scales+bias) are co-located in one checkpoint shard, but
gate_up_proj_biasfor layer 6 lives in a different safetensors shard ⇒missing gate_up_proj_bias while expanding layer 6. Offload is unit/synthetic-validated but NOT yet runnable on real sharded checkpoints until shard-boundary bias handling is fixed (follow-up). Resident path is unaffected.Completes the wiring for RFC #137; the shard fix is the remaining item for real-model offload. Plan:
docs/superpowers/plans/2026-08-14-gpt-oss-expert-offloading.md.