Skip to content
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

Refactoring of benchmarks #133

Merged
merged 36 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
23a7df5
Refactor draft
Alexsandruss Dec 7, 2023
f865330
Fix dev.guide link
Alexsandruss Dec 7, 2023
94a2add
Configs update and minor fixes
Alexsandruss Dec 10, 2023
6831628
Copyright and doc fixes
Alexsandruss Jan 26, 2024
2cb6fa1
Add argument aliases
Alexsandruss Jan 26, 2024
5299104
Update configs and docs with corresponding code changes
Alexsandruss Feb 14, 2024
6a73712
Change INCLUDE directive in config spec
Alexsandruss Feb 20, 2024
ceb813e
Basic daal4py modelbuilders support
Alexsandruss Feb 20, 2024
2a1e134
Correction of configs
Alexsandruss Feb 20, 2024
610dc8e
Add basic sklearn-like emulation of approx. kNN
Alexsandruss Feb 29, 2024
80ce836
Change configs structure (add common sets);
Alexsandruss Mar 8, 2024
11d4a56
Linting
Alexsandruss Mar 8, 2024
6dd91ff
Update online computation mode
Alexsandruss Mar 12, 2024
780a141
Update for ANN emulators
Alexsandruss Mar 14, 2024
c44943c
Update xgboost configs;
Alexsandruss Mar 15, 2024
917cc32
Remove mutex from envs
Alexsandruss Mar 15, 2024
509dbba
Add modin format; fix for faiss ivf_pq compatibility
Alexsandruss Mar 15, 2024
37b21d3
Add modin support; fixes for ANN emulators
Alexsandruss Mar 15, 2024
22ce12e
Add SVS NearestNeighbors emulator
Alexsandruss Mar 16, 2024
1c6bd66
Update CI and minor code rework
Alexsandruss Apr 22, 2024
e318f64
Add dpnp and dpctl support
Alexsandruss Apr 22, 2024
6c8a08b
Intermediate changes: apply comments, bug fixes
Alexsandruss May 21, 2024
836ffcc
Pin CI Python version to 3.10
Alexsandruss May 21, 2024
8453243
CI command fix and doc links fix
Alexsandruss May 22, 2024
06ae1ab
Shell usage fix
Alexsandruss May 22, 2024
9d62d5d
SPMD support
Alexsandruss May 30, 2024
765a5c3
CI fixes
Alexsandruss May 30, 2024
6798d01
Update sklbench args info
Alexsandruss Jun 5, 2024
1510e96
Conda envs and CI conf update
Alexsandruss Jun 7, 2024
ef0b7c5
Example configs update and fixes:
Alexsandruss Jun 13, 2024
831df21
Fixes and comments applying:
Alexsandruss Jun 20, 2024
8359dea
Fix doctree link and add missing config warning
Alexsandruss Jun 20, 2024
96b7e15
CI matrix update and doc fixes
Alexsandruss Jul 3, 2024
dc00f5f
Docs, configs and codeowners changes
Alexsandruss Jul 3, 2024
f2fd91e
Update codeowners and doc fix
Alexsandruss Jul 4, 2024
7d144bc
Add examples run to CI
Alexsandruss Jul 5, 2024
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: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Benefits:
- Full control of benchmarks suite through CLI
- Flexible and powerful benchmark config structure
- Available with advanced profiling tools, such as Intel(R) VTune* Profiler
- Automated generation of benchmarks report
- Automated benchmarks report generation

### 📜 Table of Contents

Expand All @@ -23,7 +23,7 @@ Benefits:

## 🔧 Create a Python Environment

Create a suitable Python environment to use depending on the needed frameworks:
How to create a usable Python environment with the following required frameworks:

- **sklearn, sklearnex, and gradient boosting frameworks**:

Expand All @@ -44,7 +44,7 @@ conda env create -n rapids --solver=libmamba -f envs/conda-env-rapids.yml

### Benchmarks Runner

Call required benchmarking cases from specified config using the `sklbench` module as a runner:
How to run benchmarks using the `sklbench` module and a specific configuration:

```bash
python -m sklbench --config configs/sklearn_example.json
Expand Down
39 changes: 32 additions & 7 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#===============================================================================
variables:
- name: python.version
value: "3.10"

jobs:
- job: Lint
Expand All @@ -35,9 +32,23 @@ jobs:
dependsOn: Lint
strategy:
matrix:
Pip:
Python3.9_Pip:
PYTHON_VERSION: "3.9"
PKG_MANAGER: "pip"
Conda:
Python3.10_Pip:
PYTHON_VERSION: "3.10"
PKG_MANAGER: "pip"
Python3.11_Pip:
PYTHON_VERSION: "3.11"
PKG_MANAGER: "pip"
Python3.9_Conda:
PYTHON_VERSION: "3.9"
PKG_MANAGER: "conda"
Python3.10_Conda:
PYTHON_VERSION: "3.10"
PKG_MANAGER: "conda"
Python3.11_Conda:
PYTHON_VERSION: "3.11"
PKG_MANAGER: "conda"
pool:
vmImage: "ubuntu-latest"
Expand All @@ -47,9 +58,23 @@ jobs:
dependsOn: Lint
strategy:
matrix:
Pip:
Python3.9_Pip:
PYTHON_VERSION: "3.9"
PKG_MANAGER: "pip"
Conda:
Python3.10_Pip:
PYTHON_VERSION: "3.10"
PKG_MANAGER: "pip"
Python3.11_Pip:
PYTHON_VERSION: "3.11"
PKG_MANAGER: "pip"
Python3.9_Conda:
PYTHON_VERSION: "3.9"
PKG_MANAGER: "conda"
Python3.10_Conda:
PYTHON_VERSION: "3.10"
PKG_MANAGER: "conda"
Python3.11_Conda:
PYTHON_VERSION: "3.11"
PKG_MANAGER: "conda"
pool:
vmImage: "windows-latest"
Expand Down
4 changes: 2 additions & 2 deletions configs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Benchmarking cases in `scikit-learn_bench` are defined by configuration files and stored in the `configs` directory of the repository.

Config defines:
The configuration file (config) defines:
- Measurement and profiling parameters
- Library and algorithm to use
- Algorithm-specific parameters
Expand Down Expand Up @@ -172,4 +172,4 @@ You can remove specific parameter from subset of cases when stacking parameters
```

