[KongchangAI]
· 1 min read· 935 words

PyTorch Acceleration on AMD GPUs: FlyDSL Operator Library Officially Integrated

PyTorch Acceleration on AMD GPUs: FlyDSL Operator Library Officially Integrated

AMD MI350 GPU users can directly call FlyDSL through existing PyTorch operator APIs to accelerate core operators.

PyTorch's official blog announced that AMD MI350 series GPU users can now directly use FlyDSL through the existing operator API, covering dense and grouped GEMM, fused multi-head attention, MXFP8/MXFP4 scaled GEMM, RMSNorm, TopK, and other core operations. Developers do not need to rewrite model code or switch frameworks; the underlying layer automatically routes to the FlyDSL implementation, and existing training and inference scripts can benefit with almost zero changes. These operators basically cover the critical path of large models from training to inference, especially aligning with the low-bit quantization trend. However, current support is limited to the MI350 series, and the official announcement has not disclosed performance data, comparisons with rocBLAS/composable_kernel, or FlyDSL's own implementation details, so at this stage it is more appropriate to regard it as an availability announcement. PyTorch's official publication also reflects deepening collaboration between AMD and the PyTorch ecosystem.

PyTorch's official blog has announced that users of AMD MI350 series GPUs can now directly use FlyDSL through the existing operator API, covering dense and grouped GEMM, fused multi-head attention (FMHA/Attention), MXFP8/MXFP4 scaled GEMM, RMSNorm, and TopK and other core operations. This means developers can get accelerated support for these operators on AMD's new-generation hardware without rewriting model code or switching frameworks.

FlyDSL integration announcement

Why FlyDSL's integration is worth watching

The availability of AMD GPUs in the PyTorch ecosystem has always been a focus for developers. In the past, many high-performance operators relied on vendor-specific libraries or hand-written kernels, resulting in high migration costs. FlyDSL's integration path chose to "stay compatible with existing APIs"—users continue to call familiar interfaces such as torch.matmul and F.scaled_dot_product_attention, and the underlying layer automatically routes to the FlyDSL implementation. This design lowers the barrier to trying it out and lets existing training and inference scripts benefit with almost zero changes.

Judging from the operator list, FlyDSL targets the most time-consuming parts of large-model workloads: GEMM is the foundation of linear layers in Transformers, FMHA is the core of attention, and MXFP8/MXFP4 correspond to low-precision quantized inference scenarios. RMSNorm and TopK serve normalization and sampling respectively. This combination basically covers the critical path from training to inference.

Technical details and applicable boundaries

According to the official description, FlyDSL exposes its capabilities through "existing operator APIs" rather than introducing a new front-end interface. For dense GEMM and grouped GEMM, PyTorch's dispatch layer selects the appropriate backend based on tensor shapes and hardware type; for attention, FMHA's fused implementation can reduce intermediate memory reads and writes. Support for MXFP8/MXFP4 scaled GEMM follows the low-bit quantization trend and is especially suitable for memory-constrained inference deployments.

The currently confirmed support scope is the MI350 series. This means MI300 or other AMD GPU users cannot directly obtain equivalent acceleration for the time being and will need to wait for future expansion. In addition, the official announcement is short and does not disclose specific performance improvement numbers, comparison data with rocBLAS/composable_kernel, or implementation details of FlyDSL itself (for example, whether it is based on MLIR or a custom DSL). These information gaps mean that at this stage it is more appropriate to view it as an "availability announcement" rather than a complete performance evaluation.

GEMM (General Matrix Multiplication) is the most computationally intensive basic operation in deep learning. The linear layers of Transformers and the Q/K/V projections in attention can all be reduced to GEMM. Dense GEMM refers to conventional matrix multiplication, while grouped GEMM (Grouped GEMM) packages multiple matrix multiplications of different shapes into a single kernel call. It is typically used for parallel computation of different expert weights in MoE (Mixture of Experts) models and can significantly reduce kernel launch overhead.

FMHA (Fused Multi-Head Attention) fuses multiple steps of attention (QK^T, softmax, multiplication with V) into a single GPU kernel for execution, avoiding repeated writes of intermediate results to memory, thereby reducing bandwidth pressure and improving throughput. It is a key optimization for long-sequence inference.

MXFP8/MXFP4 are microscaling low-precision formats proposed by OCP. Each data block shares a scaling factor, compressing the bit width to 8 bits or 4 bits while preserving the numerical range. They are suitable for large-model inference constrained by memory and bandwidth.

rocBLAS is AMD's BLAS library (analogous to NVIDIA cuBLAS), providing basic linear algebra routines such as matrix multiplication; composable_kernel (CK) is AMD's high-performance operator template library, often used to implement fused operators and low-precision GEMM. The relationship between FlyDSL and the two determines its position in the software stack: whether it acts as a higher-level domain-specific language for generating kernels or wraps the dispatch layer of existing libraries has not yet been clearly stated officially.

MLIR is a multi-level intermediate representation framework in the LLVM ecosystem, and many modern operator DSLs (such as parts of Triton's backend) are built on it. If FlyDSL adopts the MLIR route, it means better composability and cross-hardware expansion potential, which is also an important clue for evaluating its long-term maintainability.

Practical significance for developers

For teams already running PyTorch on AMD GPUs, this integration provides a low-cost optimization path: after upgrading the PyTorch version, simply check whether operators hit the FlyDSL backend. For teams evaluating AMD hardware, the expanded operator coverage reduces concerns about an "incomplete ecosystem," but final decisions still need to rely on actual benchmark tests.

One signal worth noting is that PyTorch's official blog personally published this news, indicating that collaboration between AMD and the PyTorch Foundation is deepening. An operator library entering the mainline ecosystem in a "plug-and-play" manner is more conducive to long-term maintenance than maintaining a separate fork.

Triton is an open-source GPU programming language led by OpenAI and has supported the AMD backend, allowing developers to write custom high-performance kernels in Python. The difference between FlyDSL and Triton is that Triton targets developers who need to hand-write kernels, while FlyDSL provides out-of-the-box acceleration through "automatic routing of existing operator APIs." The two are more likely to be complementary rather than replacements. To determine whether the FlyDSL backend is hit, you can use PyTorch's profiler or environment variables to enable operator dispatch logs and observe the specific kernel names and source libraries.

Questions to watch

The positioning relationship between FlyDSL and Triton and cuBLAS alternatives is still unclear; the performance of grouped GEMM and FMHA under different sequence lengths needs actual testing; and public data on the error performance of the low-precision format MXFP4 in precision-sensitive tasks is also lacking. It is recommended to follow subsequent benchmark releases and community testing feedback.

#PyTorch#FlyDSL#AMD GPU#MI350#GEMM#FMHA#MXFP8#MXFP4#RMSNorm#TopK
Share:

Related articles