-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add bench jenkins * instance type * fix * fix * fix * 111 * test * 111 * 111 * fix * test * run * fix * fix * fix * fix * fix * publish results * 111 * regression * launch ec2 script * fix * add * run on master * change * rrr * run gpu * fix * fix * try fix * fix * ff * fix * fix * fix * refactor * fix * fix * update * fix * fix * fix * fix * remove import torchtext * add shm size * update * fix * fix * fix * fix * fix this!!!! * 111 * fix * remove verbose * fix * fix * fix * fix * fix * fix * fix * fix * update readme * fix * fix * fix * change asv default to head * commit sage and rgcn * fix * update * add benchmarks * add * fix * update * remove RandomState * tmp remove * new batch * fix * fix * fix * address comment * fix warning * fix Co-authored-by: Minjie Wang <[email protected]>
- Loading branch information
1 parent
8a2b54d
commit 0c15657
Showing
20 changed files
with
219 additions
and
17 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
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import time | ||
import dgl | ||
import torch | ||
import numpy as np | ||
|
||
from .. import utils | ||
|
||
|
||
@utils.benchmark('time', timeout=60) | ||
@utils.parametrize('graph_name', ['cora']) | ||
@utils.parametrize('format', ['coo', 'csr']) | ||
@utils.parametrize('k', [1, 3, 5]) | ||
def track_time(graph_name, format, k): | ||
device = utils.get_bench_device() | ||
graph = utils.get_graph(graph_name, format) | ||
graph = graph.to(device) | ||
graph = graph.formats([format]) | ||
# dry run | ||
dgl.khop_graph(graph, k) | ||
|
||
# timing | ||
t0 = time.time() | ||
for i in range(10): | ||
gg = dgl.khop_graph(graph, k) | ||
t1 = time.time() | ||
|
||
return (t1 - t0) / 10 |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import time | ||
import dgl | ||
import torch | ||
import numpy as np | ||
|
||
from .. import utils | ||
|
||
|
||
@utils.benchmark('time', timeout=60) | ||
@utils.parametrize('k', [3, 5, 10]) | ||
@utils.parametrize('size', [50, 200, ]) | ||
@utils.parametrize('dim', [16, 64, 128]) | ||
def track_time(size, dim, k): | ||
device = utils.get_bench_device() | ||
features = np.random.randn(size, dim) | ||
feat = torch.tensor(features, dtype=torch.float, device=device) | ||
# dry run | ||
dgl.knn_graph(feat, k) | ||
# timing | ||
t0 = time.time() | ||
for i in range(10): | ||
dgl.knn_graph(feat, k) | ||
t1 = time.time() | ||
|
||
return (t1 - t0) / 10 |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import time | ||
import dgl | ||
import torch | ||
import numpy as np | ||
|
||
from .. import utils | ||
|
||
|
||
@utils.skip_if_gpu() | ||
@utils.benchmark('time', timeout=1200) | ||
@utils.parametrize('graph_name', ['reddit']) | ||
@utils.parametrize('k', [2, 4, 8]) | ||
def track_time(graph_name, k): | ||
device = utils.get_bench_device() | ||
data = utils.process_data(graph_name) | ||
graph = data[0] | ||
# dry run | ||
dry_run_data = utils.process_data('pubmed') | ||
gg = dgl.transform.metis_partition(dry_run_data[0], k) | ||
|
||
# timing | ||
t0 = time.time() | ||
for i in range(3): | ||
gg = dgl.transform.metis_partition(graph, k) | ||
t1 = time.time() | ||
|
||
return (t1 - t0) / 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import time | ||
import dgl | ||
import torch | ||
|
||
from .. import utils | ||
|
||
|
||
@utils.benchmark('time') | ||
@utils.parametrize('batch_size', [4, 32, 256]) | ||
@utils.parametrize('feat_size', [32, 128, 256]) | ||
@utils.parametrize('readout_op', ['sum', 'max', 'min', 'mean']) | ||
@utils.parametrize('type', ['edge', 'node']) | ||
def track_time(batch_size, feat_size, readout_op, type): | ||
device = utils.get_bench_device() | ||
ds = dgl.data.QM7bDataset() | ||
# prepare graph | ||
graphs = ds[0:batch_size][0] | ||
|
||
g = dgl.batch(graphs).to(device) | ||
if type == 'node': | ||
g.ndata['h'] = torch.randn((g.num_nodes(), feat_size), device=device) | ||
t0 = time.time() | ||
for i in range(10): | ||
out = dgl.readout_nodes(g, 'h', readout_op) | ||
t1 = time.time() | ||
elif type == 'edge': | ||
g.edata['h'] = torch.randn((g.num_edges(), feat_size), device=device) | ||
t0 = time.time() | ||
for i in range(10): | ||
out = dgl.readout_edges(g, 'h', readout_op) | ||
t1 = time.time() | ||
else: | ||
raise Exception("Unknown type") | ||
|
||
return (t1 - t0) / 10 |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import time | ||
import dgl | ||
import torch | ||
import numpy as np | ||
|
||
from .. import utils | ||
|
||
|
||
@utils.benchmark('time', timeout=1200) | ||
@utils.parametrize_cpu('graph_name', ['cora', 'livejournal', 'friendster']) | ||
@utils.parametrize_gpu('graph_name', ['cora', 'livejournal']) | ||
@utils.parametrize('format', ['coo', 'csc', 'csr']) | ||
def track_time(graph_name, format): | ||
device = utils.get_bench_device() | ||
graph = utils.get_graph(graph_name, format) | ||
graph = graph.to(device) | ||
graph = graph.formats([format]) | ||
# dry run | ||
dgl.reverse(graph) | ||
|
||
# timing | ||
t0 = time.time() | ||
for i in range(10): | ||
gg = dgl.reverse(graph) | ||
t1 = time.time() | ||
|
||
return (t1 - t0) / 10 |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import time | ||
import dgl | ||
import torch | ||
import numpy as np | ||
|
||
from .. import utils | ||
|
||
|
||
@utils.skip_if_gpu() | ||
@utils.benchmark('time', timeout=1200) | ||
@utils.parametrize('graph_name', ['reddit', "ogbn-product"]) | ||
@utils.parametrize('num_seed_nodes', [32, 256, 1024, 2048]) | ||
@utils.parametrize('fanout', [5, 10, 20]) | ||
def track_time(graph_name, num_seed_nodes, fanout): | ||
device = utils.get_bench_device() | ||
data = utils.process_data(graph_name) | ||
graph = data[0] | ||
|
||
# dry run | ||
dgl.sampling.sample_neighbors(graph, [1, 2, 3], fanout) | ||
|
||
subg_list = [] | ||
for i in range(10): | ||
seed_nodes = np.random.randint( | ||
0, graph.num_nodes(), size=num_seed_nodes) | ||
subg = dgl.sampling.sample_neighbors(graph, seed_nodes, fanout) | ||
subg_list.append(subg) | ||
|
||
# timing | ||
t0 = time.time() | ||
for i in range(10): | ||
gg = dgl.to_block(subg_list[i]) | ||
t1 = time.time() | ||
|
||
return (t1 - t0) / 10 |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import time | ||
import dgl | ||
import torch | ||
|
||
from .. import utils | ||
|
||
@utils.benchmark('time') | ||
@utils.parametrize('batch_size', [4, 32, 256, 1024]) | ||
def track_time(batch_size): | ||
device = utils.get_bench_device() | ||
ds = dgl.data.QM7bDataset() | ||
# prepare graph | ||
graphs = ds[0:batch_size][0] | ||
bg = dgl.batch(graphs).to(device) | ||
|
||
# dry run | ||
for i in range(10): | ||
glist = dgl.unbatch(bg) | ||
|
||
# timing | ||
t0 = time.time() | ||
for i in range(100): | ||
glist = dgl.unbatch(bg) | ||
t1 = time.time() | ||
|
||
return (t1 - t0) / 100 |
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
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
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
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