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
2968c9b2
Unverified
Commit
2968c9b2
authored
Dec 04, 2023
by
Rhett Ying
Committed by
GitHub
Dec 04, 2023
Browse files
[GraphBolt] remove SingleProcessDataLoader (#6663)
parent
018df054
Changes
26
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
22 deletions
+17
-22
tests/python/pytorch/graphbolt/test_integration.py
tests/python/pytorch/graphbolt/test_integration.py
+12
-15
tests/python/pytorch/graphbolt/test_item_sampler.py
tests/python/pytorch/graphbolt/test_item_sampler.py
+1
-3
tests/python/pytorch/graphbolt/test_minibatch_transformer.py
tests/python/pytorch/graphbolt/test_minibatch_transformer.py
+1
-1
tests/python/pytorch/graphbolt/test_multi_process_dataloader.py
...python/pytorch/graphbolt/test_multi_process_dataloader.py
+1
-1
tests/python/pytorch/graphbolt/test_single_process_dataloader.py
...ython/pytorch/graphbolt/test_single_process_dataloader.py
+1
-1
tutorials/multi/2_node_classification.py
tutorials/multi/2_node_classification.py
+1
-1
No files found.
tests/python/pytorch/graphbolt/test_integration.py
View file @
2968c9b2
...
@@ -56,7 +56,7 @@ def test_integration_link_prediction():
...
@@ -56,7 +56,7 @@ def test_integration_link_prediction():
feature_store
,
node_feature_keys
=
[
"feat"
],
edge_feature_keys
=
[
"feat"
]
feature_store
,
node_feature_keys
=
[
"feat"
],
edge_feature_keys
=
[
"feat"
]
)
)
datapipe
=
datapipe
.
to_dgl
()
datapipe
=
datapipe
.
to_dgl
()
dataloader
=
gb
.
SingleProcess
DataLoader
(
dataloader
=
gb
.
DataLoader
(
datapipe
,
datapipe
,
)
)
expected
=
[
expected
=
[
...
@@ -71,13 +71,13 @@ def test_integration_link_prediction():
...
@@ -71,13 +71,13 @@ def test_integration_link_prediction():
[0.9634, 0.2294],
[0.9634, 0.2294],
[0.5503, 0.8223]])},
[0.5503, 0.8223]])},
negative_node_pairs=(tensor([0, 1, 1, 1]),
negative_node_pairs=(tensor([0, 1, 1, 1]),
tensor([
0, 3
, 4,
5
])),
tensor([
4
, 4,
1, 4
])),
labels=None,
labels=None,
input_nodes=None,
input_nodes=None,
edge_features=[{},
edge_features=[{},
{}],
{}],
blocks=[Block(num_src_nodes=6, num_dst_nodes=6, num_edges=2),
blocks=[Block(num_src_nodes=6, num_dst_nodes=6, num_edges=2),
Block(num_src_nodes=6, num_dst_nodes=
6
, num_edges=
2
)],
Block(num_src_nodes=6, num_dst_nodes=
5
, num_edges=
1
)],
)"""
)"""
),
),
str
(
str
(
...
@@ -90,7 +90,7 @@ def test_integration_link_prediction():
...
@@ -90,7 +90,7 @@ def test_integration_link_prediction():
[0.5160, 0.2486],
[0.5160, 0.2486],
[0.6172, 0.7865]])},
[0.6172, 0.7865]])},
negative_node_pairs=(tensor([0, 1, 1, 2]),
negative_node_pairs=(tensor([0, 1, 1, 2]),
tensor([1, 3, 4
, 1
])),
tensor([1,
1,
3, 4])),
labels=None,
labels=None,
input_nodes=None,
input_nodes=None,
edge_features=[{},
edge_features=[{},
...
@@ -104,17 +104,15 @@ def test_integration_link_prediction():
...
@@ -104,17 +104,15 @@ def test_integration_link_prediction():
tensor([0, 0])),
tensor([0, 0])),
output_nodes=None,
output_nodes=None,
node_features={'feat': tensor([[0.5160, 0.2486],
node_features={'feat': tensor([[0.5160, 0.2486],
[0.5503, 0.8223],
[0.5503, 0.8223]])},
[0.8672, 0.2276],
[0.9634, 0.2294]])},
negative_node_pairs=(tensor([0, 1]),
negative_node_pairs=(tensor([0, 1]),
tensor([
1
,
2
])),
tensor([
0
,
0
])),
labels=None,
labels=None,
input_nodes=None,
input_nodes=None,
edge_features=[{},
edge_features=[{},
{}],
{}],
blocks=[Block(num_src_nodes=
4
, num_dst_nodes=
4
, num_edges=
2
),
blocks=[Block(num_src_nodes=
2
, num_dst_nodes=
2
, num_edges=
1
),
Block(num_src_nodes=
4
, num_dst_nodes=
3
, num_edges=
2
)],
Block(num_src_nodes=
2
, num_dst_nodes=
2
, num_edges=
1
)],
)"""
)"""
),
),
]
]
...
@@ -172,7 +170,7 @@ def test_integration_node_classification():
...
@@ -172,7 +170,7 @@ def test_integration_node_classification():
feature_store
,
node_feature_keys
=
[
"feat"
],
edge_feature_keys
=
[
"feat"
]
feature_store
,
node_feature_keys
=
[
"feat"
],
edge_feature_keys
=
[
"feat"
]
)
)
datapipe
=
datapipe
.
to_dgl
()
datapipe
=
datapipe
.
to_dgl
()
dataloader
=
gb
.
SingleProcess
DataLoader
(
dataloader
=
gb
.
DataLoader
(
datapipe
,
datapipe
,
)
)
expected
=
[
expected
=
[
...
@@ -184,15 +182,14 @@ def test_integration_node_classification():
...
@@ -184,15 +182,14 @@ def test_integration_node_classification():
[0.8672, 0.2276],
[0.8672, 0.2276],
[0.6172, 0.7865],
[0.6172, 0.7865],
[0.2109, 0.1089],
[0.2109, 0.1089],
[0.5503, 0.8223],
[0.5503, 0.8223]])},
[0.9634, 0.2294]])},
negative_node_pairs=None,
negative_node_pairs=None,
labels=None,
labels=None,
input_nodes=None,
input_nodes=None,
edge_features=[{},
edge_features=[{},
{}],
{}],
blocks=[Block(num_src_nodes=
6
, num_dst_nodes=
5
, num_edges=
5
),
blocks=[Block(num_src_nodes=
5
, num_dst_nodes=
4
, num_edges=
4
),
Block(num_src_nodes=
5
, num_dst_nodes=4, num_edges=4)],
Block(num_src_nodes=
4
, num_dst_nodes=4, num_edges=4)],
)"""
)"""
),
),
str
(
str
(
...
...
tests/python/pytorch/graphbolt/test_item_sampler.py
View file @
2968c9b2
...
@@ -759,9 +759,7 @@ def distributed_item_sampler_subprocess(
...
@@ -759,9 +759,7 @@ def distributed_item_sampler_subprocess(
gb
.
BasicFeatureStore
({}),
gb
.
BasicFeatureStore
({}),
[],
[],
)
)
data_loader
=
gb
.
MultiProcessDataLoader
(
data_loader
=
gb
.
DataLoader
(
feature_fetcher
,
num_workers
=
num_workers
)
feature_fetcher
,
num_workers
=
num_workers
)
# Count the numbers of items and batches.
# Count the numbers of items and batches.
num_items
=
0
num_items
=
0
...
...
tests/python/pytorch/graphbolt/test_minibatch_transformer.py
View file @
2968c9b2
...
@@ -27,7 +27,7 @@ def test_dgl_minibatch_converter():
...
@@ -27,7 +27,7 @@ def test_dgl_minibatch_converter():
[
"a"
],
[
"a"
],
)
)
dgl_converter
=
gb
.
DGLMiniBatchConverter
(
feature_fetcher
)
dgl_converter
=
gb
.
DGLMiniBatchConverter
(
feature_fetcher
)
dataloader
=
gb
.
SingleProcess
DataLoader
(
dgl_converter
)
dataloader
=
gb
.
DataLoader
(
dgl_converter
)
assert
len
(
list
(
dataloader
))
==
N
//
B
assert
len
(
list
(
dataloader
))
==
N
//
B
minibatch
=
next
(
iter
(
dataloader
))
minibatch
=
next
(
iter
(
dataloader
))
assert
isinstance
(
minibatch
,
gb
.
DGLMiniBatch
)
assert
isinstance
(
minibatch
,
gb
.
DGLMiniBatch
)
tests/python/pytorch/graphbolt/test_multi_process_dataloader.py
View file @
2968c9b2
...
@@ -34,7 +34,7 @@ def test_DataLoader():
...
@@ -34,7 +34,7 @@ def test_DataLoader():
)
)
device_transferrer
=
dgl
.
graphbolt
.
CopyTo
(
feature_fetcher
,
F
.
ctx
())
device_transferrer
=
dgl
.
graphbolt
.
CopyTo
(
feature_fetcher
,
F
.
ctx
())
dataloader
=
dgl
.
graphbolt
.
MultiProcess
DataLoader
(
dataloader
=
dgl
.
graphbolt
.
DataLoader
(
device_transferrer
,
device_transferrer
,
num_workers
=
4
,
num_workers
=
4
,
)
)
...
...
tests/python/pytorch/graphbolt/test_single_process_dataloader.py
View file @
2968c9b2
...
@@ -32,5 +32,5 @@ def test_DataLoader():
...
@@ -32,5 +32,5 @@ def test_DataLoader():
)
)
device_transferrer
=
dgl
.
graphbolt
.
CopyTo
(
feature_fetcher
,
F
.
ctx
())
device_transferrer
=
dgl
.
graphbolt
.
CopyTo
(
feature_fetcher
,
F
.
ctx
())
dataloader
=
dgl
.
graphbolt
.
SingleProcess
DataLoader
(
device_transferrer
)
dataloader
=
dgl
.
graphbolt
.
DataLoader
(
device_transferrer
)
assert
len
(
list
(
dataloader
))
==
N
//
B
assert
len
(
list
(
dataloader
))
==
N
//
B
tutorials/multi/2_node_classification.py
View file @
2968c9b2
...
@@ -120,7 +120,7 @@ def create_dataloader(
...
@@ -120,7 +120,7 @@ def create_dataloader(
datapipe
=
datapipe
.
fetch_feature
(
features
,
node_feature_keys
=
[
"feat"
])
datapipe
=
datapipe
.
fetch_feature
(
features
,
node_feature_keys
=
[
"feat"
])
datapipe
=
datapipe
.
to_dgl
()
datapipe
=
datapipe
.
to_dgl
()
datapipe
=
datapipe
.
copy_to
(
device
)
datapipe
=
datapipe
.
copy_to
(
device
)
dataloader
=
gb
.
MultiProcess
DataLoader
(
datapipe
,
num_workers
=
0
)
dataloader
=
gb
.
DataLoader
(
datapipe
,
num_workers
=
0
)
return
dataloader
return
dataloader
...
...
Prev
1
2
Next
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