Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/source/en/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down