Skip to content
Open
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
2 changes: 2 additions & 0 deletions configs/BENCH-CONFIG-SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ Configs have the three highest parameter keys:
|:---------------|:--------------|:--------|:------------|
| `algorithm`:`estimator` | None | | Name of measured estimator. |
| `algorithm`:`estimator_params` | Empty `dict` | | Parameters for estimator constructor. |
| `algorithm`:`method_params`:`{method}` | None | | Parameters for a measured method of estimator. A method listed here is called with these parameters only, without data, which fits methods working off the fitted model such as `HDBSCAN.dbscan_clustering`. |
| `algorithm`:`batch_size`:`{stage}` | None | Any positive integer | Enables online mode for `{stage}` methods of estimator (sequential calls for each batch). |
| `algorithm`:`sklearn_context` | None | | Parameters for sklearn `config_context` used over estimator. `array_api_dispatch` requires `SCIPY_ARRAY_API=1`, which scikit-learn_bench sets by default if it is unset in the environment. |
| `algorithm`:`sklearnex_context` | None | | Parameters for sklearnex `config_context` used over estimator. Updated by `sklearn_context` if set. |
Expand Down Expand Up @@ -140,6 +141,7 @@ List of available special values:
| `algorithm`:`estimator_params`:`scale_pos_weight` | sklearn_estimator | `auto` | Sets `scale_pos_weight` parameter to `sum(negative instances) / sum(positive instances)` value for estimator. |
| `algorithm`:`estimator_params`:`n_clusters` | sklearn_estimator | `auto` | Sets `n_clusters` parameter to number of clusters or classes from dataset description for estimator. |
| `algorithm`:`estimator_params`:`eps` | sklearn_estimator | `distances_quantile:{quantile}` format where quantile is *float* value in [0, 1] range | Computes `eps` parameter as quantile value of distances in `x_train` matrix for estimator. |
| `algorithm`:`method_params`:`dbscan_clustering`:`cut_distance` | sklearn_estimator | `distances_quantile:{quantile}` format where quantile is *float* value in [0, 1] range | Computes `cut_distance` the same way as `eps` above, so that an HDBSCAN hierarchy can be re-cut at the distance DBSCAN is measured at. |

## Range of Values

Expand Down
48 changes: 48 additions & 0 deletions configs/common/hdbscan.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"PARAMETERS_SETS": {
"common hdbscan parameters": {
"algorithm": {
"estimator": "HDBSCAN",
"estimator_params": {
"min_cluster_size": 5,
"min_samples": 5,
"metric": "euclidean",
"cluster_selection_method": "eom",
"allow_single_cluster": false,
"store_centers": null,
"copy": false
},
"estimator_methods": { "training": "fit" }
},
"data": { "format": "numpy", "order": "C", "dtype": "float64" },
"bench": { "n_runs": 3, "time_limit": 1200 }
},
"sklearn hdbscan parameters": {
"algorithm": {
"estimator_params": { "n_jobs": "[SPECIAL_VALUE]physical_cpus" }
}
},
"hdbscan brute method": {
"algorithm": { "estimator_params": { "algorithm": "brute" } }
},
"hdbscan kd_tree method": {
"algorithm": { "estimator_params": { "algorithm": "kd_tree", "leaf_size": 40 } }
},
"hdbscan ball_tree method": {
"algorithm": { "estimator_params": { "algorithm": "ball_tree", "leaf_size": 40 } }
},
"hdbscan tree methods": {
"algorithm": {
"estimator_params": { "algorithm": ["kd_tree", "ball_tree"], "leaf_size": 40 }
}
},
"hdbscan all methods": {
"algorithm": {
"estimator_params": {
"algorithm": ["brute", "kd_tree", "ball_tree"],
"leaf_size": 40
}
}
}
}
}
10 changes: 10 additions & 0 deletions configs/experiments/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,14 @@

`daal4py_svd`: tests performance scalability of `daal4py.svd` algorithm

`hdbscan_gpu_boundaries`: compares `HDBSCAN` on CPU and GPU over `n_samples`, `n_features`, dtypes and metrics, up to sizes stock `sklearn` does not finish.

`hdbscan_parameters`: sweeps the `HDBSCAN` parameter space (metrics, cluster selection, density thresholds, stored centers, dtypes and data formats) over the `sklearn` and `sklearnex` implementations.

`hdbscan_scaling`: tests thread, NUMA, `n_samples` and `n_features` scalability of `HDBSCAN`.

`hdbscan_vs_cuml`: compares `sklearnex` `HDBSCAN` on Intel GPU with `cuml` `HDBSCAN` on NVIDIA GPU.

`hdbscan_vs_dbscan`: compares `HDBSCAN` and its `dbscan_clustering` re-cut with `DBSCAN` at the same distance.

