Skip to content

Commit 95e531b

Browse files
authored
add mamba-build (#122)
Required until state-spaces/mamba#729 and state-spaces/mamba#727 are merged and a new mamba release is published on PyPi
1 parent 929bbdb commit 95e531b

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: build mamba ssm
2+
description: "build mamba-ssm"
3+
runs:
4+
using: composite
5+
steps:
6+
- id: build_mamba
7+
name: "build mamba-ssm"
8+
run: |
9+
ORIGINAL_DIR=$(pwd)
10+
11+
cd "$CLIENT_PATH"
12+
bash ${{ github.action_path }}/build_mamba.sh || (echo "mamba build failed" >&2 && exit 1)
13+
shell: bash
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
# this sets the following github actions env vars:
3+
# - whl_file
4+
# - sdist_file
5+
# - WHL_STATUS
6+
set -eu
7+
8+
export MAX_JOBS=$(($(nproc) / 2))
9+
export MAMBA_FORCE_BUILD="TRUE"
10+
export MAMBA_FORCE_CXX11_ABI="FALSE"
11+
export HIP_ARCHITECTURES="gfx942" # MI300X, hardcoded for now. See env-build-nm-vllm-ent PYTORCH_ROCM_ARCH
12+
13+
uv build --wheel --sdist || SUCCESS=$?
14+
SUCCESS=$?
15+
16+
echo "WHL_STATUS=${SUCCESS}" | tee -a "$GITHUB_ENV"
17+
18+
if [ "${SUCCESS}" -ne 0 ]; then
19+
exit 1
20+
fi
21+
22+
MAMBA_WHL="$(find dist -type f -iname "*\.whl" -exec basename {} \;)"
23+
uv run --pre --no-project --with wheel-metadata-injector wheel-metadata-injector "dist/${MAMBA_WHL}"
24+
25+
MAMBA_TARFILE="$(find dist -type f -iname "*\.tar.gz" -exec basename {} \;)"
26+
27+
echo "WHL_FILE=${MAMBA_WHL}" | tee -a "$GITHUB_ENV"
28+
echo "SDIST_FILE=${MAMBA_TARFILE}" | tee -a "$GITHUB_ENV"

0 commit comments

Comments
 (0)