Skip to content
Merged
Show file tree
Hide file tree
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
15 changes: 9 additions & 6 deletions nemo/collections/llm/gpt/model/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,15 @@ def transformer_engine_layer_spec(config: "GPTConfig") -> ModuleSpec:
"""
from megatron.core.models.gpt import gpt_layer_specs

return gpt_layer_specs.get_gpt_layer_with_transformer_engine_spec(
num_experts=config.num_moe_experts,
moe_grouped_gemm=config.moe_grouped_gemm,
qk_layernorm=config.qk_layernorm,
fp8=bool(config.num_moe_experts and (config.fp8 is not None)),
)
kwargs = {
"num_experts": config.num_moe_experts,
"moe_grouped_gemm": config.moe_grouped_gemm,
"qk_layernorm": config.qk_layernorm,
"fp8": bool(config.num_moe_experts and (config.fp8 is not None)),
}
if getattr(config, "use_transformer_engine_op_fuser", None) is not None:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@hemildesai Is backward compatibility necessary here ? Can we just do config.use_transformer_engine_op_fuser

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

kwargs["use_te_op_fuser"] = config.use_transformer_engine_op_fuser
return gpt_layer_specs.get_gpt_layer_with_transformer_engine_spec(**kwargs)


def transformer_engine_full_layer_spec(config: "GPTConfig") -> ModuleSpec:
Expand Down
1 change: 1 addition & 0 deletions nemo/collections/llm/gpt/model/llama.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class LlamaConfig(GPTConfig):
persist_layer_norm: bool = True
bias_dropout_fusion: bool = True
apply_rope_fusion: bool = True
use_transformer_engine_op_fuser: Optional[bool] = None

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

False seems more simpler ?



@dataclass
Expand Down