已开启
[Bug]: Importing non-Omni high-performance modules requires optional Omni ops #369
cuiyushi创建于  19 天前
cuiyushi
cuiyushi成员
19 天前 创建

Checklist

🐛 Describe the bug

hyper_parallel.components.modules.__init__ eagerly imports every high-performance module.
Some modules, such as DSA/MHC, use the optional omni_training_custom_ops package. As a
result, importing an unrelated module such as RMSNorm can fail in an environment without
Omni custom ops, even though RMSNorm itself only uses torch_npu.npu_rms_norm.

Minimal reproduction in an environment without omni_training_custom_ops:

from hyper_parallel.components.modules import RMSNorm

The package import should not load DSA/MHC or require Omni for this usage.

Expected behavior

Public high-performance modules should be resolved lazily. Importing and using modules that
do not depend on Omni, including Qwen3-MoE's default RMSNorm, GQAAttention, and
GroupedExperts replacements, should work without installing omni_training_custom_ops.
The dependency should be checked only when an Omni-backed function or module is selected.

Additional context

The functional package already resolves public functions lazily. The modules package needs
the same import boundary. A fresh-process validation that blocks omni_training_custom_ops
passes for top-level imports, functional/modules imports, Qwen3-MoE registration and RMSNorm
replacement after the fix.

Environment info

  • Python 3.11
  • PyTorch/torch_npu environment: veomni_cys
  • Transformers 5.5.3 for the Qwen3-VL/Qwen3-MoE validation
  • Ascend NPU, 8-card DP/FSDP validation
likedislike
cuiyushicuiyushi成员
19 天前 添加了label:bug