Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use combined rms norm for accuracy for dipu #128

Merged
merged 2 commits into from
Sep 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion deeplink_ext/interntrain_ops/rms_norm.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
platform_type = deeplink_ext_get_platform_type()
if platform_type == PlatformType.TORCH_NPU:
# from ._mixed_rms_norm_npu import MixedFusedRMSNorm
# Due to the accuracy problem of the npu fused operator, a torch combination is used as an alternative.
from .rms_norm_fallback import MixedRMSNormTorch as MixedFusedRMSNorm
elif platform_type == PlatformType.TORCH_DIPU:
from ._mixed_rms_norm_dipu import MixedFusedRMSNorm
# from ._mixed_rms_norm_dipu import MixedFusedRMSNorm
# Due to the accuracy problem of the npu fused operator, a torch combination is used as an alternative.
from .rms_norm_fallback import MixedRMSNormTorch as MixedFusedRMSNorm
else:
raise ImportError

Expand Down
Loading