Builds and installs FlyDSL (Flexible Layout Python DSL) from source on a remote host or Docker container. Requires LLVM/MLIR build (~30min) then FlyDSL C++ and Python bindings (~5min).
Ships in flydsl. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Build FlyDSL from source on a remote host or Docker container. FlyDSL requires a custom LLVM/MLIR build with Python bindings, followed by the FlyDSL C++ dialect and Python package.
| Argument | Required | Description |
|---|---|---|
[container@host] | No | Target in format container@hostname. If omitted, build locally. Example: [email protected] |
The steps below use $FLYDSL_ROOT for the checkout. Set it before starting; the
container images this skill targets conventionally clone to /FlyDSL, but a
developer checkout is wherever it was cloned:
export FLYDSL_ROOT="${FLYDSL_ROOT:-$PWD}" # or /FlyDSL inside the prebuilt image
-j$(nproc) or -j128)This clones ROCm/llvm-project, checks out the commit specified in thirdparty/llvm-hash.txt,
and builds MLIR with Python bindings.
cd "$FLYDSL_ROOT"
bash scripts/build_llvm.sh -j128
What it does:
https://github.com/ROCm/llvm-project.git to ../llvm-project/thirdparty/llvm-hash.txt../llvm-project/mlir_install/../llvm-project/mlir_install.tgzIf you already have an MLIR build, skip this step and set:
export MLIR_PATH=/path/to/llvm-project/mlir_install
cd "$FLYDSL_ROOT"
bash scripts/build.sh -j128
What it does:
MLIR_PATH from common locations (or uses env var)build-fly/python_packages/flydsl/ with embedded MLIR bindingscd "$FLYDSL_ROOT"
pip install -e .
Or without installing (just set paths):
export PYTHONPATH="$FLYDSL_ROOT/build-fly/python_packages:$FLYDSL_ROOT:$PYTHONPATH"
export LD_LIBRARY_PATH="$FLYDSL_ROOT/build-fly/python_packages/flydsl/_mlir/_mlir_libs:$LD_LIBRARY_PATH"
python3 -c "import flydsl; print('FlyDSL OK')"
bash scripts/run_tests.sh # GEMM correctness tests (~15s)
For building inside a Docker container on a remote host:
# SSH command pattern
ssh -o LogLevel=ERROR <HOST> 'docker exec <CONTAINER> bash -c "cd "$FLYDSL_ROOT" && CMD"'
# Full build sequence (run each step, wait for completion)
ssh ... 'docker exec -d <CONTAINER> bash -c "cd "$FLYDSL_ROOT" && bash scripts/build_llvm.sh -j128 > /tmp/build_llvm.log 2>&1"'
# Monitor: ssh ... 'docker exec <CONTAINER> tail -5 /tmp/build_llvm.log'
# Wait for "LLVM_BUILD_DONE" or "Creating tarball..." followed by completion
ssh ... 'docker exec <CONTAINER> bash -c "cd "$FLYDSL_ROOT" && bash scripts/build.sh -j128"'
ssh ... 'docker exec <CONTAINER> bash -c "cd "$FLYDSL_ROOT" && pip install -e ."'
ssh ... 'docker exec <CONTAINER> bash -c "python3 -c \"import flydsl; print(\\\"FlyDSL OK\\\")\""'
The following directories are build artifacts generated by CMake and should NOT be committed to git:
python/flydsl/_mlir/ — MLIR Python bindings (compiled .so files, platform-specific); absent until you build build/, build-fly/ — CMake build directoriesThese are already in .gitignore. After a fresh clone, run the build steps above to regenerate.
# C++ changes (dialect, MLIR passes):
bash scripts/build.sh -j128
# Python-only changes:
# No rebuild needed — editable install picks up changes automatically.
# Clear kernel cache if stale results:
rm -rf ~/.flydsl/cache
# Or disable disk cache (in-memory cache remains active):
export FLYDSL_RUNTIME_ENABLE_CACHE=0
std::gcd not found or redeclaration errors: Wrong LLVM picked up. unset MLIR_PATH and let build.sh auto-detect.No module named flydsl: Run pip install -e . or set PYTHONPATH..so load errors: Set LD_LIBRARY_PATH to include build-fly/python_packages/flydsl/_mlir/_mlir_libs/.-j64 instead of -j128).exec -d for long builds: Use background mode and monitor log file. LLVM build takes ~30min with 128 cores.| Image | Status |
|---|---|
| rocm/pytorch:rocm7.2_ubuntu24.04_py3.12_pytorch_release_2.8.0 | Verified 2026-03-10 |
What SKILL.md sets; muted values are Claude Code's defaults
/flydsl:build-flydslfrom flydsl
npx claudepluginhub rocm/flydsl --plugin flydsl16 skills in this plugin
/add-target-atom-opAdd a new target-specific Mma / Copy Op type to a FlyDSL backend dialect (`lib/Dialect/Fly<TARGET>/<SUBTARGET>/` + `include/flydsl/Dialect/Fly<TARGET>/IR/`). Covers the MmaOp/CopyOp type design, the stateful-vs-stateless variants, and the `emitAtomCall` / `emitAtomCallSSA` lowering contract to the backend dialect (LLVM/ROCDL/NVVM/SPIR-V/...). Use when adding a new tensor-core / matrix instruction (MFMA, WMMA, HMMA, WGMMA, ...), a new buffer / shared-memory / global copy atom, a new stateful copy (per-atom offset or descriptor), or bringing up a new backend dialect (`FlyPTX`, `FlyCPU`, ...). Reference implementations live in `FlyROCDL`. Usage: /add-target-atom-op
/bisect-perf-regressionFind the exact commit that caused a GPU kernel performance regression using binary search (git bisect). Given a good commit (fast), a bad commit (slow, defaults to HEAD), and a benchmark command, automatically checks out commits, runs the benchmark, extracts the metric, and narrows down to the offending commit. Reports the regression commit with its diff and suggested root cause. Usage: /bisect-perf-regression <good_commit> [bad_commit] -- <bench_cmd>
/build-rocm-imageConnect to a remote host via SSH and build a Docker image with rocprofv3, aiter, and FlyDSL. Use when user wants to build/rebuild the ROCm development image on a remote host. Usage: /build-rocm-image <hostname>
/capture-kernel-traceCapture GPU kernel ATT (Advanced Thread Trace) via rocprofv3 on a remote Docker container or locally. Discovers kernel names, configures input.yaml with the target kernel_include_regex, runs rocprofv3 -i input.yaml with FLYDSL_DEBUG_ENABLE_DEBUG_INFO=1, and downloads the latest ui_output_agent_* directory for analysis. Usage: /capture-kernel-trace <test_script.py> [kernel_name_pattern]
/debug-flydsl-kernelDebug FlyDSL GPU kernels that produce NaN, inf, wrong results, or crash. Covers cache invalidation, tracing pitfalls (runtime conditionals, range vs range_constexpr), loop-carried state packing, buffer_load addressing, MFMA operand layout verification, LDS bank conflict diagnosis, and systematic error isolation (all-1s test, single-partition test, host-side tensor inspection). Use when a FlyDSL kernel produces incorrect output or compilation errors. Usage: /debug-flydsl-kernel
/flydsl-kernel-authoringComprehensive reference for authoring FlyDSL GPU kernels on AMD GPUs. Covers the layout algebra, tiled copy/MMA, buffer ops, loop-carried range loops, SharedAllocator (LDS), autotuning, and common patterns. Use when writing, reviewing, or understanding FlyDSL kernel code.
Other plugins' skills for the same job