Skip to content

Commit

Permalink
Improve the nprocs value error message to be actionable (#8622)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffhataws authored Jan 24, 2025
1 parent 6f367df commit e694c90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torch_xla/_internal/pjrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e694c90

Please sign in to comment.