Skip to content

Fix: post-load staging regression breaks offload meta/sharded_gpu modes - #38779

Merged
sglang-npu-bot merged 1 commit into
sgl-project:mainfrom
Hide-on-bushsh:offloader
Sep 21, 2026
Merged

sglang-npu-bot merged 1 commit into
sgl-project:mainfrom
Hide-on-bushsh:offloader

Conversation

@Hide-on-bushsh

@Hide-on-bushsh Hide-on-bushsh commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

The offloader (V2, --offload-group-size) intentionally parks offloaded parameters on the meta device through weight post-processing:

  • --offload-mode=meta: all offloaded params become meta at build time (weight loading is a no-op via a replaced weight_loader).
  • --offload-mode=sharded_gpu / shm_cpu: non-rank-0 DP ranks park params on meta during loading (rank 0 owns the real data).

This is by design: device kernels skip meta params (e.g. npu_format_cast has an explicit meta skip), and the old device_loading_context passed meta tensors through untouched. Since #35180, process_weights_after_loading hits the new upfront check and the scheduler dies during startup:
RuntimeError: Cannot post-process meta tensor FusedMoE.w13_weight

The bug is device-agnostic (same code path on CUDA/NPU); it was caught by the NPU offload CI suites (test_npu_offload_modes.py, test_npu_offload_group_size.py).

Modifications

In stage_module_for_post_load(), record tensors that are already meta at context entry and pass them through untouched — no staging, no restore — restoring the pre-#35180 behavior for offloader-parked params.

The original guard is preserved: tensors that become meta during post-load processing still raise, so genuine kernel bugs keep failing fast.

for test_npu_offload_modes.py
before
image
after
image

Accuracy Tests

Speed Tests and Profiling

Checklist

Review and Merge Process

  1. Ping Merge Oncalls to start the process. See the PR Merge Process.
  2. Get approvals from CODEOWNERS and other reviewers.
  3. Trigger CI tests with comments or contact authorized users to do so.
    • Common commands include /tag-and-rerun-ci, /tag-run-ci-label, /rerun-failed-ci
  4. After green CI and required approvals, ask Merge Oncalls or people with Write permission to merge the PR.

CI States

Latest PR Test (Base): ❌ Run #35295705325
Latest PR Test (Extra): ❌ Run #35295705264
Latest PR Test (AMD ROCm 10): ❌ Run #35295705315

@github-actions github-actions Bot added the quant LLM Quantization label Sep 10, 2026
@Hide-on-bushsh Hide-on-bushsh changed the title fix(post_load): skip offloader-resident meta tensors to avoid errors Fix: post-load staging regression breaks offload meta/sharded_gpu modes Sep 10, 2026
@sglang-npu-bot

Copy link
Copy Markdown
Collaborator

/tag-and-rerun-ci

@github-actions github-actions Bot added the run-ci CI: run the baseline test suite on this PR label Sep 11, 2026
@Hide-on-bushsh

Copy link
Copy Markdown
Contributor Author

/rerun-failed-ci

10 similar comments
@Hide-on-bushsh

Copy link
Copy Markdown
Contributor Author

/rerun-failed-ci

@Hide-on-bushsh

Copy link
Copy Markdown
Contributor Author

/rerun-failed-ci

@Hide-on-bushsh

Copy link
Copy Markdown
Contributor Author

/rerun-failed-ci

@Hide-on-bushsh

Copy link
Copy Markdown
Contributor Author

/rerun-failed-ci

@Hide-on-bushsh

Copy link
Copy Markdown
Contributor Author

/rerun-failed-ci

@Hide-on-bushsh

Copy link
Copy Markdown
Contributor Author

/rerun-failed-ci

@Hide-on-bushsh

Copy link
Copy Markdown
Contributor Author

/rerun-failed-ci

@Hide-on-bushsh

Copy link
Copy Markdown
Contributor Author

/rerun-failed-ci

@Hide-on-bushsh

Copy link
Copy Markdown
Contributor Author

/rerun-failed-ci

@Hide-on-bushsh

Copy link
Copy Markdown
Contributor Author

/rerun-failed-ci

@Hide-on-bushsh

Copy link
Copy Markdown
Contributor Author

/rerun-failed-ci

4 similar comments
@Hide-on-bushsh

Copy link
Copy Markdown
Contributor Author

/rerun-failed-ci

@Hide-on-bushsh

Copy link
Copy Markdown
Contributor Author

/rerun-failed-ci

@Hide-on-bushsh

Copy link
Copy Markdown
Contributor Author

/rerun-failed-ci

@Hide-on-bushsh

Copy link
Copy Markdown
Contributor Author

/rerun-failed-ci

@sglang-npu-bot

Copy link
Copy Markdown
Collaborator

only failed test/registered/utils/test_numa_utils.py, and it repaired by #40055

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

quant LLM Quantization run-ci CI: run the baseline test suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants