System Info
.
Who can help?
I was trying to run integration tests on cpu for a new model addition PR then got hit by an error due to line 3220
|
@cache |
|
def get_device_properties() -> DeviceProperties: |
|
""" |
|
Get environment device properties. |
|
""" |
|
if IS_CUDA_SYSTEM or IS_ROCM_SYSTEM: |
|
import torch |
|
|
|
major, minor = torch.cuda.get_device_capability() |
|
if IS_ROCM_SYSTEM: |
|
return ("rocm", major, minor) |
|
else: |
|
return ("cuda", major, minor) |
|
elif IS_XPU_SYSTEM: |
|
import torch |
|
|
|
# To get more info of the architecture meaning and bit allocation, refer to https://github.com/intel/llvm/blob/sycl/sycl/include/sycl/ext/oneapi/experimental/device_architecture.def |
|
arch = torch.xpu.get_device_capability()["architecture"] |
|
gen_mask = 0x000000FF00000000 |
|
gen = (arch & gen_mask) >> 32 |
|
return ("xpu", gen, None) |
The reason is that I have CUDA installed on my system (lightning ai studio), but I did not have any GPU, so
IS_CUDA_SYSTEM = torch.version.cuda is not None
was correctly set to the version and then the error occurred in line 3223
major, minor = torch.cuda.get_device_capability()
as I did not have any gpu.
If this is not the intended behavior, the fix is simply changing line 3220 to if (IS_CUDA_SYSTEM or IS_ROCM_SYSTEM) and torch.cuda.is_available(): . In this case we will also need to remove the import torch inside, which anyway seems redundant to me.
@remi-or I see you worked on this area most recently (10 months ago), otherwise could you please ping the right person
Information
Tasks
Reproduction
.
Expected behavior
.
System Info
.
Who can help?
I was trying to run integration tests on cpu for a new model addition PR then got hit by an error due to line 3220
transformers/src/transformers/testing_utils.py
Lines 3215 to 3235 in 2fae57f
The reason is that I have CUDA installed on my system (lightning ai studio), but I did not have any GPU, so
was correctly set to the version and then the error occurred in line 3223
as I did not have any gpu.
If this is not the intended behavior, the fix is simply changing line 3220 to
if (IS_CUDA_SYSTEM or IS_ROCM_SYSTEM) and torch.cuda.is_available():. In this case we will also need to remove theimport torchinside, which anyway seems redundant to me.@remi-or I see you worked on this area most recently (10 months ago), otherwise could you please ping the right person
Information
Tasks
examplesfolder (such as GLUE/SQuAD, ...)Reproduction
.
Expected behavior
.