Skip to content
Closed
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
6 changes: 6 additions & 0 deletions megatron/core/transformer/attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ def __init__(
cp_comm_type: str | None = None,
pg_collection: ProcessGroupCollection | None = None,
pp_layer_offset: Optional[int] = None,
is_mtp_layer: bool = False,
name: str | None = None,
):
"""
Expand All @@ -314,6 +315,7 @@ def __init__(
self.config = config
self.layer_number = layer_number
self._pp_layer_offset = pp_layer_offset
self.is_mtp_layer = is_mtp_layer

self.attn_mask_type = attn_mask_type
self.attention_type = attention_type
Expand Down Expand Up @@ -1636,6 +1638,7 @@ def __init__(
cp_comm_type: str | None = None,
pg_collection: ProcessGroupCollection | None = None,
pp_layer_offset: Optional[int] = None,
is_mtp_layer: bool = False,
name: str | None = None,
):
"""
Expand All @@ -1651,6 +1654,7 @@ def __init__(
cp_comm_type=cp_comm_type,
pg_collection=pg_collection,
pp_layer_offset=pp_layer_offset,
is_mtp_layer=is_mtp_layer,
name=name,
)

Expand Down Expand Up @@ -2052,6 +2056,7 @@ def __init__(
attn_mask_type: AttnMaskType = AttnMaskType.padding,
cp_comm_type: str | None = None,
pg_collection: ProcessGroupCollection | None = None,
is_mtp_layer: bool = False,
name: str | None = None,
):
"""
Expand All @@ -2066,6 +2071,7 @@ def __init__(
attention_type="cross",
cp_comm_type=cp_comm_type,
pg_collection=pg_collection,
is_mtp_layer=is_mtp_layer,
name=name,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ def __init__(
pg_collection: ProcessGroupCollection = None,
pp_layer_offset: Optional[int] = None,
name: str | None = None,
is_mtp_layer: bool = False,
):
if pg_collection is None:
pg_collection = ProcessGroupCollection.use_mpu_process_groups()
Expand All @@ -160,6 +161,7 @@ def __init__(
pg_collection=pg_collection,
pp_layer_offset=pp_layer_offset,
name=name,
is_mtp_layer=is_mtp_layer,
)

assert not config.add_bias_linear, "add_bias_linear is not supported for AbsorbedMLA"
Expand Down
Loading
Loading