Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
50cbb0ec
"vscode:/vscode.git/clone" did not exist on "0fb41c2811f19025b6588cef027097bc79576c68"
Unverified
Commit
50cbb0ec
authored
Dec 12, 2023
by
Rhett Ying
Committed by
GitHub
Dec 12, 2023
Browse files
[GraphBolt] remove single process DGL test (#6729)
parent
836fbb00
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
19 additions
and
50 deletions
+19
-50
tests/python/pytorch/graphbolt/__init__.py
tests/python/pytorch/graphbolt/__init__.py
+1
-0
tests/python/pytorch/graphbolt/impl/test_fused_csc_sampling_graph.py
...n/pytorch/graphbolt/impl/test_fused_csc_sampling_graph.py
+2
-1
tests/python/pytorch/graphbolt/impl/test_in_subgraph_sampler.py
...python/pytorch/graphbolt/impl/test_in_subgraph_sampler.py
+2
-2
tests/python/pytorch/graphbolt/impl/test_negative_sampler.py
tests/python/pytorch/graphbolt/impl/test_negative_sampler.py
+2
-1
tests/python/pytorch/graphbolt/impl/test_ondisk_dataset.py
tests/python/pytorch/graphbolt/impl/test_ondisk_dataset.py
+2
-1
tests/python/pytorch/graphbolt/test_base.py
tests/python/pytorch/graphbolt/test_base.py
+2
-1
tests/python/pytorch/graphbolt/test_dataloader.py
tests/python/pytorch/graphbolt/test_dataloader.py
+2
-5
tests/python/pytorch/graphbolt/test_feature_fetcher.py
tests/python/pytorch/graphbolt/test_feature_fetcher.py
+2
-1
tests/python/pytorch/graphbolt/test_minibatch_transformer.py
tests/python/pytorch/graphbolt/test_minibatch_transformer.py
+2
-1
tests/python/pytorch/graphbolt/test_single_process_dataloader.py
...ython/pytorch/graphbolt/test_single_process_dataloader.py
+0
-36
tests/python/pytorch/graphbolt/test_subgraph_sampler.py
tests/python/pytorch/graphbolt/test_subgraph_sampler.py
+2
-1
No files found.
tests/python/pytorch/graphbolt/__init__.py
0 → 100644
View file @
50cbb0ec
""" DGL graphbolt API tests"""
tests/python/pytorch/graphbolt/impl/test_fused_csc_sampling_graph.py
View file @
50cbb0ec
...
...
@@ -8,12 +8,13 @@ import backend as F
import
dgl
import
dgl.graphbolt
as
gb
import
gb_test_utils
as
gbt
import
pytest
import
torch
import
torch.multiprocessing
as
mp
from
scipy
import
sparse
as
spsp
from
..
import
gb_test_utils
as
gbt
torch
.
manual_seed
(
3407
)
mp
.
set_sharing_strategy
(
"file_system"
)
...
...
tests/python/pytorch/graphbolt/impl/test_in_subgraph_sampler.py
View file @
50cbb0ec
import
dgl.graphbolt
as
gb
import
gb_test_utils
import
pytest
import
torch
from
..
import
gb_test_utils
def
test_InSubgraphSampler_homo
():
"""Original graph in COO:
...
...
tests/python/pytorch/graphbolt/impl/test_negative_sampler.py
View file @
50cbb0ec
import
dgl.graphbolt
as
gb
import
gb_test_utils
import
pytest
import
torch
from
..
import
gb_test_utils
def
test_NegativeSampler_invoke
():
# Instantiate graph and required datapipes.
...
...
tests/python/pytorch/graphbolt/impl/test_ondisk_dataset.py
View file @
50cbb0ec
...
...
@@ -6,7 +6,6 @@ import tempfile
import
unittest
import
warnings
import
gb_test_utils
as
gbt
import
numpy
as
np
import
pandas
as
pd
import
pydantic
...
...
@@ -16,6 +15,8 @@ import yaml
from
dgl
import
graphbolt
as
gb
from
..
import
gb_test_utils
as
gbt
def
write_yaml_file
(
yaml_content
,
dir
):
os
.
makedirs
(
os
.
path
.
join
(
dir
,
"preprocessed"
),
exist_ok
=
True
)
...
...
tests/python/pytorch/graphbolt/test_base.py
View file @
50cbb0ec
...
...
@@ -4,10 +4,11 @@ import unittest
import
backend
as
F
import
dgl.graphbolt
as
gb
import
gb_test_utils
import
pytest
import
torch
from
.
import
gb_test_utils
@
unittest
.
skipIf
(
F
.
_default_context_str
==
"cpu"
,
"CopyTo needs GPU to test"
)
def
test_CopyTo
():
...
...
tests/python/pytorch/graphbolt/test_
multi_process_
dataloader.py
→
tests/python/pytorch/graphbolt/test_dataloader.py
View file @
50cbb0ec
import
os
import
unittest
import
backend
as
F
import
dgl
import
dgl.graphbolt
import
gb_test_utils
import
torch
from
torchdata.datapipes.iter
import
Mapper
from
.
import
gb_test_utils
def
test_DataLoader
():
...
...
tests/python/pytorch/graphbolt/test_feature_fetcher.py
View file @
50cbb0ec
...
...
@@ -2,11 +2,12 @@ import random
from
enum
import
Enum
import
dgl.graphbolt
as
gb
import
gb_test_utils
import
pytest
import
torch
from
torchdata.datapipes.iter
import
Mapper
from
.
import
gb_test_utils
class
MiniBatchType
(
Enum
):
MiniBatch
=
1
...
...
tests/python/pytorch/graphbolt/test_minibatch_transformer.py
View file @
50cbb0ec
import
dgl.graphbolt
as
gb
import
gb_test_utils
import
torch
from
.
import
gb_test_utils
def
test_dgl_minibatch_converter
():
N
=
32
...
...
tests/python/pytorch/graphbolt/test_single_process_dataloader.py
deleted
100644 → 0
View file @
836fbb00
import
backend
as
F
import
dgl
import
dgl.graphbolt
import
gb_test_utils
import
torch
from
torchdata.datapipes.iter
import
Mapper
def
test_DataLoader
():
N
=
32
B
=
4
itemset
=
dgl
.
graphbolt
.
ItemSet
(
torch
.
arange
(
N
),
names
=
"seed_nodes"
)
graph
=
gb_test_utils
.
rand_csc_graph
(
200
,
0.15
,
bidirection_edge
=
True
)
features
=
{}
keys
=
[(
"node"
,
None
,
"a"
),
(
"node"
,
None
,
"b"
)]
features
[
keys
[
0
]]
=
dgl
.
graphbolt
.
TorchBasedFeature
(
torch
.
randn
(
200
,
4
))
features
[
keys
[
1
]]
=
dgl
.
graphbolt
.
TorchBasedFeature
(
torch
.
randn
(
200
,
4
))
feature_store
=
dgl
.
graphbolt
.
BasicFeatureStore
(
features
)
item_sampler
=
dgl
.
graphbolt
.
ItemSampler
(
itemset
,
batch_size
=
B
)
subgraph_sampler
=
dgl
.
graphbolt
.
NeighborSampler
(
item_sampler
,
graph
,
fanouts
=
[
torch
.
LongTensor
([
2
])
for
_
in
range
(
2
)],
)
feature_fetcher
=
dgl
.
graphbolt
.
FeatureFetcher
(
subgraph_sampler
,
feature_store
,
[
"a"
],
)
device_transferrer
=
dgl
.
graphbolt
.
CopyTo
(
feature_fetcher
,
F
.
ctx
())
dataloader
=
dgl
.
graphbolt
.
DataLoader
(
device_transferrer
)
assert
len
(
list
(
dataloader
))
==
N
//
B
tests/python/pytorch/graphbolt/test_subgraph_sampler.py
View file @
50cbb0ec
import
dgl
import
dgl.graphbolt
as
gb
import
gb_test_utils
import
pytest
import
torch
from
torchdata.datapipes.iter
import
Mapper
from
.
import
gb_test_utils
def
test_SubgraphSampler_invoke
():
itemset
=
gb
.
ItemSet
(
torch
.
arange
(
10
),
names
=
"seed_nodes"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment