ensure_flydsl

Builds or reuses a version-gated FlyDSL installation for AMD GPU kernel optimization workflows.

178|52|Updated Jul 30, 2025
One-click install
npx skills add https://github.com/AMD-AGI/GEAK --skill ensure-flydsl-amd-agi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ensure_flydsl
Source: https://github.com/AMD-AGI/GEAK/tree/main/perf_knowledge/expert_skills/skills/ensure_flydsl
Command: npx skills add https://github.com/AMD-AGI/GEAK --skill ensure-flydsl-amd-agi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? FlyDSL-based kernel optimization skills fail silently when the flydsl package or its kernels.moe_gemm_2stage module is missing or too old, causing the high-ROI int4-MoE rewrite path to be dropped from the backend ladder. This Skill guarantees that import flydsl, kernels.moe_gemm_2stage resolves from one consistent tree before any downstream FlyDSL author or apply step runs. ## Core Features & Use Cases - Version-gated reuse: Reuses an existing FlyDSL install when its __version__ meets the minimum floor (default 0.2.2), never overwriting newer installs or pip-installing system-wide. - Pinned source build: Clones and builds a known-good FlyDSL commit into an isolated container-internal path, serialized by an flock so concurrent builds cannot corrupt each other. - ROCm image fixes: Applies hip cmake compatibility symlinks and installs patchelf automatically, preventing two common late-stage build failures. - Use Case: During GEAK e2e_workflow Strategize, the System Architect invokes this skill blocking before routing any FlyDSL work, then sources the generated flydsl_env.sh so vLLM and subagents inherit FLYDSL_ROOT, PYTHONPATH, and VLLM_USE_FLYDSL_MOE. ## Quick Start Run the bundled ensure_flydsl.sh script detached with nohup, poll for the flydsl_env.sh success marker or the .flydsl_build.failed marker, then source flydsl_env.sh and verify the flydsl and kernels.moe_gemm_2stage imports.

Frequently Asked Questions about ensure_flydsl

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make FlyDSL importable for GEAK kernel optimization?

Run the bundled ensure_flydsl.sh script detached with nohup, then poll for the flydsl_env.sh success marker. Source that env file and verify with a Python import of flydsl and kernels.moe_gemm_2stage from the same tree.

How to build FlyDSL from source on a ROCm image?

The script clones the pinned FlyDSL commit into /opt/flydsl/FlyDSL, runs build_llvm.sh then build.sh, and verifies the import. It first fixes hip cmake libamdhip64 references and installs patchelf, the two failures that otherwise kill the build late.

Does ensure_flydsl overwrite an existing FlyDSL installation?

No. If an ambient flydsl with kernels imports successfully and its __version__ meets the FLYDSL_MIN_VERSION floor (default 0.2.2), it is reused as-is. Builds only write to the isolated FLYDSL_ROOT and never pip-install system-wide.

Why does the FlyDSL build fail with a hip cmake or patchelf error?

Some ROCm images ship hip-targets cmake files referencing a libamdhip64.so version that does not exist, and FlyDSL's build.sh needs patchelf for its CopyFlyPythonSources step. The script creates compat symlinks and installs patchelf across apt, dnf, yum, apk, or pip before building.

What happens when two FlyDSL builds run at the same time?

An exclusive flock on the build lock file serializes concurrent invocations, and the second waiter re-probes after acquiring the lock. If the first build finished, the second reuses it instead of rebuilding, preventing corrupted ninja outputs.

How long does a from-scratch FlyDSL build take?

A full build including LLVM/MLIR takes roughly 15 to 18 minutes, exceeding a 600-second foreground tool limit. Launch it detached and poll the success or failure marker files with a 30-minute deadline.