Skip to content

Commit 68451ef

Browse files
CI: simplify build workflows/scripts
1 parent aee0ebb commit 68451ef

5 files changed

Lines changed: 18 additions & 68 deletions

File tree

.github/scripts/build-cpu.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ set -xeuo pipefail
44
: "${RUNNER_OS:?RUNNER_OS must be set (Linux/Windows/macOS)}"
55
: "${RUNNER_ARCH:?RUNNER_ARCH must be set (X64/ARM64)}"
66

7-
if [[ "${RUNNER_OS}" == "Windows" ]]; then
8-
pip install cmake==3.30.9
9-
else
10-
pip install cmake==3.28.3
11-
fi
12-
137
if [ "${RUNNER_OS}" == "macOS" ] && [ "${RUNNER_ARCH}" == "ARM64" ]; then
148
cmake -DCMAKE_OSX_ARCHITECTURES=arm64 -DCOMPUTE_BACKEND=cpu .
159
else

.github/scripts/build-cuda.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ else
2626
[[ "${CUDA_VERSION}" == 13.*.* ]] && build_capability="75;80;86;89;90;100;120"
2727
fi
2828

29-
[[ "${RUNNER_OS}" == "Windows" ]] && python3 -m pip install ninja
30-
3129
if [ "${RUNNER_OS}" == "Linux" ]; then
3230
# We'll use Rocky Linux 8 in order to maintain manylinux 2.24 compatibility.
3331
image="nvidia/cuda:${CUDA_VERSION}-devel-rockylinux8"
@@ -40,7 +38,6 @@ if [ "${RUNNER_OS}" == "Linux" ]; then
4038
&& cmake -DCOMPUTE_BACKEND=cuda -DCOMPUTE_CAPABILITY=\"${build_capability}\" . \
4139
&& cmake --build . --config Release"
4240
else
43-
pip install cmake==3.28.3
4441
cmake -G Ninja -DCOMPUTE_BACKEND=cuda -DCOMPUTE_CAPABILITY="${build_capability}" -DCMAKE_BUILD_TYPE=Release -S .
4542
cmake --build . --config Release
4643
fi

.github/scripts/build-rocm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if [ "${RUNNER_OS}" == "Linux" ]; then
2020
"apt-get update \
2121
&& pip install cmake==3.31.6 \
2222
&& cmake -DCOMPUTE_BACKEND=hip -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_HIP_FLAGS=\"--offload-compress\" -DBNB_ROCM_ARCH=\"${bnb_rocm_arch}\" . \
23-
&& cmake --build ."
23+
&& cmake --build . --parallel"
2424
else
2525
bnb_rocm_arch="gfx1100;gfx1101;gfx1102;gfx1150;gfx1151;gfx1200;gfx1201"
2626

.github/scripts/build-xpu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if [ "${RUNNER_OS}" == "Linux" ]; then
1414
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
1515
cmake bison intel-fw-gpu intel-ocloc \
1616
&& cmake -DCOMPUTE_BACKEND=xpu . \
17-
&& cmake --build . --config Release"
17+
&& cmake --build . --config Release --parallel"
1818
fi
1919

2020
output_dir="output/${RUNNER_OS}/X64"

.github/workflows/test-runner.yml

