| #!/usr/bin/env bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| set -euo pipefail |
|
|
| echo "[runtime] $(date -u +%H:%M:%S) starting feather runtime setup on $(hostname)" |
|
|
| |
| python -c 'import torch; assert torch.cuda.is_available(), "cuda unavailable at runtime start"; print("[runtime] cuda OK —", torch.cuda.get_device_name(0))' |
|
|
| |
| apt-get update -qq |
| apt-get install -y -qq --no-install-recommends git curl ca-certificates build-essential pkg-config libssl-dev |
| |
| curl -sSf https://sh.rustup.rs | bash -s -- -y --profile minimal --default-toolchain stable |
| export PATH=/root/.cargo/bin:$PATH |
|
|
| |
| pip install --quiet --upgrade pip setuptools wheel |
| pip install --quiet \ |
| maturin \ |
| huggingface_hub \ |
| requests \ |
| pyarrow \ |
| rustbpe \ |
| pandas \ |
| tiktoken \ |
| pydantic \ |
| ninja \ |
| packaging \ |
| einops |
|
|
| |
| pip install --quiet \ |
| 'https://github.com/Dao-AILab/causal-conv1d/releases/download/v1.6.1.post4/causal_conv1d-1.6.1+cu12torch2.6cxx11abiFALSE-cp311-cp311-linux_x86_64.whl' \ |
| 'https://github.com/state-spaces/mamba/releases/download/v2.3.1/mamba_ssm-2.3.1+cu12torch2.6cxx11abiFALSE-cp311-cp311-linux_x86_64.whl' |
|
|
| |
| SITE=/opt/conda/lib/python3.11/site-packages/mamba_ssm |
| BASE=https://raw.githubusercontent.com/state-spaces/mamba/main |
| curl -fsSL "$BASE/mamba_ssm/modules/mamba3.py" -o "$SITE/modules/mamba3.py" |
| mkdir -p "$SITE/ops/triton/mamba3" |
| for f in __init__.py angle_dt.py mamba3_mimo_rotary_step.py mamba3_mimo_utils.py \ |
| mamba3_siso_bwd.py mamba3_siso_combined.py mamba3_siso_fwd.py \ |
| mamba3_siso_step.py utils.py; do |
| curl -fsSL "$BASE/mamba_ssm/ops/triton/mamba3/$f" -o "$SITE/ops/triton/mamba3/$f" |
| done |
| |
| cp /workspace/feather/hf_jobs/feather_h200_image/mamba_ssm_init.py "$SITE/__init__.py" |
|
|
| |
| python -c 'import torch; assert torch.cuda.is_available(), "cuda broken by installs"; print("[runtime] cuda OK after deps —", torch.cuda.get_device_name(0))' |
|
|
| |
| cd /workspace/feather |
| export HTM_CUDA_ARCH=sm_90 |
| export LD_LIBRARY_PATH=/usr/local/cuda/lib64:${LD_LIBRARY_PATH:-} |
| maturin build --release --features gpu --manifest-path htm_rust/Cargo.toml 2>&1 | tail -5 |
| pip install --quiet htm_rust/target/wheels/htm_rust-*.whl |
|
|
| |
| python -c 'import torch; assert torch.cuda.is_available(), "cuda broken by htm_rust"; import htm_rust; print("[runtime] htm_rust OK, cuda OK")' |
|
|
| echo "[runtime] $(date -u +%H:%M:%S) runtime setup complete" |
|
|