`nearest_neighbors`: tests performance of neighbors search implementations from `sklearnex`, `sklearn`, `raft`, `faiss` and `svs`.
251 changes: 251 additions & 0 deletions configs/experiments/hdbscan_gpu_boundaries.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,251 @@
{
"INCLUDE": ["../common/sklearn.json", "../common/hdbscan.json"],
"PARAMETERS_SETS": {
"sklearnex[cpu,gpu] implementations": [
{
"algorithm": {
"library": "sklearnex",
"device": "cpu"
}
},
{
"algorithm": {
"library": "sklearnex",
"device": "gpu",
"sklearn_context": {
"array_api_dispatch": true
}
},
"data": {
"format": "dpnp",
"order": "C"
}
}
],
"sklearnex gpu implementation": {
"algorithm": {
"library": "sklearnex",
"device": "gpu",
"sklearn_context": {
"array_api_dispatch": true
}
},
"data": {
"format": "dpnp",
"order": "C"
}
},
"boundaries limits": {
"bench": {
"n_runs": 3,
"time_limit": 600
}
},
"blobs n_samples [stock-friendly brute]": {
"data": {
"source": "make_blobs",
"generation_kwargs": {
"centers": 20,
"n_samples": "[RANGE]mul:1000:32000:2",
"n_features": 8,
"cluster_std": 2.0,
"random_state": 42
},
"split_kwargs": {
"ignore": true
}
}
},
"blobs n_samples [large brute]": {
"data": {
"source": "make_blobs",
"generation_kwargs": {
"centers": 20,
"n_samples": "[RANGE]mul:64000:128000:2",
"n_features": 8,
"cluster_std": 2.0,
"random_state": 42
},
"split_kwargs": {
"ignore": true
}
}
},
"blobs n_samples [gpu-only brute]": {
"data": {
"source": "make_blobs",
"generation_kwargs": {
"centers": 20,
"n_samples": "[RANGE]mul:256000:1024000:2",
"n_features": 8,
"cluster_std": 2.0,
"random_state": 42
},
"split_kwargs": {
"ignore": true
}
}
},
"blobs n_samples [stock-friendly tree]": {
"data": {
"source": "make_blobs",
"generation_kwargs": {
"centers": 20,
"n_samples": "[RANGE]mul:1000:128000:2",
"n_features": 8,
"cluster_std": 2.0,
"random_state": 42
},
"split_kwargs": {
"ignore": true
}
}
},
"blobs n_samples [large tree]": {
"data": {
"source": "make_blobs",
"generation_kwargs": {
"centers": 20,
"n_samples": "[RANGE]mul:256000:4096000:2",
"n_features": 8,
"cluster_std": 2.0,
"random_state": 42
},
"split_kwargs": {
"ignore": true
}
}
},
"blobs n_features": {
"data": {
"source": "make_blobs",
"generation_kwargs": {
"centers": 20,
"n_samples": 50000,
"n_features": "[RANGE]pow:2:1:8",
"cluster_std": 2.0,
"random_state": 42
},
"split_kwargs": {
"ignore": true
}
}
},
"blobs n_features [large tree]": {
"data": {
"source": "make_blobs",
"generation_kwargs": {
"centers": 20,
"n_samples": 200000,
"n_features": "[RANGE]pow:2:2:6",
"cluster_std": 2.0,
"random_state": 42
},
"split_kwargs": {
"ignore": true
}
}
},
"both dtypes": {
"data": {
"dtype": ["float32", "float64"]
}
},
"other metrics": {
"algorithm": {
"estimator_params": {
"metric": ["manhattan", "chebyshev"]
}
}
}
},
"TEMPLATES": {
"boundaries n_samples [brute]": {
"SETS": [
"sklearn-ex[cpu,gpu] implementations",
"common hdbscan parameters",
"sklearn hdbscan parameters",
"hdbscan brute method",
"blobs n_samples [stock-friendly brute]",
"boundaries limits"
]
},
"boundaries n_samples [brute, large]": {
"SETS": [
"sklearnex[cpu,gpu] implementations",
"common hdbscan parameters",
"hdbscan brute method",
"blobs n_samples [large brute]",
"boundaries limits"
]
},
"boundaries n_samples [brute, gpu only]": {
"SETS": [
"sklearnex gpu implementation",
"common hdbscan parameters",
"hdbscan brute method",
"blobs n_samples [gpu-only brute]",
"boundaries limits"
]
},
"boundaries n_samples [kd_tree]": {
"SETS": [
"sklearn-ex[cpu,gpu] implementations",
"common hdbscan parameters",
"sklearn hdbscan parameters",
"hdbscan kd_tree method",
"blobs n_samples [stock-friendly tree]",
"boundaries limits"
]
},
"boundaries n_samples [kd_tree, large]": {
"SETS": [
"sklearnex[cpu,gpu] implementations",
"common hdbscan parameters",
"hdbscan kd_tree method",
"blobs n_samples [large tree]",
"boundaries limits"
]
},
"boundaries n_features": {
"SETS": [
"sklearn-ex[cpu,gpu] implementations",
"common hdbscan parameters",
"sklearn hdbscan parameters",
"hdbscan all methods",
"blobs n_features",
"boundaries limits"
]
},
"boundaries n_features [kd_tree, large]": {
"SETS": [
"sklearnex[cpu,gpu] implementations",
"common hdbscan parameters",
"hdbscan kd_tree method",
"blobs n_features [large tree]",
"boundaries limits"
]
},
"boundaries dtypes": {
"SETS": [
"sklearnex[cpu,gpu] implementations",
"common hdbscan parameters",
"hdbscan all methods",
"blobs n_features",
"both dtypes",
"boundaries limits"
]
},
"boundaries metrics": {
"SETS": [
"sklearn-ex[cpu,gpu] implementations",
"common hdbscan parameters",
"sklearn hdbscan parameters",
"hdbscan kd_tree method",
"blobs n_samples [stock-friendly brute]",
"other metrics",
"boundaries limits"
]
}
}
}
Loading