-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into cugraphops-sageconv
- Loading branch information
Showing
667 changed files
with
33,100 additions
and
22,435 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import time | ||
|
||
import torch | ||
|
||
import dgl | ||
|
||
import torch | ||
|
||
from .. import utils | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
benchmarks/benchmarks/api/bench_builtin_apply_edges_hetero.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 25 additions & 23 deletions
48
benchmarks/benchmarks/api/bench_builtin_multi_update_all.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,49 @@ | ||
import time | ||
|
||
import dgl | ||
import torch | ||
import numpy as np | ||
import dgl.function as fn | ||
import numpy as np | ||
import torch | ||
|
||
from .. import utils | ||
|
||
|
||
@utils.benchmark('time', timeout=600) | ||
@utils.parametrize('feat_size', [32, 128, 512]) | ||
@utils.parametrize('num_relations', [5, 50, 500]) | ||
@utils.parametrize('multi_reduce_type', ["sum", "stack"]) | ||
@utils.benchmark("time", timeout=600) | ||
@utils.parametrize("feat_size", [32, 128, 512]) | ||
@utils.parametrize("num_relations", [5, 50, 500]) | ||
@utils.parametrize("multi_reduce_type", ["sum", "stack"]) | ||
def track_time(feat_size, num_relations, multi_reduce_type): | ||
device = utils.get_bench_device() | ||
dd = {} | ||
candidate_edges = [dgl.data.CoraGraphDataset(verbose=False)[0].edges(), dgl.data.PubmedGraphDataset(verbose=False)[ | ||
0].edges(), dgl.data.CiteseerGraphDataset(verbose=False)[0].edges()] | ||
candidate_edges = [ | ||
dgl.data.CoraGraphDataset(verbose=False)[0].edges(), | ||
dgl.data.PubmedGraphDataset(verbose=False)[0].edges(), | ||
dgl.data.CiteseerGraphDataset(verbose=False)[0].edges(), | ||
] | ||
for i in range(num_relations): | ||
dd[('n1', 'e_{}'.format(i), 'n2')] = candidate_edges[i % | ||
len(candidate_edges)] | ||
dd[("n1", "e_{}".format(i), "n2")] = candidate_edges[ | ||
i % len(candidate_edges) | ||
] | ||
graph = dgl.heterograph(dd) | ||
|
||
graph = graph.to(device) | ||
graph.nodes['n1'].data['h'] = torch.randn( | ||
(graph.num_nodes('n1'), feat_size), device=device) | ||
graph.nodes['n2'].data['h'] = torch.randn( | ||
(graph.num_nodes('n2'), feat_size), device=device) | ||
graph.nodes["n1"].data["h"] = torch.randn( | ||
(graph.num_nodes("n1"), feat_size), device=device | ||
) | ||
graph.nodes["n2"].data["h"] = torch.randn( | ||
(graph.num_nodes("n2"), feat_size), device=device | ||
) | ||
|
||
# dry run | ||
update_dict = {} | ||
for i in range(num_relations): | ||
update_dict['e_{}'.format(i)] = ( | ||
fn.copy_u('h', 'm'), fn.sum('m', 'h')) | ||
graph.multi_update_all( | ||
update_dict, | ||
multi_reduce_type) | ||
update_dict["e_{}".format(i)] = (fn.copy_u("h", "m"), fn.sum("m", "h")) | ||
graph.multi_update_all(update_dict, multi_reduce_type) | ||
|
||
# timing | ||
|
||
with utils.Timer() as t: | ||
for i in range(3): | ||
graph.multi_update_all( | ||
update_dict, | ||
multi_reduce_type) | ||
graph.multi_update_all(update_dict, multi_reduce_type) | ||
|
||
return t.elapsed_secs / 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import time | ||
|
||
import dgl | ||
|
||
import numpy as np | ||
import torch | ||
|
||
import dgl | ||
|
||
from .. import utils | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import time | ||
|
||
import dgl | ||
|
||
import numpy as np | ||
import torch | ||
|
||
import dgl | ||
|
||
from .. import utils | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import time | ||
|
||
import dgl | ||
|
||
import numpy as np | ||
import torch | ||
|
||
import dgl | ||
|
||
from .. import utils | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
benchmarks/benchmarks/api/bench_homograph_edge_construction.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
benchmarks/benchmarks/api/bench_homograph_scipy_construction.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import time | ||
|
||
import dgl | ||
|
||
import numpy as np | ||
import torch | ||
|
||
import dgl | ||
|
||
from .. import utils | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import time | ||
|
||
import dgl | ||
|
||
import numpy as np | ||
import torch | ||
|
||
import dgl | ||
|
||
from .. import utils | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import time | ||
|
||
import dgl | ||
|
||
import numpy as np | ||
import torch | ||
|
||
import dgl | ||
|
||
from .. import utils | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import time | ||
|
||
import dgl | ||
|
||
import numpy as np | ||
import torch | ||
|
||
import dgl | ||
|
||
from .. import utils | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import time | ||
|
||
import dgl | ||
|
||
import numpy as np | ||
import torch | ||
|
||
import dgl | ||
|
||
from .. import utils | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.