Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Razdoburdin committed Nov 16, 2023
1 parent 6aa6a39 commit ec08420
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 4 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/python_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,64 @@ jobs:
run: |
pytest -s -v -rxXs --durations=0 ./tests/test_distributed/test_with_spark
python-sycl-tests-on-ubuntu:
name: Test XGBoost Python package with SYCL on ${{ matrix.config.os }}
runs-on: ${{ matrix.config.os }}
timeout-minutes: 90
strategy:
matrix:
config:
- {os: ubuntu-latest, python-version: "3.8"}

steps:
- uses: actions/checkout@v2
with:
submodules: 'true'

- uses: mamba-org/provision-with-micromamba@f347426e5745fe3dfc13ec5baf20496990d0281f # v14
with:
cache-downloads: true
cache-env: true
environment-name: linux_cpu_test
environment-file: tests/ci_build/conda_env/linux_cpu_test.yml

- name: Display Conda env
run: |
conda info
conda list
- name: Install SYCL runtime
run: |
sudo apt-get update
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo add-apt-repository -y "deb https://apt.repos.intel.com/oneapi all main"
sudo apt-get update
sudo apt-get install -y intel-dpcpp-cpp-compiler-2023.2.1
- name: Build XGBoost on Ubuntu
run: |
source /opt/intel/oneapi/compiler/latest/env/vars.sh
source /opt/intel/oneapi/tbb/latest/env/vars.sh
icpx --version
sycl-ls
mkdir build
cd build
cmake .. -DPLUGIN_SYCL=ON -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
make -j$(nproc)
- name: Install Python package
run: |
cd python-package
python --version
pip install -v .
- name: Test Python package
run: |
pytest -s -v -rxXs --durations=0 ./tests/python-sycl/
python-system-installation-on-ubuntu:
name: Test XGBoost Python package System Installation on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion tests/python-sycl/test_sycl_prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_predict(self):
cpu_pred_test = bst.predict(dtest, output_margin=True)
cpu_pred_val = bst.predict(dval, output_margin=True)

bst.set_param({"device": "sycl:gpu"})
bst.set_param({"device": "sycl"})
sycl_pred_train = bst.predict(dtrain, output_margin=True)
sycl_pred_test = bst.predict(dtest, output_margin=True)
sycl_pred_val = bst.predict(dval, output_margin=True)
Expand Down
2 changes: 1 addition & 1 deletion tests/python-sycl/test_sycl_training_continuation.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def run_training_continuation(self, use_json):
X = np.random.randn(kRows, kCols)
y = np.random.randn(kRows)
dtrain = xgb.DMatrix(X, y)
params = {'device': 'sycl:gpu', 'max_depth': '2',
params = {'device': 'sycl', 'max_depth': '2',
'gamma': '0.1', 'alpha': '0.01',
'enable_experimental_json_serialization': use_json}
bst_0 = xgb.train(params, dtrain, num_boost_round=64)
Expand Down
2 changes: 1 addition & 1 deletion tests/python-sycl/test_sycl_updaters.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class TestSYCLUpdaters:
@settings(deadline=None)
def test_sycl_hist(self, param, num_rounds, dataset):
param['tree_method'] = 'hist'
param['device'] = 'sycl:gpu'
param['device'] = 'sycl'
param['verbosity'] = 0
param = dataset.set_params(param)
result = train_result(param, dataset.get_dmat(), num_rounds)
Expand Down
2 changes: 1 addition & 1 deletion tests/python-sycl/test_sycl_with_sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_sycl_binary_classification():
for cls in (xgb.XGBClassifier, xgb.XGBRFClassifier):
for train_index, test_index in kf.split(X, y):
xgb_model = cls(
random_state=42, device='sycl:gpu',
random_state=42, device='sycl',
n_estimators=4).fit(X[train_index], y[train_index])
preds = xgb_model.predict(X[test_index])
labels = y[test_index]
Expand Down

0 comments on commit ec08420

Please sign in to comment.