Backend API¶
get_device(log_info=False, *, cuda_precision='bf16-mixed')
¶
Detect the accelerator and the precision a trainer runs at on it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
log_info
|
bool
|
If True, log the Python, torch and GPU backend versions. |
False
|
cuda_precision
|
str
|
The precision on CUDA. |
'bf16-mixed'
|
Returns:
| Type | Description |
|---|---|
str
|
|
str
|
precision is |
int
|
1 on MPS and 0 on CPU. |