提交 a34c9562 编写于 作者: J JiabinYang

disable nccl2 test on CPU

only mode
上级 3fa68dc1
...@@ -661,6 +661,7 @@ class TestLoadSliceVar(TranspilerTest): ...@@ -661,6 +661,7 @@ class TestLoadSliceVar(TranspilerTest):
class TestNCCL2Transpile(TranspilerTest): class TestNCCL2Transpile(TranspilerTest):
def test_nccl2_transpile(self): def test_nccl2_transpile(self):
if fluid.core.is_compiled_with_cuda(): #test nccl2 only with cuda
main = fluid.Program() main = fluid.Program()
startup = fluid.Program() startup = fluid.Program()
with fluid.program_guard(main, startup): with fluid.program_guard(main, startup):
...@@ -677,6 +678,8 @@ class TestNCCL2Transpile(TranspilerTest): ...@@ -677,6 +678,8 @@ class TestNCCL2Transpile(TranspilerTest):
print([op.type for op in startup.global_block().ops]) print([op.type for op in startup.global_block().ops])
self.assertEqual(startup.global_block().ops[-1].type, "gen_nccl_id") self.assertEqual(startup.global_block().ops[-1].type, "gen_nccl_id")
self.assertIsNotNone(startup.global_block().vars.get("NCCLID")) self.assertIsNotNone(startup.global_block().vars.get("NCCLID"))
else:
pass
if __name__ == "__main__": if __name__ == "__main__":
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册