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

Remove Apex dependency if not using MixedFusedLayerNorm #10468

Merged
merged 2 commits into from
Sep 16, 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
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,6 @@ def __init__(
**kwargs,
):
super().__init__()
if not HAVE_APEX:
logging.info("Apex is required to use ParallelLinearAdapters.")
raise RuntimeError("ParallelLinearAdapter can not run without Apex.")
if not HAVE_MEGATRON_CORE:
logging.info("Megatron-core is required to use ParallelLinearAdapters.")
raise RuntimeError("ParallelLinearAdapter can not run without Megatron-core.")
Expand Down Expand Up @@ -227,6 +224,7 @@ def __init__(
if self.norm_position in ["pre", "post"]:
ln_features = in_features if self.norm_position == "pre" else out_features
if norm_type == 'mixedfusedlayernorm':
assert HAVE_APEX, "Apex is required to use MixedFusedLayerNorm"
self.layer_norm = MixedFusedLayerNorm(ln_features, 1e-5, sequence_parallel_enbaled=False)
elif norm_type == 'layernorm':
self.layer_norm = nn.LayerNorm(ln_features)
Expand Down
Loading