Skip to content

Commit b6f38cd

Browse files
authored
Merge pull request #3 from lemonade-sdk/geramy/portable-linux-cpu-build
ci: pin Linux x86_64 cpu+rocm builds to AVX2+FMA+F16C (drop -march=native)
2 parents 7f65f2a + a466f7e commit b6f38cd

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,17 @@ jobs:
5353
run: |
5454
mkdir build
5555
cd build
56-
cmake .. -DGGML_AVX2=ON -DSD_BUILD_SHARED_LIBS=ON
56+
# Disable -march=native and pin CPU instruction set to AVX2+FMA+F16C so
57+
# the released x86_64 binary runs on hosts without AVX-512.
58+
# Without GGML_NATIVE=OFF, ggml's CMake auto-enables every extension
59+
# the build runner's CPU has (including AVX-512 on Azure Xeon
60+
# Platinum 8370C runners), which then SIGILLs on AVX-512-less hosts.
61+
cmake .. \
62+
-DGGML_NATIVE=OFF \
63+
-DGGML_AVX2=ON \
64+
-DGGML_FMA=ON \
65+
-DGGML_F16C=ON \
66+
-DSD_BUILD_SHARED_LIBS=ON
5767
cmake --build . --config Release
5868
5969
- name: Get commit hash
@@ -503,10 +513,16 @@ jobs:
503513
run: |
504514
mkdir build
505515
cd build
516+
# Same portability concern as ubuntu-latest-cmake: pin the host CPU
517+
# instruction set so the binary runs on AVX-512-less ROCm hosts too.
506518
cmake .. -G Ninja \
507519
-DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang" \
508520
-DCMAKE_HIP_FLAGS="-mllvm --amdgpu-unroll-threshold-local=600" \
509521
-DCMAKE_BUILD_TYPE=Release \
522+
-DGGML_NATIVE=OFF \
523+
-DGGML_AVX2=ON \
524+
-DGGML_FMA=ON \
525+
-DGGML_F16C=ON \
510526
-DSD_HIPBLAS=ON \
511527
-DHIP_PLATFORM=amd \
512528
-DGPU_TARGETS="${{ matrix.gpu_targets }}" \

0 commit comments

Comments
 (0)