Skip to content

Commit 081b94f

Browse files
committed
FORCE_DAAL4PY_SKLEARN update
1 parent dc7504c commit 081b94f

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

README.md

100644100755
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ See benchmark results [here](https://intelpython.github.io/scikit-learn_bench).
1010

1111
* [Prerequisites](#prerequisites)
1212
* [How to create conda environment for benchmarking](#how-to-create-conda-environment-for-benchmarking)
13+
* [How to enable daal4py patching for scikit-learn benchmarks](#how-to-enable-daal4py-patching-for-scikit-learn-benchmarks)
1314
* [Running Python benchmarks with runner script](#running-python-benchmarks-with-runner-script)
1415
* [Supported algorithms](#supported-algorithms)
1516
* [Algorithms parameters](#algorithms-parameters)
@@ -30,6 +31,8 @@ Create a suitable conda environment for each framework to test. Each item in the
3031
* [**cuml**](https://github.com/PivovarA/scikit-learn_bench/blob/master/cuml/README.md#how-to-create-conda-environment-for-benchmarking)
3132
* [**xgboost**](https://github.com/PivovarA/scikit-learn_bench/tree/master/xgboost/README.md#how-to-create-conda-environment-for-benchmarking)
3233

34+
## How to enable daal4py patching for scikit-learn benchmarks
35+
Set specific environment variable `export FORCE_DAAL4PY_SKLEARN=YES`
3336

3437
## Running Python benchmarks with runner script
3538

cuml/bench.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212
import sys
1313

1414

15-
if 'FORCE_DAAL4PY_SKLEARN' in os.environ.keys():
15+
if os.environ.get('FORCE_DAAL4PY_SKLEARN', False) in ['y', 'yes', 'Y', 'YES', 'Yes']:
1616
try:
1717
from daal4py.sklearn import patch_sklearn
18-
if os.environ['FORCE_DAAL4PY_SKLEARN'] == 'YES':
19-
patch_sklearn()
18+
patch_sklearn()
2019
except ImportError:
2120
print('Failed to import daal4py.sklearn.patch_sklearn '
2221
'while FORCE_DAAL4PY_SKLEARN is set', file=sys.stderr)

daal4py/bench.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212
import sys
1313

1414

15-
if 'FORCE_DAAL4PY_SKLEARN' in os.environ.keys():
15+
if os.environ.get('FORCE_DAAL4PY_SKLEARN', False) in ['y', 'yes', 'Y', 'YES', 'Yes']:
1616
try:
1717
from daal4py.sklearn import patch_sklearn
18-
if os.environ['FORCE_DAAL4PY_SKLEARN'] == 'YES':
19-
patch_sklearn()
18+
patch_sklearn()
2019
except ImportError:
2120
print('Failed to import daal4py.sklearn.patch_sklearn '
2221
'while FORCE_DAAL4PY_SKLEARN is set', file=sys.stderr)

sklearn/bench.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212
import sys
1313

1414

15-
if 'FORCE_DAAL4PY_SKLEARN' in os.environ.keys():
15+
if os.environ.get('FORCE_DAAL4PY_SKLEARN', False) in ['y', 'yes', 'Y', 'YES', 'Yes']:
1616
try:
1717
from daal4py.sklearn import patch_sklearn
18-
if os.environ['FORCE_DAAL4PY_SKLEARN'] == 'YES':
19-
patch_sklearn()
18+
patch_sklearn()
2019
except ImportError:
2120
print('Failed to import daal4py.sklearn.patch_sklearn '
2221
'while FORCE_DAAL4PY_SKLEARN is set', file=sys.stderr)

xgboost/bench.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212
import sys
1313

1414

15-
if 'FORCE_DAAL4PY_SKLEARN' in os.environ.keys():
15+
if os.environ.get('FORCE_DAAL4PY_SKLEARN', False) in ['y', 'yes', 'Y', 'YES', 'Yes']:
1616
try:
1717
from daal4py.sklearn import patch_sklearn
18-
if os.environ['FORCE_DAAL4PY_SKLEARN'] == 'YES':
19-
patch_sklearn()
18+
patch_sklearn()
2019
except ImportError:
2120
print('Failed to import daal4py.sklearn.patch_sklearn '
2221
'while FORCE_DAAL4PY_SKLEARN is set', file=sys.stderr)

0 commit comments

Comments
 (0)