Skip to content

Commit

Permalink
make predictor tests training on cpu
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Razdoburdin committed Nov 17, 2023
1 parent 81db75b commit b62e47e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/python-sycl/test_sycl_prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def test_sklearn(self):
tm.make_dataset_strategy(), shap_parameter_strategy)
@settings(deadline=None)
def test_shap(self, num_rounds, dataset, param):
param.update({"device": "cpu"})
param = dataset.set_params(param)
dmat = dataset.get_dmat()
bst = xgb.train(param, dmat, num_rounds)
Expand All @@ -139,11 +140,12 @@ def test_shap(self, num_rounds, dataset, param):
tm.make_dataset_strategy(), shap_parameter_strategy)
@settings(deadline=None, max_examples=20)
def test_shap_interactions(self, num_rounds, dataset, param):
param.update({"device": "cpu"})
param = dataset.set_params(param)
dmat = dataset.get_dmat()
bst = xgb.train(param, dmat, num_rounds)
bst.set_param({"device": "sycl"})
test_dmat = xgb.DMatrix(dataset.X, dataset.y, dataset.w, dataset.margin)
bst.set_param({"device": "sycl"})
shap = bst.predict(test_dmat, pred_interactions=True)
margin = bst.predict(test_dmat, output_margin=True)
assume(len(dataset.y) > 0)
Expand Down

0 comments on commit b62e47e

Please sign in to comment.