Skip to content

Commit 41e003f

Browse files
author
Igor Rukhovich
committed
Merge branch 'master' of https://github.com/IntelPython/scikit-learn_bench into xgb-nvidia-datasets
Conflicts: utils.py
2 parents f9cf09b + f58fac4 commit 41e003f

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and [XGBoost](https://github.com/dmlc/xgboost) frameworks for commonly used
1414

1515
We publish blogs on Medium, so [follow us](https://medium.com/intel-analytics-software/tagged/machine-learning) to learn tips and tricks for more efficient data analysis. Here are our latest blogs:
1616

17+
- [Optimizing CatBoost Performance](https://medium.com/intel-analytics-software/optimizing-catboost-performance-4f73f0593071)
1718
- [Intel Gives Scikit-Learn the Performance Boost Data Scientists Need](https://medium.com/intel-analytics-software/intel-gives-scikit-learn-the-performance-boost-data-scientists-need-42eb47c80b18)
1819
- [From Hours to Minutes: 600x Faster SVM](https://medium.com/intel-analytics-software/from-hours-to-minutes-600x-faster-svm-647f904c31ae)
1920
- [Improve the Performance of XGBoost and LightGBM Inference](https://medium.com/intel-analytics-software/improving-the-performance-of-xgboost-and-lightgbm-inference-3b542c03447e)

bench.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ def gen_basic_dict(library, algorithm, stage, params, data, alg_instance=None,
465465
'library': library,
466466
'algorithm': algorithm,
467467
'stage': stage,
468+
'device': params.device,
468469
'input_data': {
469470
'data_format': params.data_format,
470471
'data_order': params.data_order,

utils.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# ===============================================================================
1616

1717
import json
18+
import logging
1819
import os
1920
import pathlib
2021
import platform
@@ -67,7 +68,7 @@ def read_output_from_command(command: str,
6768
return res.stdout[:-1], res.stderr[:-1]
6869

6970

70-
def get_hw_parameters() -> Dict[str, Union[Dict[str, str], float]]:
71+
def get_hw_parameters() -> Union[bool, Dict[Any, Any]]:
7172
if 'Linux' not in platform.platform():
7273
return {}
7374

@@ -89,19 +90,19 @@ def get_hw_parameters() -> Dict[str, Union[Dict[str, str], float]]:
8990

9091
# get GPU information
9192
try:
92-
gpu_info, _ = read_output_from_command(
93-
'nvidia-smi --query-gpu=name,memory.total,driver_version,pstate '
94-
'--format=csv,noheader')
95-
info_arr = gpu_info.split(', ')
96-
hw_params['GPU'] = {
97-
'Name': info_arr[0],
98-
'Memory size': info_arr[1],
99-
'Performance mode': info_arr[3]
100-
}
101-
except (FileNotFoundError, json.JSONDecodeError):
102-
pass
103-
104-
return hw_params
93+
nfo, _ = read_output_from_command('lscpu')
94+
cpu_info = nfo.split('\n')
95+
for el in cpu_info:
96+
if 'Thread(s) per core' in el:
97+
threads_per_core = int(el[-1])
98+
if threads_per_core > 1:
99+
return True
100+
else:
101+
return False
102+
return False
103+
except FileNotFoundError:
104+
logging.info('Impossible to check hyperthreading via lscpu')
105+
return False
105106

106107

107108
def get_sw_parameters() -> Dict[str, Dict[str, Any]]:

0 commit comments

Comments
 (0)