Lines changed: 16 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -53,82 +53,41 @@ jobs:
5353
id: config
5454
shell: bash
5555
run: |
56-
# Map platform to OS identifiers, architecture, and test runner
56+
# Map platform to test runner
5757
case "${{ inputs.platform }}" in
5858
linux-x64)
59-
BUILD_OS="ubuntu-22.04"
60-
ARCH="x64"
6159
if [[ "${{ inputs.backend }}" == "cuda" ]]; then
6260
case "${{ inputs.gpu_type }}" in
63-
T4)
64-
TEST_RUNNER="bandb-aws-g4dn-4xlarge-plus-use1-public-80"
65-
;;
66-
A10)
67-
TEST_RUNNER="bandb-aws-g5-4xlarge-plus-use1-public-80"
68-
;;
69-
L40S)
70-
TEST_RUNNER="bandb-aws-g6e-4xlarge-plus-use1-public-80"
71-
;;
72-
*)
73-
echo "::error::Must specify gpu_type (T4, A10, L40S) for linux-x64 cuda backend"
74-
exit 1
75-
;;
61+
T4) TEST_RUNNER="bandb-aws-g4dn-4xlarge-plus-use1-public-80" ;;
62+
A10) TEST_RUNNER="bandb-aws-g5-4xlarge-plus-use1-public-80" ;;
63+
L40S) TEST_RUNNER="bandb-aws-g6e-4xlarge-plus-use1-public-80" ;;
64+
*) echo "::error::Must specify gpu_type (T4, A10, L40S) for linux-x64 cuda backend"; exit 1 ;;
7665
esac
7766
else
7867
case "${{ inputs.cpu_type }}" in
79-
icelake)
80-
TEST_RUNNER="banb-aws-general-8-plus-use1-public-80"
81-
;;
82-
cascadelake)
83-
TEST_RUNNER="bandb-aws-g4dn-4xlarge-plus-use1-public-80"
84-
;;
85-
"")
86-
TEST_RUNNER="ubuntu-22.04"
87-
;;
88-
*)
89-
echo "::error::Invalid cpu_type: ${{ inputs.cpu_type }}"
90-
exit 1
91-
;;
68+
icelake) TEST_RUNNER="banb-aws-general-8-plus-use1-public-80" ;;
69+
cascadelake) TEST_RUNNER="bandb-aws-g4dn-4xlarge-plus-use1-public-80" ;;
70+
"") TEST_RUNNER="ubuntu-22.04" ;;
71+
*) echo "::error::Invalid cpu_type: ${{ inputs.cpu_type }}"; exit 1 ;;
9272
esac
9373
fi
9474
;;
95-
linux-aarch64)
96-
BUILD_OS="ubuntu-22.04-arm"
97-
ARCH="aarch64"
98-
TEST_RUNNER="ubuntu-22.04-arm"
99-
;;
100-
macos)
101-
BUILD_OS="macos-15"
102-
ARCH="arm64"
103-
TEST_RUNNER="macos-15"
104-
;;
75+
linux-aarch64) TEST_RUNNER="ubuntu-22.04-arm" ;;
76+
macos) TEST_RUNNER="macos-15" ;;
10577
windows)
106-
BUILD_OS="windows-2025"
107-
ARCH="x64"
108-
if [[ "${{ inputs.backend }}" == "cuda" ]]; then
109-
TEST_RUNNER="CUDA-Windows-x64"
110-
else
111-
TEST_RUNNER="windows-2025"
112-
fi
113-
;;
114-
windows-arm64)
115-
BUILD_OS="windows-11-arm"
116-
ARCH="arm64"
117-
TEST_RUNNER="windows-11-arm"
78+
[[ "${{ inputs.backend }}" == "cuda" ]] && TEST_RUNNER="CUDA-Windows-x64" || TEST_RUNNER="windows-2025"
11879
;;
80+
windows-arm64) TEST_RUNNER="windows-11-arm" ;;
11981
*)
12082
echo "::error::Unsupported platform: ${{ inputs.platform }}"
12183
exit 1
12284
;;
12385
esac
12486
12587
# Create unique artifact name per configuration
126-
ARTIFACT="lib_${{ inputs.backend }}_${BUILD_OS}_${ARCH}"
127-
if [[ "${{ inputs.backend }}" == "cuda" ]]; then
128-
ARTIFACT="${ARTIFACT}_${{ inputs.cuda_version }}_${{ inputs.gpu_type }}"
129-
else
130-
ARTIFACT="${ARTIFACT}_${{ inputs.cpu_type }}"
131-
fi
88+
ARTIFACT="lib_${{ inputs.backend }}_${RUNNER_OS}_${RUNNER_ARCH}"
89+
[[ "${{ inputs.backend }}" == "cuda" ]] && ARTIFACT="${ARTIFACT}_${{ inputs.cuda_version }}_${{ inputs.gpu_type }}"
90+
[[ "${{ inputs.backend }}" == "cpu" ]] && ARTIFACT="${ARTIFACT}_${{ inputs.cpu_type }}"
13291
ARTIFACT="${ARTIFACT}_torch${{ inputs.torch_version }}_${{ github.run_id }}_${{ github.run_attempt }}"
13392
13493
echo "test_runner=${TEST_RUNNER}" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)