---
[Documentation tree](../README.md#-documentation-tree)
[Documentation tree](../README.md#-documentation)
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ Benchmark parameters the following overwriting priority:
3. Parameters set

---
[Documentation tree](../README.md#-documentation-tree)
[Documentation tree](../README.md#-documentation)
8 changes: 2 additions & 6 deletions envs/conda-env-sklearn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@ channels:
- conda-forge
- nodefaults
dependencies:
- python=3.10
# additional frameworks
- xgboost
- catboost
- lightgbm
- faiss-cpu
- modin-all
- intel::scikit-learn-intelex
- intel::daal4py
- intel::dpctl
Alexsandruss marked this conversation as resolved.
Show resolved Hide resolved
- intel::dpnp
- scikit-learn-intelex
# sklbench dependencies
- scikit-learn=1.4.*
- scikit-learn<1.5
- pandas
- tabulate
- fastparquet
Expand Down
2 changes: 1 addition & 1 deletion envs/requirements-sklearn.txt
Alexsandruss marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ scikit-learn-intelex
dpctl
dpnp
# sklbench dependencies
scikit-learn==1.4.*
scikit-learn<1.5
pandas
tabulate
fastparquet
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

[tool.black]
line-length = 90
target-version = ['py38', 'py39', 'py310', 'py311', 'py312']
target-version = ['py39', 'py310', 'py311', 'py312']
extend-ignore = 'E203'

[tool.isort]
Expand Down
10 changes: 5 additions & 5 deletions test-configuration-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
#===============================================================================
steps:
- task: UsePythonVersion@0
displayName: "Use Python $(python.version)"
displayName: "Use Python $(PYTHON_VERSION)"
inputs:
versionSpec: "$(python.version)"
versionSpec: "$(PYTHON_VERSION)"
- script: |
conda create -y -n bench-env -c conda-forge -c nodefaults python=$(python.version)
displayName: Environment update
conda create -y -n bench-env -c conda-forge -c nodefaults python=$(PYTHON_VERSION)
displayName: Environment initialization
- script: |
source /usr/share/miniconda/etc/profile.d/conda.sh
conda activate bench-env
Expand All @@ -38,7 +38,7 @@ steps:
- script: |
source /usr/share/miniconda/etc/profile.d/conda.sh
conda activate bench-env
python -m sklbench -l DEBUG -p algorithm:library=sklearnex algorithm:estimator=KMeans data:dataset=a9a
python -m sklbench --report -l DEBUG -p algorithm:library=sklearn,sklearnex algorithm:estimator=PCA,KMeans,ElasticNet,KNeighborsClassifier data:dataset=skin_segmentation data:split_kwargs:train_size=5000 data:split_kwargs:test_size=5000
displayName: CLI arguments run
- script: |
source /usr/share/miniconda/etc/profile.d/conda.sh
Expand Down
10 changes: 5 additions & 5 deletions test-configuration-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
#===============================================================================
steps:
- task: UsePythonVersion@0
displayName: "Use Python $(python.version)"
displayName: "Use Python $(PYTHON_VERSION)"
inputs:
versionSpec: "$(python.version)"
versionSpec: "$(PYTHON_VERSION)"
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
displayName: Add conda to Windows PATH
- script: |
conda create -y -n bench-env -c conda-forge -c nodefaults python=$(python.version)
displayName: Environment update
conda create -y -n bench-env -c conda-forge -c nodefaults python=$(PYTHON_VERSION)
displayName: Environment initialization
- script: |
call activate bench-env
pip install -r envs/requirements-sklearn.txt
Expand All @@ -37,7 +37,7 @@ steps:
condition: eq(variables['PKG_MANAGER'], 'conda')
- script: |
call activate bench-env
python -m sklbench -l DEBUG -p algorithm:library=sklearnex algorithm:estimator=KMeans data:dataset=a9a
python -m sklbench --report -l DEBUG -p algorithm:library=sklearn,sklearnex algorithm:estimator=PCA,KMeans,ElasticNet,KNeighborsClassifier data:dataset=skin_segmentation data:split_kwargs:train_size=5000 data:split_kwargs:test_size=5000
displayName: CLI arguments run
- script: |
call activate bench-env
Expand Down
Loading