Skip to content

Commit

Permalink
Fix FreeBSD and SYCL
Browse files Browse the repository at this point in the history
  • Loading branch information
hcho3 committed Nov 21, 2024
1 parent ebea2b1 commit 904aaee
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 14 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/freebsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,5 @@ jobs:
usesh: true
prepare: |
pkg install -y cmake git ninja googletest bash
run: |
bash ops/script/build_via_cmake.sh
./build/testxgboost
bash ops/pipeline/test-freebsd.sh
13 changes: 2 additions & 11 deletions .github/workflows/sycl_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,8 @@ jobs:
run: |
conda info
conda list
- name: Build and install XGBoost
run: |
bash ops/script/build_via_cmake.sh --conda-env=linux_sycl_test -DPLUGIN_SYCL=ON
- name: Run gtest
run: ./build/testxgboost
run: bash ops/pipeline/build-test-sycl.sh gtest

python-sycl-tests-on-ubuntu:
name: Test XGBoost Python package with SYCL
Expand All @@ -61,11 +58,5 @@ jobs:
run: |
conda info
conda list
- name: Build and install XGBoost
run: |
bash ops/script/build_via_cmake.sh --conda-env=linux_sycl_test -DPLUGIN_SYCL=ON
cd python-package
python --version
pip install -v .
- name: Test Python package
run: pytest -s -v -rxXs --durations=0 ./tests/python-sycl/
run: bash ops/pipeline/build-test-sycl.sh pytest
14 changes: 14 additions & 0 deletions jvm-packages/xgboost4j-example/model/dump.raw.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
booster[0]:
0:[odor=none] yes=1,no=2
1:[spore-print-color=green] yes=3,no=4
3:leaf=1.92847228
4:leaf=-1.87165487
2:[stalk-root=club] yes=5,no=6
5:leaf=-1.63159156
6:leaf=1.78592122
booster[1]:
0:[stalk-root=rooted] yes=1,no=2
1:leaf=-6.24725294
2:[odor=none] yes=3,no=4
3:leaf=-0.967758596
4:leaf=0.784398556
32 changes: 32 additions & 0 deletions ops/pipeline/build-test-sycl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
## Build and test oneAPI

set -euox pipefail

if [[ "$#" -lt 1 ]]
then
echo "Usage: $0 {gtest,pytest}"
exit 1
fi

suite="$1"

mkdir build
pushd build
cmake .. -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON -DPLUGIN_SYCL=ON -DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_C_COMPILER=gcc -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX -GNinja
ninja
popd

case "$suite" in
gtest)
./build/testxgboost
;;
pytest)
cd python-package
python --version
pip install -v .
pytest -s -v -rxXs --durations=0 ./tests/python-sycl/
;;
esac
10 changes: 10 additions & 0 deletions ops/pipeline/test-freebsd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
## Run tests on FreeBSD

set -euox pipefail

mkdir build
cd build
cmake .. -GNinja -DGOOGLE_TEST=ON
ninja -v
./testxgboost

0 comments on commit 904aaee

Please sign in to comment.