Inkling-2-Mini-Turbo / docker /build_hyperflare_runtime.sh
Frosty40's picture
Initial staged release: Inkling-2-Mini Turbo (SM120/SM121 lossless recipe + Helios V3 TMLv0 patch)
590b382 verified
Raw History Blame Contribute Delete
3.26 kB
#!/usr/bin/env bash
# CPU-only setup for the CUDA image. Keep the recipe checkout and its lockfile pristine.
set -euo pipefail
recipes=/opt/hyperflare-recipes
engine=/opt/hyperflare-inference
recipe_rev=c79199b126302051e21cbe1467f73af2ebb805c1
engine_rev=84ac035cf381c831fa5a4c93e8b34010845c551e
export DEBIAN_FRONTEND=noninteractive BUILD_NVEP=0 CUDA_HOME=/usr/local/cuda
export PATH="/root/.local/bin:/root/.cargo/bin:/usr/local/cuda/bin:$PATH"
apt-get update -qq
apt-get install -y --no-install-recommends git curl ca-certificates build-essential cmake nasm \
ninja-build pkg-config protobuf-compiler libssl-dev python3-dev liburing-dev patch patchelf
rm -rf /var/lib/apt/lists/*
curl -fsSL https://astral.sh/uv/0.13.9/install.sh | sh
curl --proto '=https' --tlsv1.2 -fsSL https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.94.1
checkout() {
git init -q "$1"
git -C "$1" fetch -q --depth=1 "$2" "$3"
git -C "$1" checkout -q --detach FETCH_HEAD
test "$(git -C "$1" rev-parse HEAD)" = "$3"
}
checkout "$recipes" https://github.com/local-inference-lab/hyperflare-recipes.git "$recipe_rev"
checkout "$engine" https://github.com/NVIDIA/hyperflare-inference.git "$engine_rev"
cd "$recipes"
# c79199b1's locked Ignition predates Recipe.row_shard_prefill_world_sizes.
# Use the lock for everything except that engine pair. Install the recipe CLI last.
uv sync --locked --python 3.12 --extra test --extra api-test --no-install-project \
--no-install-package ignition --no-install-package flare-heliopause
# Host I/O only. b12x builds its loader from the *installed* wheel's C sources
# on first use. Heliopause must be patched before building either Rust artifact.
site=$(.venv/bin/python -c 'from importlib.metadata import distribution; print(distribution("flashinfer-python").locate_file(""))')
(
cd "$site"
echo '48abf92f59dafd772656e2e3c4a178026695f2e4482fe1ab90bb0e02c03b6da5 flashinfer/experimental/b12x/loader/_bounce.c' | sha256sum -c -
patch --batch --forward --fuzz=0 -p1 -i /opt/runtime-io/flashinfer-enosys.patch
)
(
cd "$engine"
echo 'd980d72d5c74c2fda642896c74a0e5fe027e1f1487792767d0a419f2a7a29703 heliopause/src/export/io.rs' | sha256sum -c -
git apply --whitespace=error /opt/runtime-io/heliopause-enosys.patch
)
export CARGO_TARGET_DIR=/tmp/flare-target
cargo build --locked --release --manifest-path "$engine/flare-cli/Cargo.toml" --bin flare
install -m 0755 "$CARGO_TARGET_DIR/release/flare" /usr/local/bin/flare
uv pip install --python .venv/bin/python --no-deps "$engine"
# Native replay in the Mini CUDA tests requires the qualification bindings.
uv pip install --python .venv/bin/python --no-deps "$engine/heliopause" \
--config-settings 'build-args=--locked --features qualification,server,extension-module'
uv pip install --python .venv/bin/python --no-deps -e .
.venv/bin/python -c 'import flare_heliopause, torch, triton, flashinfer'
.venv/bin/ignition export --help >/dev/null
flare --version
.venv/bin/python -m pytest tests/cli/test_inkling2.py tests/recipes/test_inkling2_config.py -q
# Keep the Rust toolchain and preparation headers, not compiler intermediates or wheel caches.
rm -rf "$CARGO_TARGET_DIR" /root/.cache/uv /root/.cargo/{registry,git}