Skip to content

[NPU] Fix load torch_dist weight error - #396

Merged
CalvinXKY merged 9 commits into
vllm-project:ascendfrom
floatlibai:fix/ref-load
Sep 3, 2026
Merged

CalvinXKY merged 9 commits into
vllm-project:ascendfrom
floatlibai:fix/ref-load

Conversation

@floatlibai

@floatlibai floatlibai commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

This PR resolves #380 by implementing the following changes:

  • Fixes the tools/convert_hf_to_torch_dist.py script.
  • Reverts default_megatron_to_hf_mode back to raw.
  • Modify existing 30b testcase to test.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors NPU-specific logic. In tools/convert_hf_to_torch_dist.py, it conditionally imports mindspeed.megatron_adaptor and updates the distributed process group initialization depending on whether an NPU is detected. In vime/utils/arguments.py, the default value for --megatron-to-hf-mode is simplified to always default to "raw". Feedback on these changes highlights that calling is_npu() at the module level in tools/convert_hf_to_torch_dist.py can raise a RuntimeError if no NPU device is available, and suggests wrapping the call in a try-except block to prevent import-time crashes.

Comment thread tools/convert_hf_to_torch_dist.py Outdated
Comment thread vime/utils/arguments.py
Comment thread tests/test_convert_hf_to_torch_dist_npu.py Outdated
@floatlibai
floatlibai force-pushed the fix/ref-load branch 2 times, most recently from d0ba21e to 18d643c Compare September 3, 2026 03:55
Signed-off-by: flb_ <floatlibai@gmail.com>
Signed-off-by: flb_ <floatlibai@gmail.com>
Signed-off-by: flb_ <floatlibai@gmail.com>
Signed-off-by: flb_ <floatlibai@gmail.com>
Signed-off-by: flb_ <floatlibai@gmail.com>
Signed-off-by: flb_ <floatlibai@gmail.com>
Signed-off-by: flb_ <floatlibai@gmail.com>
Signed-off-by: flb_ <floatlibai@gmail.com>
Signed-off-by: flb_ <floatlibai@gmail.com>
@CalvinXKY
CalvinXKY merged commit 745d952 into vllm-project:ascend Sep 3, 2026
4 of 5 checks passed
Meihan-chen added a commit to Meihan-chen/vime that referenced this pull request Sep 9, 2026
Revert f5b8491 (vllm-project#409) and the associated NPU adaptations in 7a27808 and 81ae79d. Defer Qwen3.5 validation to the next stage with a fresh, matched serving and training environment.

Remove the NPU-only GDN interfaces, FLA bootstrap and serving isolation, forced spawn, dedicated scripts/tests/CI entry, and FLA build recipe. Restore the pre-409 Bridge pin and patch while preserving the common TransformerLayer implementation.

Retain S7 vllm-project#385 training-stack migration, vllm-project#396 torch_dist/ref-load, Qwen3-VL fixes, and main Qwen3.5 model code. Serving patches and latest patches are unchanged. No installed environment is rolled back.

Validation: 183 grouped CPU tests passed; Ruff and runner shell syntax passed; common-to-NPU Megatron and reverted Bridge patches pass clean-base apply checks. Existing basic E2E and torch_dist PASS logs are retained; no fresh post-revert E2E was run.
Signed-off-by: Meihan-chen <zr010426ztt@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants