mirror of
https://github.com/saymrwulf/transformers.git
synced 2026-05-14 20:58:08 +00:00
[tests] add XPU part to testing (#34778)
add XPU part to testing Signed-off-by: Lin, Fanli <fanli.lin@intel.com>
This commit is contained in:
parent
9568a9dfc5
commit
e80a65ba4f
1 changed files with 4 additions and 2 deletions
|
|
@ -428,7 +428,7 @@ pytest --instafail
|
|||
|
||||
### To GPU or not to GPU
|
||||
|
||||
On a GPU-enabled setup, to test in CPU-only mode add `CUDA_VISIBLE_DEVICES=""`:
|
||||
On a GPU-enabled setup, to test in CPU-only mode add `CUDA_VISIBLE_DEVICES=""` for CUDA GPUs:
|
||||
|
||||
```bash
|
||||
CUDA_VISIBLE_DEVICES="" pytest tests/utils/test_logging.py
|
||||
|
|
@ -441,10 +441,12 @@ second gpu if you have gpus `0` and `1`, you can run:
|
|||
CUDA_VISIBLE_DEVICES="1" pytest tests/utils/test_logging.py
|
||||
```
|
||||
|
||||
For Intel GPUs, use `ZE_AFFINITY_MASK` instead of `CUDA_VISIBLE_DEVICES` in the above example.
|
||||
|
||||
This is handy when you want to run different tasks on different GPUs.
|
||||
|
||||
Some tests must be run on CPU-only, others on either CPU or GPU or TPU, yet others on multiple-GPUs. The following skip
|
||||
decorators are used to set the requirements of tests CPU/GPU/TPU-wise:
|
||||
decorators are used to set the requirements of tests CPU/GPU/XPU/TPU-wise:
|
||||
|
||||
- `require_torch` - this test will run only under torch
|
||||
- `require_torch_gpu` - as `require_torch` plus requires at least 1 GPU
|
||||
|
|
|
|||
Loading…
Reference in a new issue