neural_compressor.torch.utils.environ
Intel Neural Compressor PyTorch environment check.
Functions
|
Check whether intel_extension_for_pytorch is imported. |
|
Check whether transformers is imported. |
|
Check if the package exists in the environment without importing. |
Returns whether hpex is available. |
|
Return whether optimum-habana is available. |
|
Return whether optimum-habana is available. |
|
Return whether ipex is available. |
|
Return ipex version if ipex exists. |
|
Return torch version if ipex exists. |
|
|
Return the recommended accelerator based on device priority. |
|
Function decorator that calls accelerated.synchronize before and after a function call. |
Check if Numba and TBB are available for packing. |
|
Check if Numba is available. |
|
Check if TBB is available. |
|
Get HPU used memory: MiB. |
|
Get the amount of CPU memory used by the current process in MiB (Mebibytes). |
Module Contents
- neural_compressor.torch.utils.environ.is_ipex_imported() bool [source]
Check whether intel_extension_for_pytorch is imported.
- neural_compressor.torch.utils.environ.is_transformers_imported() bool [source]
Check whether transformers is imported.
- neural_compressor.torch.utils.environ.is_package_available(package_name)[source]
Check if the package exists in the environment without importing.
- Parameters:
package_name (str) – package name
- neural_compressor.torch.utils.environ.is_hpex_available()[source]
Returns whether hpex is available.
- neural_compressor.torch.utils.environ.is_optimum_available()[source]
Return whether optimum-habana is available.
- neural_compressor.torch.utils.environ.is_optimum_habana_available()[source]
Return whether optimum-habana is available.
- neural_compressor.torch.utils.environ.is_ipex_available()[source]
Return whether ipex is available.
- neural_compressor.torch.utils.environ.get_ipex_version()[source]
Return ipex version if ipex exists.
- neural_compressor.torch.utils.environ.get_torch_version()[source]
Return torch version if ipex exists.
- neural_compressor.torch.utils.environ.get_accelerator(device_name='auto')[source]
Return the recommended accelerator based on device priority.
- neural_compressor.torch.utils.environ.device_synchronize(raw_func)[source]
Function decorator that calls accelerated.synchronize before and after a function call.