-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First benchmarks for kmeans #1
Conversation
…rch_engine and scikit-learn-intelex
4dcd241
to
27bd685
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the CI should run the fast variant of the benchmark for all CPU-compatible engines.
EDIT: I see there is already an item in the TODO list:
setup CI that runs all benchmarks on CPU (except those that can't run on CPU)
Other than that, LGTM!
setup.cfg
Outdated
[flake8] | ||
# max line length for black | ||
max-line-length = 88 | ||
target-version = ['py37'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can already target 38 or 39 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also nowadays I would tend to use ruff instead of flake8 but not big deal, especially on a small code base.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mindlessly copied files that we copied from sklearn at the time when sklearn-numba-dpex was created but it's been evolving since then, we should indeed update and apply ruff on all our repos now...
…direct daal4py calls
a23f683
to
a345b04
Compare
677f367
to
dd4a1a3
Compare
784002f
to
75407b0
Compare
75407b0
to
5d9c3a0
Compare
…ble structure of the output parquet table
…ng script draft for kmeans.
8ad78fd
to
6f9622b
Compare
115e118
to
cae8cbc
Compare
for running the benchmarks from a benchmark file tree, and refer to the documentation | ||
of the dependencies of the solvers you're interested in running to gather prerequisite | ||
installation instructions. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should give one or two examples of canonical commands (adapted to the folder structure of this repo) to get started here and then refer to the benchopt doc for variations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a link to the github workflow for testing on cpu that's better for a complete practical guide I think ?
…column with dedicated command parameter to manage the list of known gpu names
…e consolidated files because of missing values and update consolidated csv accordingly
414b7d2
to
2854cb6
Compare
2854cb6
to
24bf8c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some feedback.
Also please include Array API with PyTorch for scikit-learn.
benchmarks/pca/solvers/cuml.py
Outdated
|
||
# if tol == 0: | ||
# tol = 1e-16 | ||
# self.tol = tol |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be removed.
benchmarks/pca/objective.py
Outdated
parameters = dict( | ||
n_components=[10], | ||
whiten=[False], | ||
tol=[0.0], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which solver requires a tol
parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 3 current solvers expose the parameters and it's only used by sklearn(/ex)'s arpack and cupy's jacobi
benchmarks/pca/solvers/cuml.py
Outdated
random_state, | ||
verbose, | ||
): | ||
if self.device == "cpu": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think cuml.decomposition.PCA
can ever run on CPU. It can accept host-allocated inputs but it will do the device-allocation + copy automatically in that case.
In my opinion, let's not waste benchmark time and reporting readability to measure this: for the cuml case, I would only run the device == "gpu"
case and remove the fake device == "cpu"
case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I don't really now the general ins and outs but cuml is introducing experimental cpu / gpu device selection and PCA is compatible so maybe at some point it could be included.)
|
||
parameters = dict( | ||
svd_solver=["full", "arpack", "randomized"], | ||
power_iteration_normalizer=["QR", "LU", "none"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather not bench all those combinations.
For randomized we could set power_iteration_normalizer="LU"
when using numpy and power_iteration_normalizer="QR"
when using Array API (PyTorch).
… and pca - fix pca tests
For KMeans the result spreadsheet is starting to look good after the latest debug. Still missing:
|
This setup the file tree for benchmarking KMeans using benchopt.
TODOs:
enable returning the opencl device in the result table (should work with all devices usingpyopencl
at the cost of making pyopencl a mandatory dependency of the project)maybe use lspci instead ?instead design a system to do it manually when aggregating the benchmark resultskmeans_dpcpp
benchmarkcupy
Kmeans benchmarksklearn intelex: use new SYCL versions ? seems there are newer code paths to use KMeans, maybe we're currently using deprecated implementations ?maybe future PR(see https://stackoverflow.com/a/73820969)solution: use gspread to synchronize with google spreadsheetCurrently adding:
In follow-up PRs: