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
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_opspackage. As aresult, importing an unrelated module such as
RMSNormcan fail in an environment withoutOmni 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 RMSNormThe 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, andGroupedExpertsreplacements, should work without installingomni_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_opspasses for top-level imports, functional/modules imports, Qwen3-MoE registration and RMSNorm
replacement after the fix.
Environment info
veomni_cys