From cbc8bc5826becdfbeee4e91958a59c17f7d1e581 Mon Sep 17 00:00:00 2001 From: Andrei Ivanov Date: Thu, 25 Jul 2024 17:44:18 -0700 Subject: [PATCH 1/4] Activation of `test_exclude_seed_edges_gpu` on CPU. --- tests/python/pytorch/graphbolt/test_utils.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/python/pytorch/graphbolt/test_utils.py b/tests/python/pytorch/graphbolt/test_utils.py index 3795c791ebde..2e8e693e1023 100644 --- a/tests/python/pytorch/graphbolt/test_utils.py +++ b/tests/python/pytorch/graphbolt/test_utils.py @@ -117,10 +117,6 @@ def test_exclude_seed_edges_homo_cpu(): ) -@unittest.skipIf( - F._default_context_str == "cpu", - reason="Fails due to different result on the CPU.", -) def test_exclude_seed_edges_gpu(): graph = dgl.graph(([5, 0, 7, 7, 2, 4], [0, 1, 2, 2, 3, 4])) graph = gb.from_dglgraph(graph, is_homogeneous=True).to(F.ctx()) From 8473beeac2a46621fe22803d16de268d26639725 Mon Sep 17 00:00:00 2001 From: Andrei Ivanov Date: Thu, 25 Jul 2024 18:00:56 -0700 Subject: [PATCH 2/4] Activation of `test_exclude_seed_edges_gpu` on CPU. --- tests/python/pytorch/graphbolt/test_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python/pytorch/graphbolt/test_utils.py b/tests/python/pytorch/graphbolt/test_utils.py index 2e8e693e1023..d930aa4dbecf 100644 --- a/tests/python/pytorch/graphbolt/test_utils.py +++ b/tests/python/pytorch/graphbolt/test_utils.py @@ -134,7 +134,7 @@ def test_exclude_seed_edges_gpu(): deduplicate=True, ) datapipe = datapipe.transform(partial(gb.exclude_seed_edges)) - if torch.cuda.get_device_capability()[0] < 7: + if F.ctx() != F.cpu() and torch.cuda.get_device_capability()[0] < 7: original_row_node_ids = [ torch.tensor([0, 3, 4, 2, 5, 7]).to(F.ctx()), torch.tensor([0, 3, 4, 2, 5]).to(F.ctx()), From 6267f4cfe7ab882d4ca11920b38b800080a3df44 Mon Sep 17 00:00:00 2001 From: Andrei Ivanov Date: Thu, 25 Jul 2024 18:02:19 -0700 Subject: [PATCH 3/4] Activation of `test_exclude_seed_edges_gpu` on CPU. --- tests/python/pytorch/graphbolt/test_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python/pytorch/graphbolt/test_utils.py b/tests/python/pytorch/graphbolt/test_utils.py index d930aa4dbecf..5b9d1760f195 100644 --- a/tests/python/pytorch/graphbolt/test_utils.py +++ b/tests/python/pytorch/graphbolt/test_utils.py @@ -117,7 +117,7 @@ def test_exclude_seed_edges_homo_cpu(): ) -def test_exclude_seed_edges_gpu(): +def test_exclude_seed_edges(): graph = dgl.graph(([5, 0, 7, 7, 2, 4], [0, 1, 2, 2, 3, 4])) graph = gb.from_dglgraph(graph, is_homogeneous=True).to(F.ctx()) items = torch.LongTensor([[0, 3], [4, 4]]) From 34db4029b69218db0b317a88942414b92b10a5ae Mon Sep 17 00:00:00 2001 From: Andrei Ivanov Date: Thu, 25 Jul 2024 19:05:57 -0700 Subject: [PATCH 4/4] Activation of 3 more tests on CPU. --- .../graphbolt/test_subgraph_sampler.py | 24 +++++-------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/tests/python/pytorch/graphbolt/test_subgraph_sampler.py b/tests/python/pytorch/graphbolt/test_subgraph_sampler.py index 650903d561a5..a48b446bef9d 100644 --- a/tests/python/pytorch/graphbolt/test_subgraph_sampler.py +++ b/tests/python/pytorch/graphbolt/test_subgraph_sampler.py @@ -944,12 +944,8 @@ def test_SubgraphSampler_unique_csc_format_Homo_Node_cpu(labor): ) -@unittest.skipIf( - F._default_context_str == "cpu", - reason="Fails due to different result on the CPU.", -) @pytest.mark.parametrize("labor", [False, True]) -def test_SubgraphSampler_unique_csc_format_Homo_Node_gpu(labor): +def test_SubgraphSampler_unique_csc_format_Homo_Node(labor): torch.manual_seed(1205) graph = dgl.graph(([5, 0, 7, 7, 2, 4], [0, 1, 2, 2, 3, 4])) graph = gb.from_dglgraph(graph, is_homogeneous=True).to(F.ctx()) @@ -970,7 +966,7 @@ def test_SubgraphSampler_unique_csc_format_Homo_Node_gpu(labor): deduplicate=True, ) - if torch.cuda.get_device_capability()[0] < 7: + if F.ctx() != F.cpu() and torch.cuda.get_device_capability()[0] < 7: original_row_node_ids = [ torch.tensor([0, 3, 4, 2, 5, 7]).to(F.ctx()), torch.tensor([0, 3, 4, 2, 5]).to(F.ctx()), @@ -1371,12 +1367,8 @@ def test_SubgraphSampler_unique_csc_format_Homo_Link_cpu(labor): ) -@unittest.skipIf( - F._default_context_str == "cpu", - reason="Fails due to different result on the CPU.", -) @pytest.mark.parametrize("labor", [False, True]) -def test_SubgraphSampler_unique_csc_format_Homo_Link_gpu(labor): +def test_SubgraphSampler_unique_csc_format_Homo_Link(labor): torch.manual_seed(1205) graph = dgl.graph(([5, 0, 7, 7, 2, 4], [0, 1, 2, 2, 3, 4])) graph = gb.from_dglgraph(graph, is_homogeneous=True).to(F.ctx()) @@ -1395,7 +1387,7 @@ def test_SubgraphSampler_unique_csc_format_Homo_Link_gpu(labor): deduplicate=True, ) - if torch.cuda.get_device_capability()[0] < 7: + if F.ctx() != F.cpu() and torch.cuda.get_device_capability()[0] < 7: original_row_node_ids = [ torch.tensor([0, 3, 4, 2, 5, 7]).to(F.ctx()), torch.tensor([0, 3, 4, 2, 5]).to(F.ctx()), @@ -1752,12 +1744,8 @@ def test_SubgraphSampler_unique_csc_format_Homo_HyperLink_cpu(labor): ) -@unittest.skipIf( - F._default_context_str == "cpu", - reason="Fails due to different result on the CPU.", -) @pytest.mark.parametrize("labor", [False, True]) -def test_SubgraphSampler_unique_csc_format_Homo_HyperLink_gpu(labor): +def test_SubgraphSampler_unique_csc_format_Homo_HyperLink(labor): torch.manual_seed(1205) graph = dgl.graph(([5, 0, 7, 7, 2, 4], [0, 1, 2, 2, 3, 4])) graph = gb.from_dglgraph(graph, is_homogeneous=True).to(F.ctx()) @@ -1776,7 +1764,7 @@ def test_SubgraphSampler_unique_csc_format_Homo_HyperLink_gpu(labor): deduplicate=True, ) - if torch.cuda.get_device_capability()[0] < 7: + if F.ctx() != F.cpu() and torch.cuda.get_device_capability()[0] < 7: original_row_node_ids = [ torch.tensor([0, 3, 4, 2, 5, 7]).to(F.ctx()), torch.tensor([0, 3, 4, 2, 5]).to(F.ctx()),