From f10b467b3d454399f07b76de02e0f46004dbeb39 Mon Sep 17 00:00:00 2001 From: jeffhataws Date: Fri, 24 Jan 2025 13:42:55 -0800 Subject: [PATCH] Improve the nprocs value error message to be actionable (#8622) --- torch_xla/_internal/pjrt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torch_xla/_internal/pjrt.py b/torch_xla/_internal/pjrt.py index 71d9ddc4865e..6c1c4c26a392 100644 --- a/torch_xla/_internal/pjrt.py +++ b/torch_xla/_internal/pjrt.py @@ -207,7 +207,7 @@ def spawn(fn: Callable, return _run_singleprocess(spawn_fn) elif nprocs is not None: raise ValueError( - 'Unsupported nprocs (%d). Please use the environment variable for the hardware you are using (X_NUM_DEVICES where X is CPU, GPU, TPU, NEURONCORE, etc).' + 'Unsupported nprocs (%d). Please use nprocs=1 or None (default). If None, spawn will use all available devices. Use the environment variable X_NUM_DEVICES (where X is CPU, GPU, TPU, NEURONCORE, etc) to limit the number of devices used.' % nprocs) run_multiprocess(spawn_fn, start_method=start_method)