提交 a5fc291f 编写于 作者: G gongweibao 提交者: Yi Liu

Use 2 cards for hallreduce unit test. (#21085)

use 2 cards test=develop
上级 27fa9c10
......@@ -800,7 +800,7 @@ class TestDistBase(unittest.TestCase):
if self.__use_cuda:
tr_cmd += " --use_cuda"
env.update({
"CUDA_VISIBLE_DEVICES": "{}".format(trainer_id),
"CUDA_VISIBLE_DEVICES": "{}".format(trainer_id % 2),
"PADDLE_TRAINERS_NUM": "{}".format(trainer_num),
"PADDLE_TRAINER_ID": "{}".format(trainer_id),
"PADDLE_TRAINER_ENDPOINTS": self._ps_endpoints,
......@@ -813,7 +813,7 @@ class TestDistBase(unittest.TestCase):
tr_cmd += " --use_dgc"
if self._mp_mode:
env = {"FLAGS_selected_gpus": "{}".format(trainer_id)}
env = {"FLAGS_selected_gpus": "{}".format(trainer_id % 2)}
if self._nccl_comm_num > 1:
tr_cmd += " --nccl_comm_num {}".format(self._nccl_comm_num)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册