Skip to content
Open
Changes from 1 commit
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
10 changes: 9 additions & 1 deletion miles/backends/megatron_utils/model_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,15 @@ def _apply_bridge_runtime_config(provider, args: argparse.Namespace) -> None:

if hasattr(provider, "dsa_attention_backend"):
provider.dsa_attention_backend = getattr(args, "dsa_attention_backend", "megatron")

# The bridge provider defaults gradient_accumulation_fusion=True
# (via fusions.can_enable_gradient_accumulation_fusion). On ROCm/gfx950,
# this makes TE's LayerNormLinear backward issue a bias-fused wgrad GEMM
# with bf16 inputs → fp32 output + HIPBLASLT_EPILOGUE_BGRADB + accumulate,
# for which hipBLASLt has no algorithm. Honor the Megatron CLI flag so
# that --no-gradient-accumulation-fusion actually takes effect.
provider.gradient_accumulation_fusion = getattr(
args, "gradient_accumulation_fusion", provider.gradient_accumulation_fusion
)
Comment thread
sreerohi marked this conversation as resolved.
Outdated

# Adapt from https://github.com/volcengine/verl/blob/c3b20575d2bc815fcccd84bddb4c0401fc4b632b/verl/models/llama/megatron/layers/parallel_linear.py#L82
class LinearForLastLayer(torch.nn.Linear):
Expand Down