scikit-learn-intelex icon indicating copy to clipboard operation
scikit-learn-intelex copied to clipboard

[enhancement] enable bf16 BLAS level-3 support

Open icfaust opened this issue 1 year ago • 14 comments

Description

Add gpu_blas_compute_mode kwarg to set_config and config_context. This will enable bf16 support when gpu_blas_compute_mode is set to a proper string which matches from the oneMKL compute_mode enum list.

Changes proposed in this pull request:

  • Add ComputeMode enum via pybind11 from mkl_dal_sycl.hpp when dpc backend is available
  • Set and/or acquire os environment variable "DAL_BLAS_COMPUTE_MODE" when dpc backend is available via set_config/config_context kwarg gpu_blas_compute_mode

tasks:

  • [ ] verify float_to_bf16 operation

icfaust avatar Dec 05 '23 22:12 icfaust

/azp run CI

icfaust avatar Dec 06 '23 10:12 icfaust

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Dec 06 '23 10:12 azure-pipelines[bot]

/azp run CI

icfaust avatar Dec 06 '23 10:12 icfaust

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Dec 06 '23 10:12 azure-pipelines[bot]

Please cover this functionality with some tests. Probably you can extend this test suit https://github.com/intel/scikit-learn-intelex/blob/master/sklearnex/tests/test_config.py

Definitely a good idea. I'll work on it

icfaust avatar Dec 06 '23 19:12 icfaust

/intelci: run

icfaust avatar Dec 07 '23 07:12 icfaust

@icfaust please run intel ci for GPU validation as well

samir-nasibli avatar Dec 07 '23 18:12 samir-nasibli

/intelci: run

icfaust avatar Dec 08 '23 09:12 icfaust

But with current approach with env variable we can control this without python by just setting env variable without changes for scikit. Do we need any form of python support here?

napetrov avatar Dec 09 '23 11:12 napetrov

These changes looks very promising!

KulikovNikita avatar Dec 20 '23 14:12 KulikovNikita

/intelci: run

icfaust avatar Jan 05 '24 05:01 icfaust

I will be closing this PR after a set of verifications

icfaust avatar Jan 15 '24 12:01 icfaust

/intelci: run

icfaust avatar Jan 15 '24 12:01 icfaust

There is a worrying python dependency. <3.11 doesn't seem to support.

icfaust avatar Jan 16 '24 09:01 icfaust