Skip to content

Commit da6dc1b

Browse files
committed
Fix issues of attention.core_attention.softmax_offset is None for megatron importer
Signed-off-by: Yue <[email protected]>
1 parent 682bf6d commit da6dc1b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

modelopt/torch/export/plugins/megatron_importer.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,10 @@ def _import_state_dict(self):
512512
self.rules["k_layernorm"](attention.k_layernorm, layer_id)
513513
self.rules["linear_qkv"](attention.linear_qkv, layer_id)
514514
self.rules["linear_proj"](attention.linear_proj, layer_id)
515-
if hasattr(attention.core_attention, "softmax_offset"):
515+
if (
516+
hasattr(attention.core_attention, "softmax_offset")
517+
and attention.core_attention.softmax_offset is not None
518+
):
516519
self.rules["softmax_offset"](
517520
attention.core_attention.softmax_offset, layer_id
518521
)

0 commit comments

Comments
 (0)