-
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 Co-authored-by: Minjie Wang <[email protected]>
- Loading branch information
1 parent
0778766
commit c29daae
Showing
6 changed files
with
250 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import time | ||
import dgl | ||
import torch | ||
import numpy as np | ||
|
||
from .. import utils | ||
# edge_ids is not supported on cuda | ||
# @utils.skip_if_gpu() | ||
@utils.benchmark('time', timeout=1200) | ||
@utils.parametrize_cpu('graph_name', ['cora', 'livejournal', 'friendster']) | ||
@utils.parametrize_gpu('graph_name', ['cora', 'livejournal']) | ||
@utils.parametrize('format', ['csr']) # csr/csc is not supported | ||
@utils.parametrize('fraction', [0.01, 0.1]) | ||
@utils.parametrize('return_uv', [True, False]) | ||
def track_time(graph_name, format, fraction, return_uv): | ||
device = utils.get_bench_device() | ||
graph = utils.get_graph(graph_name, format) | ||
coo_graph = utils.get_graph(graph_name, 'coo') | ||
graph = graph.to(device) | ||
eids = np.random.choice( | ||
np.arange(graph.num_edges(), dtype=np.int64), int(graph.num_edges()*fraction)) | ||
eids = torch.tensor(eids, device="cpu", dtype=torch.int64) | ||
u, v = coo_graph.find_edges(eids) | ||
del coo_graph, eids | ||
u = u.to(device) | ||
v = v.to(device) | ||
# dry run | ||
for i in range(10): | ||
out = graph.edge_ids(u[0], v[0]) | ||
|
||
# timing | ||
t0 = time.time() | ||
for i in range(10): | ||
edges = graph.edge_ids(u, v, return_uv=return_uv) | ||
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,33 @@ | ||
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 is not supported | ||
@utils.parametrize('fraction', [0.01, 0.1]) | ||
def track_time(graph_name, format, fraction): | ||
device = utils.get_bench_device() | ||
graph = utils.get_graph(graph_name, format) | ||
graph = graph.to(device) | ||
eids = np.random.choice( | ||
np.arange(graph.num_edges(), dtype=np.int64), int(graph.num_edges()*fraction)) | ||
eids = torch.tensor(eids, device=device, dtype=torch.int64) | ||
# dry run | ||
for i in range(10): | ||
out = graph.find_edges(i) | ||
out = graph.find_edges(torch.arange( | ||
i*10, dtype=torch.int64, device=device)) | ||
|
||
# timing | ||
t0 = time.time() | ||
for i in range(10): | ||
edges = graph.find_edges(eids) | ||
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,31 @@ | ||
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'), ('csc', 'coo'), | ||
('coo', 'csr'), ('csr', 'coo'), | ||
('csr', 'csc'), ('csc', 'csr')]) | ||
def track_time(graph_name, format): | ||
from_format, to_format = format | ||
device = utils.get_bench_device() | ||
graph = utils.get_graph(graph_name, from_format) | ||
graph = graph.to(device) | ||
graph = graph.formats([from_format]) | ||
# dry run | ||
graph.formats([to_format]) | ||
|
||
# timing | ||
t0 = time.time() | ||
for i in range(10): | ||
gg = graph.formats([to_format]) | ||
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,34 @@ | ||
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']) | ||
# in_degrees on coo is not supported on cuda | ||
@utils.parametrize_cpu('format', ['coo', 'csc']) | ||
@utils.parametrize_gpu('format', ['csc']) | ||
@utils.parametrize('fraction', [0.01, 0.1]) | ||
def track_time(graph_name, format, fraction): | ||
device = utils.get_bench_device() | ||
graph = utils.get_graph(graph_name, format) | ||
graph = graph.to(device) | ||
nids = np.random.choice( | ||
np.arange(graph.num_nodes(), dtype=np.int64), int(graph.num_nodes()*fraction)) | ||
nids = torch.tensor(nids, device=device, dtype=torch.int64) | ||
|
||
# dry run | ||
for i in range(10): | ||
out = graph.in_degrees(i) | ||
|
||
# timing | ||
t0 = time.time() | ||
for i in range(10): | ||
edges = graph.in_degrees(nids) | ||
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,34 @@ | ||
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']) | ||
# in_edges on coo is not supported on cuda | ||
@utils.parametrize_cpu('format', ['coo', 'csc']) | ||
@utils.parametrize_gpu('format', ['csc']) | ||
@utils.parametrize('fraction', [0.01, 0.1]) | ||
def track_time(graph_name, format, fraction): | ||
device = utils.get_bench_device() | ||
graph = utils.get_graph(graph_name, format) | ||
graph = graph.to(device) | ||
nids = np.random.choice( | ||
np.arange(graph.num_nodes(), dtype=np.int64), int(graph.num_nodes()*fraction)) | ||
nids = torch.tensor(nids, device=device, dtype=torch.int64) | ||
|
||
# dry run | ||
for i in range(10): | ||
out = graph.in_edges(i) | ||
|
||
# timing | ||
t0 = time.time() | ||
for i in range(10): | ||
edges = graph.in_edges(nids) | ||
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