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

Fix issue #75: Benchmarks silently execute stock version if scikit-learn-intelex is not installed #134

Closed
wants to merge 2 commits into from

Conversation

lulin789
Copy link

Fix log not displayed in bench.py
Before this fix the log isn't displayed in bench.py, because bench.py is
running via subprocess, so the log config set in runner.py has no effect in
bench.py, and the log config in bench.py follows the default strategy
(log_level=WARNING, stream=stderr), so when scikit-learn-intelex is not
installed, the info log can't be displayed, furthermore, all other info logs
in bench.py can't be displayed either.

This fix does the following change:

  1. Set a log config in bench.py (log_level=INFO, stream=stderr).
  2. Add return_code in the return value of utils.read_output_from_command() to identify if there is any error in subprocess.
  3. In runner.py, if no error occured, the log from subprocess in stderr will be printed, otherwise is_success will be set to False and the error message will be displayed through a warning log.

Fixes #75

Co-authored-by: Wu, Zihan zihan.wu@intel.com
Signed-off-by: Deng, Lulin lulin.deng@intel.com
Signed-off-by: Zhou, Shuangpeng shuangpeng.zhou@intel.com
Signed-off-by: Xu, Yanyue yanyue.xu@intel.com

hjzin and others added 2 commits April 27, 2023 16:14
Before this fix the log isn't displayed in bench.py, because bench.py is
running via subprocess, so the log config set in runner.py has no effect in
bench.py, and the log config in bench.py follows the default strategy
(log_level=WARNING, stream=stderr), so when scikit-learn-intelex is not
installed, the info log can't be displayed, furthermore, all other info logs
in bench.py can't be displayed either.

This fix does the following change:
1. Set a log config in bench.py (log_level=INFO, stream=stderr).
2. Add return_code in the return value of utils.read_output_from_command() to identify if there is any error in subprocess.
3. In runner.py, if no error occured, the log from subprocess in stderr will be printed, otherwise is_success will be set to False and the error message will be displayed through a warning log.

Fixes IntelPython#75

Co-authored-by: Wu, Zihan <zihan.wu@intel.com>
Signed-off-by: Deng, Lulin <lulin.deng@intel.com>
Signed-off-by: Zhou, Shuangpeng <shuangpeng.zhou@intel.com>
Signed-off-by: Xu, Yanyue <yanyue.xu@intel.com>
@samir-nasibli
Copy link
Contributor

@Alexsandruss are we going to integrate this into main branch or we have a fix on your branch?

@Alexsandruss
Copy link
Contributor

Benchmarks output warning if sklearnex patching has failed starting from refactoring (#133).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Benchmarks silently execute stock version if scikit-learn-intelex is not installed
4 participants