未验证 提交 681778d8 编写于 作者: C Chen Weihang 提交者: GitHub

Update spawn doc for xpu (#33497)

* update spawn doc for xpu, test=ducument_fix

* add note for gpu and xpu, test=document_fix
上级 08e81475
......@@ -335,7 +335,9 @@ def spawn(func, args=(), nprocs=-1, join=True, daemon=False, **options):
Start multiple processes with ``spawn`` method for parallel training.
.. note::
``spawn`` now only supports GPU collective mode.
``spawn`` now only supports GPU or XPU collective mode. The collective mode
of GPU and XPU cannot be started at the same time, so the option `gpus` and
`xpus` cannot be configured at the same time.
Args:
func (function): The target function is called by spawned process.
......@@ -346,11 +348,8 @@ def spawn(func, args=(), nprocs=-1, join=True, daemon=False, **options):
when nprocs is -1, the available device will be obtained from
the environment variable when the model is executed: If use GPU,
the currently available device ID is obtained from the environment
variable CUDA_VISIBLE_DEVICES; If use CPU, the currently available
CPU number is obtained from the environment variable CPU_NUM.
For example, export CPU_NUM=4, if the environment variable is not set,
the spawn method will add default value to the environment variable
and set its value to 1.
variable CUDA_VISIBLE_DEVICES; If use XPU, the currently available
device ID is obtained from the environment variable XPU_VISIBLE_DEVICES.
join (bool, optional): Perform a blocking join on all spawned processes.
Default: True.
daemon (bool, optional): The spawned processes' daemon flag. Default: False.
......@@ -363,7 +362,9 @@ def spawn(func, args=(), nprocs=-1, join=True, daemon=False, **options):
or ``forkserver`` method. Default: "spawn" ;
(2) gpus (string): The training process will run on the
selected gpus, such as "0,1,2,3". Default: None;
(3) ips (string): Paddle cluster nodes ips, such as
(3) xpus (string): The training process will run on the
selected xpus, such as "0,1,2,3". Default: None;
(4) ips (string): Paddle cluster nodes ips, such as
"192.168.0.16,192.168.0.17". Default: "127.0.0.1" .
Returns:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册