Skip to content
Draft
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
3 changes: 3 additions & 0 deletions alto/kernels/dispatch/attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from torchtitan.models.common.attention import (ScaledDotProductAttentionWrapper)

from alto.kernels.fp4.mxfp4.triton_flash_attention_mxfp4 import triton_attention_mxfp4
from alto.kernels.mxfp8.triton_flash_attention_mxfp8 import triton_attention_mxfp8
from .config import TrainingOpConfig

__all__ = ["LPScaledDotProductAttentionWrapper"]
Expand All @@ -20,6 +21,8 @@ def __init__(self, config: TrainingOpConfig):

if isinstance(config, TrainingOpConfig) and config.precision == "mxfp4":
self.attn_func = triton_attention_mxfp4
elif isinstance(config, TrainingOpConfig) and config.precision == "mxfp8_e4m3":
self.attn_func = triton_attention_mxfp8
else:
raise ValueError(f"Unsupported SDPA config: {config}")

Expand Down
273 changes: 273 additions & 0 deletions alto/kernels/mxfp8/MXFP8_ATTENTION_PLAN.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions alto/kernels/mxfp8/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2026 Advanced Micro Devices, Inc.
#
# SPDX-License-Identifier: MIT

from .triton_flash_attention_mxfp8 import triton_attention_mxfp8

__all__ = ("triton_attention_mxfp8", )
Loading