|
|
|
@ -31,10 +31,10 @@ use_nccl = False
|
|
|
|
|
place = fluid.CPUPlace()
|
|
|
|
|
if fluid.core.is_compiled_with_cuda():
|
|
|
|
|
device_type = 'CUDA'
|
|
|
|
|
use_nccl = True
|
|
|
|
|
use_nccl = False
|
|
|
|
|
place = fluid.CUDAPlace(0)
|
|
|
|
|
|
|
|
|
|
places = fluid.layers.get_places(device_count=2, device_type=device_type)
|
|
|
|
|
places = fluid.layers.get_places(device_count=0, device_type=device_type)
|
|
|
|
|
pd = fluid.layers.ParallelDo(places, use_nccl=use_nccl)
|
|
|
|
|
with pd.do():
|
|
|
|
|
x_ = pd.read_input(x)
|
|
|
|
|