Repository navigation
feat(rocm): add Pyhip GR read support for Qwen3.8 Flash Next TP2 and TP4 - #39
Merged
sammysun0711 merged 9 commits intoOct 9, 2026
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Some loaders can silently use incorrectly packed weights, and the default dependency and launch-script configuration introduce deployment failures.
Review effort: Balanced
Findings: 3
Open (4)
What changed in this PR
Adds PyHIP GR-read acceleration for Qwen3.8 Flash Next on ROCm.
Changes:
- Integrates packed PyHIP GR-read weights and warmup paths.
- Adds configuration and launch-script controls.
- Adds gfx942 correctness and lifecycle tests.
| File | Description |
|---|---|
python/sglang/srt/environ.py |
Defines the GR-read environment toggle. |
python/sglang/srt/layers/gr_read_pyhip.py |
Implements PyHIP loading, packing, and warmup. |
python/sglang/srt/layers/hyperconnection.py |
Routes eligible HC mixing through PyHIP. |
python/sglang/srt/model_executor/model_runner.py |
Adds post-load warmup. |
python/sglang/srt/model_executor/runner/decode_cuda_graph_runner.py |
Warms captured decode shapes. |
python/sglang/srt/model_executor/model_runner_components/weight_updater.py |
Rejects unsafe online weight updates. |
scripts/launch_qwen38_flash_next_fp8_mi308x_pure_tp1.sh |
Disables PyHIP for TP1. |
scripts/launch_qwen38_flash_next_fp8_mi308x_pure_tp_4_or_8_or_2.sh |
Configures PyHIP for TP2/4/8 launches. |
test/registered/kernels/test_gr_read_pyhip.py |
Tests API, packing, execution, graphs, and lifecycle. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+51
to
+53
| def process_weights_after_loading(self, module): | ||
| if module._gr_read_weights is not None: | ||
| return |
Owner
Author
There was a problem hiding this comment.
That makes a lot of sense. However, ShardedStateLoader (which typically requires explicitly specifying --load-format sharded_state) and Remote KV are both special weight-loading mechanisms that are not used in our case yet. I’ve added a TODO comment to track this issue.
sammysun0711
reviewed
Oct 8, 2026
sammysun0711
reviewed
Oct 9, 2026
sammysun0711
approved these changes
Oct 9, 2026
sammysun0711
merged commit Oct 9, 2026
182e5e8
into
qwen38-flash-next-amd-current-fix-install
75 of 88 checks passed
sammysun0711
added a commit
that referenced
this pull request
Nov 6, 2026
* [AMD] Tune Qwen3.8 HC mix for MI308X Specialize the BF16 HC mix for the Qwen3.8 shape on 80-CU gfx942 devices using measured Triton launch parameters and smaller row tiles. Expand correctness coverage to 1-16 rows, add graph replay regression tests, and register AMD kernel CI. Validation: 39 tests passed on MI308X. Graph replay with all 100 checkpoint HC weight pairs improves by approximately 2.28x over the original persistent configuration. (cherry picked from commit 8cf5501) * feat(rocm): add Pyhip GR read support for Qwen3.8 Flash Next TP2 and TP4 (#39) * use pyhip gr read * update comments * add comments * update scripts * update setup * update pyproject_other.toml * Revert "update pyproject_other.toml" This reverts commit 9b0cebd. * update pyprojct * update warmup (cherry picked from commit 182e5e8) Ported onto qwen4_v0.5.21 with only the changes the branch's lint requires: - Test moved to test/registered/kernels/ops/gemm/ (kernel test layout) and registered with register_amd_ci (check-registered-tests). - ruff-format applied to the added lines. - Dropped hunks whose context no longer exists: scripts/ TP1 launcher (removed), compressed-tensors bump, and weight_updater call-site edits (call sites already pass the model). * Address review comments on Qwen3.8 GR cherry-pick - hc_mix: use is_gfx942_supported() for the gfx942 check and keep the original num_ctas line. - launch script: drop the duplicate AITER_MOE_PADDING_SIZE export; #86 exports it at its definition. --------- Co-authored-by: apinge <[email protected]> Co-authored-by: tongqiu <[email protected]> Co-authored-by: root <[email protected]> Co-authored-by: Xiake Sun <[email protected]>
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.


Motivation
This PR integrates gr read via pyhip for Qwen3.8 flash next tp2 and tp4. To avoid duplicating code, this PR directly imports the
pyhip.ops.gr_readinterface (tingqli/pyhip#56).Add
SGLANG_GR_READ_FLYDSL(default off) to select the integration or the original path at model construction.Modifications
class PyHIPGRReadMethod's functionprocess_weights_after_loadingwarmup_pyhip_gr_readto warm up compiler cache (especially for prefill case)Accuracy Tests
TP2
Speed Tests and Profiling
T2 profiled with 12kin 350 out 1conc
before prefill (torch compiled)
after prefill (pyhip)
before decode (tuned triton kernel)
after decode (pyhip)
before
after
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ci