From e80a65ba4fbbf085fda2cf0fdb0e8d48785979c8 Mon Sep 17 00:00:00 2001 From: Fanli Lin Date: Tue, 19 Nov 2024 01:59:11 +0800 Subject: [PATCH] [tests] add XPU part to testing (#34778) add XPU part to testing Signed-off-by: Lin, Fanli --- docs/source/en/testing.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/source/en/testing.md b/docs/source/en/testing.md index 1da8a62456..9e85f2248e 100644 --- a/docs/source/en/testing.md +++ b/docs/source/en/testing.md @@ -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