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
541f2ba4
Unverified
Commit
541f2ba4
authored
Dec 20, 2023
by
Rhett Ying
Committed by
GitHub
Dec 20, 2023
Browse files
[GraphBolt] make in_memory optional in OnDiskDataset (#6789)
parent
6db323b3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
python/dgl/graphbolt/impl/ondisk_dataset.py
python/dgl/graphbolt/impl/ondisk_dataset.py
+12
-4
tests/python/pytorch/graphbolt/gb_test_utils.py
tests/python/pytorch/graphbolt/gb_test_utils.py
+0
-1
tests/python/pytorch/graphbolt/impl/test_ondisk_dataset.py
tests/python/pytorch/graphbolt/impl/test_ondisk_dataset.py
+0
-1
No files found.
python/dgl/graphbolt/impl/ondisk_dataset.py
View file @
541f2ba4
...
...
@@ -118,18 +118,23 @@ def preprocess_ondisk_dataset(
# the sampling-graph.
if
input_config
[
"graph"
].
get
(
"feature_data"
,
None
):
for
graph_feature
in
input_config
[
"graph"
][
"feature_data"
]:
in_memory
=
(
True
if
"in_memory"
not
in
graph_feature
else
graph_feature
[
"in_memory"
]
)
if
graph_feature
[
"domain"
]
==
"node"
:
node_data
=
read_data
(
os
.
path
.
join
(
dataset_dir
,
graph_feature
[
"path"
]),
graph_feature
[
"format"
],
in_memory
=
graph_feature
[
"
in_memory
"
]
,
in_memory
=
in_memory
,
)
g
.
ndata
[
graph_feature
[
"name"
]]
=
node_data
if
graph_feature
[
"domain"
]
==
"edge"
:
edge_data
=
read_data
(
os
.
path
.
join
(
dataset_dir
,
graph_feature
[
"path"
]),
graph_feature
[
"format"
],
in_memory
=
graph_feature
[
"
in_memory
"
]
,
in_memory
=
in_memory
,
)
g
.
edata
[
graph_feature
[
"name"
]]
=
edge_data
...
...
@@ -164,12 +169,15 @@ def preprocess_ondisk_dataset(
out_feature
[
"path"
]
=
os
.
path
.
join
(
processed_dir_prefix
,
feature
[
"path"
].
replace
(
"pt"
,
"npy"
)
)
in_memory
=
(
True
if
"in_memory"
not
in
feature
else
feature
[
"in_memory"
]
)
copy_or_convert_data
(
os
.
path
.
join
(
dataset_dir
,
feature
[
"path"
]),
os
.
path
.
join
(
dataset_dir
,
out_feature
[
"path"
]),
feature
[
"format"
],
out_feature
[
"format"
],
feature
[
"
in_memory
"
]
,
output_format
=
out_feature
[
"format"
],
in_memory
=
in_memory
,
is_feature
=
True
,
)
...
...
tests/python/pytorch/graphbolt/gb_test_utils.py
View file @
541f2ba4
...
...
@@ -173,7 +173,6 @@ def random_homo_graphbolt_graph(
type: null
name: feat
format: numpy
in_memory: true
path:
{
edge_feat_path
}
tasks:
- name: link_prediction
...
...
tests/python/pytorch/graphbolt/impl/test_ondisk_dataset.py
View file @
541f2ba4
...
...
@@ -1285,7 +1285,6 @@ def test_OnDiskDataset_preprocess_yaml_content_unix():
type: null
name: feat
format: numpy
in_memory: true
path: data/edge-feat.npy
feature_data:
- domain: node
...
...
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