Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ conda env create -n sklearn -f envs/conda-env-sklearn.yml
conda env create -n rapids --solver=libmamba -f envs/conda-env-rapids.yml
```

GPU benchmarks using `sklearnex`'s `device: gpu` rely on scikit-learn's Array API support (`array_api_dispatch`), which requires `SCIPY_ARRAY_API=1` to be set in the environment before running:

```bash
export SCIPY_ARRAY_API=1
```

## 🚀 How To Use Scikit-learn_bench

### Benchmarks Runner
Expand Down
2 changes: 1 addition & 1 deletion configs/BENCH-CONFIG-SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Configs have the three highest parameter keys:
| `data`:`distributed_split` | None | None, `rank_based` | Split type used to distribute data between machines in distributed algorithm. `None` type means usage of all data without split on all machines. `rank_based` type splits the data equally between machines with split sequence based on rank id from MPI. |
|<h3>Algorithm parameters</h3>||||
| `algorithm`:`library` | None | | Python module containing measured entity (class or function). |
| `algorithm`:`device` | `default` | `default`, `cpu`, `gpu` | Device selected for computation. |
| `algorithm`:`device` | `default` | `default`, `cpu`, `gpu` | Device selected for computation. `sklearnex`+`gpu` cases enable sklearn's `array_api_dispatch` and use `dpnp` data by default (see `sklearn_context` below); requires `SCIPY_ARRAY_API=1` to be set in the environment. |

## Benchmark-Specific Parameters

Expand Down
18 changes: 12 additions & 6 deletions configs/common/sklearn.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@
{ "library": "sklearnex", "device": "cpu" }
]
},
"sklearn-ex[cpu,gpu] implementations": {
"algorithm": [
{ "library": "sklearn", "device": "cpu" },
{ "library": "sklearnex", "device": ["cpu", "gpu"] }
]
},
"sklearn-ex[cpu,gpu] implementations": [
{ "algorithm": { "library": "sklearn", "device": "cpu" } },
{ "algorithm": { "library": "sklearnex", "device": "cpu" } },
{
"algorithm": {
"library": "sklearnex",
"device": "gpu",
"sklearn_context": { "array_api_dispatch": true }
},
"data": { "format": "dpnp" }
}
],
"sklearnex spmd implementation": {
"algorithm": {
"library": "sklearnex.spmd",
Expand Down
Loading