FlyDSL - ROCm Domain Specific Language for layout algebra (Python + embedded MLIR runtime)
pip install flydsl==0.5.5
A Python DSL and a MLIR stack for authoring high‑performance GPU kernels with explicit layouts and tiling.
A Python DSL and a MLIR stack for authoring high‑performance GPU kernels with explicit layouts and tiling.
FlyDSL is the Python front‑end of the project: a Flexible Layout Python DSL for expressing tiling, partitioning, data movement, and kernel structure at a high level.
FlyDSL : FlyDSL is powered by the Fly dialect: an end‑to‑end, MLIR‑native compiler stack for GPU kernels. Its core is the fly dialect—a first‑class layout IR with explicit algebra and coordinate mapping, plus a composable lowering pipeline to GPU/ROCDL.
FlyDSL (Python DSL) : author kernels in Python, compile them through the Fly dialect, and export compiled specializations as linkable C objects Primary package: python/flydsl/ Kernel examples: kernels/ (importable as kernels.* from a source checkout; not installed in the wheel)
Primary package: python/flydsl/
Kernel examples: kernels/ (importable as kernels.* from a source checkout; not installed in the wheel)
Fly dialect : the layout IR and compiler foundation Core abstractions: !fly.int_tuple , !fly.layout , !fly.coord_tensor , !fly.memref Algebra ops: composition/product/divide/partition + coordinate mapping ops
Core abstractions: !fly.int_tuple , !fly.layout , !fly.coord_tensor , !fly.memref
Algebra ops: composition/product/divide/partition + coordinate mapping ops
Embedded MLIR Python runtime ( _mlir ) No external mlir python wheel is required: MLIR python bindings are included with the FlyDSL package/build artifacts
No external mlir python wheel is required: MLIR python bindings are included with the FlyDSL package/build artifacts
Python : Python 3.10+ with pip
ROCm : required for GPU execution, tests, and benchmarks (tested on ROCm 6.x, 7.x)
For most users, install the published package directly:
Build from source only if you are developing FlyDSL itself or need a custom MLIR/LLVM build.
Prerequisites for source builds:
Build tools : cmake (>=3.20), C++17 compiler, optionally ninja
Python deps : nanobind , numpy , pybind11 (installed by scripts/build_llvm.sh ; install them manually if you skip that step)
ROCm device bitcode : scripts/build.sh bundles amdgcn/bitcode/*.bc from the ROCm found via ROCM_PATH / ROCM_ROOT / ROCM_HOME or /opt/rocm , so kernels calling __ocml_* compile wherever the package is later installed. Override with -DFLYDSL_ROCM_BITCODE_DIR= ; skipping it only means those kernels need FLYDSL_COMPILE_ROCM_PATH or ROCM_PATH set at compile time.
If you already have an MLIR build with Python bindings enabled, point to it instead:
Note : If MLIR_PATH is set in your environment pointing to a wrong LLVM build, unset MLIR_PATH first.
Note : If MLIR_PATH is set in your environment pointing to a wrong LLVM build, unset MLIR_PATH first.
The build scripts use python3 on PATH by default. Set PYTHON_EXECUTABLE to select another Python 3.10+ interpreter (including a virtual environment):
LLVM's Python dependencies are installed into that interpreter's environment. Both CMake Python detection passes are pinned to it. Builds launched by python -m pip or python setup.py use that Python interpreter instead of PATH or an inherited PYTHON_EXECUTABLE , so newly built bindings match the wheel ABI. Use a separate FLY_BUILD_DIR for each Python version to avoid reusing old bindings.
Visual Studio 2022 with the C++ tools and the C++ Clang tools, or pass -ClangCl to both scripts.
CMake 3.20+, Ninja and Git on PATH .
64-bit Python 3.10+ in a venv with setuptools and wheel .
In that venv, TheRock wheels for your GPU family ( --index-url ): torch first, then the matching rocm[libraries,devel]== , then rocm-sdk init .
Without a torch that sees the GPU, set FLYDSL_GPU_ARCH (for example gfx1201 ). AOT export ( export_to_c ) writes a COFF .obj ; link it with amdhip64.lib (see docs/api/compiler.rst ).
Tests and examples require pytest , pandas , and a ROCm build of torch (not installed by pip install -e . ):
Test layout, pytest markers, and environment variables used by the suite are documented in tests/README.md .
Wrong LLVM picked up ( std::gcd not found , redeclaration errors) unset MLIR_PATH and let build.sh auto-detect, or set it to the correct path.
Wrong LLVM picked up ( std::gcd not found , redeclaration errors)
unset MLIR_PATH and let build.sh auto-detect, or set it to the correct path.
No module named flydsl Run python -m pip install flydsl . For source checkouts, run python -m pip install -e . after building.
No module named flydsl
Run python -m pip install flydsl . For source checkouts, run python -m pip install -e . after building.
MLIR .so load errors Add MLIR build lib dir to the loader path: export LD_LIBRARY_PATH = $( pwd ) /build-fly/python_packages/flydsl/_mlir/_mlir_libs: $LD_LIBRARY_PATH
Add MLIR build lib dir to the loader path: export LD_LIBRARY_PATH = $( pwd ) /build-fly/python_packages/flydsl/_mlir/_mlir_libs: $LD_LIBRARY_PATH
Add MLIR build lib dir to the loader path:
The skills under .claude/skills/ for authoring, debugging, profiling and optimizing FlyDSL kernels are also published as a Claude Code plugin, so you can use them outside this checkout:
Or from the shell: claude plugin marketplace add ROCm/FlyDSL && claude plugin install flydsl@flydsl . Skills are invoked as /flydsl: (e.g. /flydsl:debug-flydsl-kernel ); update with claude plugin update flydsl@flydsl .
Full documentation: rocm.github.io/FlyDSL
Kernel cache issues (stale results after code changes) The JIT disk cache auto-invalidates on source/closure changes; only needed for C++ pass or non-closure helper changes Clear manually: rm -rf ~/.flydsl/cache or export FLYDSL_RUNTIME_ENABLE_CACHE=0
The JIT disk cache auto-invalidates on source/closure changes; only needed for C++ pass or non-closure helper changes
Clear manually: rm -rf ~/.flydsl/cache or export FLYDSL_RUNTIME_ENABLE_CACHE=0
FlyDSL introduces a layout system to express complex data mapping patterns on GPUs (tiling, swizzling, vectorization).
Shape : The extent of dimensions (e.g., (M, N) ).
Stride : The distance between elements in memory (e.g., (1, M) for column-major).
Layout : A pair of (Shape, Stride) that maps a logical Coordinate to a physical linear Index .
Formula: Index = dot(Coord, Stride) = sum(c_i * s_i)
Construction : make_shape , make_stride , make_layout , make_coord
Mapping : crd2idx(coord, layout) -> index : Convert logical coordinate to physical index. idx2crd(index, layout) -> coord : Convert physical index to logical coordinate.
crd2idx(coord, layout) -> index : Convert logical coordinate to physical index.
idx2crd(index, layout) -> coord : Convert physical index to logical coordinate.
Inspection : size , cosize , rank
Algebra : composition(A, B) : Compose layouts (A ∘ B). product(A, B) : Combine layouts (Logical, Tiled, Blocked, etc.). divide(A, B) : Partition layout A by B (Logical, Tiled, etc.).
composition(A, B) : Compose layouts (A ∘ B).
product(A, B) : Combine layouts (Logical, Tiled, Blocked, etc.).
divide(A, B) : Partition layout A by B (Logical, Tiled, etc.).
🐍 Python API ( flydsl )
@flyc.kernel / @flyc.jit API
On first call, @flyc.jit traces the Python function into an MLIR module, then compiles it through MlirCompiler . The pass list is built by RocmBackend._pipeline_parts() in three stages — see docs/architecture_guide.md for the per-pass table.
Compiled kernels are cached to disk ( ~/.flydsl/cache/ ) and reused on subsequent calls with the same type signature.
⚙️ Hierarchical Kernel Control
FlyDSL keeps the tiling hierarchy explicit across block, warp, thread, and instruction scopes using layout algebra:
With per-level partitions, you can allocate register fragments, emit predicate masks, and schedule MFMA/vector instructions while retaining full knowledge of the execution hierarchy.
🧮 Minimal VecAdd Example
This condensed snippet mirrors examples/01-vectorAdd.py , showing how to define GPU kernels with layout algebra and tiled copies:
See examples/ for more examples including tiled copy ( 02-tiledCopy.py ), tiled MMA ( 03-tiledMma.py ), and preshuffle GEMM ( 04-preshuffle_gemm.py ).
AMD MI300X/MI308X (gfx942), AMD MI350/MI355X (gfx950), gfx1250, Radeon AI PRO R9700 (gfx1201)
Linux / ROCm 6.x and 7.x. Hardware coverage varies by CI runner and revision; consult the current workflow results for validation status.
FlyDSL builds on and is inspired by several projects:
Categorical Foundations for CuTe Layouts — mathematical framework for layout algebra ( companion code )
NVIDIA CUTLASS — CuTe layout algebra concepts (BSD-3-Clause parts only; no EULA-licensed code was referenced)
ROCm AIter — test infrastructure and performance comparison baselines (MIT)
ROCm MORI — multi-GPU communication runtime; its SHMEM/CCO symmetric memory and device-initiated communication primitives power the kernels/comm dispatch/combine and MegaMoE kernels
Triton — Python DSL for GPU kernel authoring
ROCm Composable Kernel — tile-based kernel design patterns for AMD GPUs
HipKittens — minimal, opinionated C++ embedded primitives for fast AMD AI kernels (part of the ThunderKittens family)
Release files for flydsl 0.5.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation .
Built distributions (wheels)
Total release size: 425.3 MB
Release files / flydsl-0.5.5-cp314-cp314-manylinux_2_27_x86_64.whl
Provenance describes where a file came from. On PyPI, provenance is shared via attestations , which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Release files / flydsl-0.5.5-cp313-cp313-manylinux_2_27_x86_64.whl
Provenance describes where a file came from. On PyPI, provenance is shared via attestations , which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Release files / flydsl-0.5.5-cp312-cp312-manylinux_2_27_x86_64.whl
Provenance describes where a file came from. On PyPI, provenance is shared via attestations , which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Release files / flydsl-0.5.5-cp311-cp311-manylinux_2_27_x86_64.whl
Provenance describes where a file came from. On PyPI, provenance is shared via attestations , which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Release files / flydsl-0.5.5-cp310-cp310-manylinux_2_27_x86_64.whl
Provenance describes where a file came from. On PyPI, provenance is shared via attestations , which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Security for flydsl 0.5.5
Provenance describes where a file came from. On PyPI, provenance is shared via attestations , which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
All 5 files in this release have been uploaded with provenance metadata.
Attestation for flydsl-0.5.5-cp314-cp314-manylinux_2_27_x86_64.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Attestation for flydsl-0.5.5-cp313-cp313-manylinux_2_27_x86_64.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Attestation for flydsl-0.5.5-cp312-cp312-manylinux_2_27_x86_64.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Attestation for flydsl-0.5.5-cp311-cp311-manylinux_2_27_x86_64.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Attestation for flydsl-0.5.5-cp310-cp310-manylinux_2_27_x86_64.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
Release history Release notifications | RSS feed
Nov 30, 2026 5 release files Full provenance
Nov 23, 2026 5 release files Full provenance
Nov 24, 2026 5 release files Full provenance
Nov 23, 2026 5 release files Full provenance
Nov 22, 2026 5 release files Full provenance
Nov 20, 2026 5 release files Full provenance
Nov 23, 2026 5 release files Full provenance
Nov 20, 2026 5 release files Full provenance
Nov 19, 2026 5 release files Full provenance
Nov 8, 2026 5 release files Full provenance
Nov 10, 2026 5 release files Full provenance
Nov 10, 2026 5 release files Full provenance
Nov 7, 2026 5 release files Full provenance
Nov 4, 2026 5 release files Full provenance
Nov 3, 2026 5 release files Full provenance
Nov 3, 2026 5 release files Full provenance
Oct 27, 2026 5 release files Full provenance
Oct 31, 2026 5 release files Full provenance
Oct 14, 2026 5 release files Full provenance
Oct 19, 2026 5 release files Full provenance
Oct 15, 2026 5 release files Full provenance
Sep 19, 2026 5 release files Full provenance
Sep 18, 2026 5 release files Full provenance
Sep 18, 2026 5 release files Full provenance
Sep 18, 2026 5 release files Full provenance
Aug 25, 2026 5 release files Full provenance
Aug 9, 2026 5 release files Full provenance
Aug 1, 2026 5 release files Full provenance
Jul 12, 2026 5 release files Full provenance
Jul 9, 2026 5 release files Full provenance
Jun 17, 2026 5 release files Full provenance
Jun 16, 2026 5 release files Full provenance
Jun 4, 2026 5 release files Full provenance
May 16, 2026 5 release files Full provenance
May 11, 2026 4 release files Full provenance
May 8, 2026 4 release files Full provenance
May 2, 2026 4 release files Full provenance
Apr 23, 2026 3 release files Incomplete provenance
Apr 20, 2026 4 release files Incomplete provenance
Apr 14, 2026 2 release files Full provenance
Apr 10, 2026 2 release files Full provenance
Apr 7, 2026 2 release files Full provenance
Mar 20, 2026 2 release files No provenance
Apr 5, 2026 2 release files No provenance
Mar 24, 2026 2 release files No provenance
Feb 8, 2026 2 release files No provenance
The full story
This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.
