Skip to content
Open
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: 4 additions & 2 deletions src/art/megatron/flex_attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,16 @@ def forward(
)


_compiled_create_block_mask = torch.compile(create_block_mask)
# Sequence-length churn can break the Inductor backend here. Keep this
# on aot_eager instead.
_compiled_create_block_mask = torch.compile(create_block_mask, backend="aot_eager")


def create_shared_prefix_attention_state(
group_ids: Tensor,
parent_ids: Tensor,
) -> SharedPrefixAttentionState:
"""Build a compiled block mask for ART shared-prefix packing.
"""Build a block mask for ART shared-prefix packing.

Initialized on the device of the group_ids tensor.

Expand Down
Loading