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
cd2cf606
Unverified
Commit
cd2cf606
authored
Aug 10, 2021
by
xiang song(charlie.song)
Committed by
GitHub
Aug 10, 2021
Browse files
[Bugfix] Fix bug introduced by
https://github.com/dmlc/dgl/pull/3131
(#3234)
* Fix bug * Fix * Fix * upd * trigger
parent
799c091e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
python/dgl/distributed/dist_graph.py
python/dgl/distributed/dist_graph.py
+12
-2
No files found.
python/dgl/distributed/dist_graph.py
View file @
cd2cf606
...
...
@@ -15,6 +15,7 @@ from .. import backend as F
from
..base
import
NID
,
EID
,
NTYPE
,
ETYPE
,
ALL
,
is_all
from
.kvstore
import
KVServer
,
get_kvstore
from
.._ffi.ndarray
import
empty_shared_mem
from
..ndarray
import
exist_shared_mem_array
from
..frame
import
infer_scheme
from
.partition
import
load_partition
,
load_partition_book
from
.graph_partition_book
import
PartitionPolicy
,
get_shared_mem_partition_book
...
...
@@ -76,6 +77,9 @@ def _copy_graph_to_shared_mem(g, graph_name, graph_format):
new_g
.
edata
[
'inner_edge'
]
=
_to_shared_mem
(
g
.
edata
[
'inner_edge'
],
_get_edata_path
(
graph_name
,
'inner_edge'
))
new_g
.
edata
[
EID
]
=
_to_shared_mem
(
g
.
edata
[
EID
],
_get_edata_path
(
graph_name
,
EID
))
# for heterogeneous graph, we need to put ETYPE into KVStore
# for homogeneous graph, ETYPE does not exist
if
ETYPE
in
g
.
edata
:
new_g
.
edata
[
ETYPE
]
=
_to_shared_mem
(
g
.
edata
[
ETYPE
],
_get_edata_path
(
graph_name
,
ETYPE
))
return
new_g
...
...
@@ -112,6 +116,9 @@ def _get_shared_mem_edata(g, graph_name, name):
dlpack
=
data
.
to_dlpack
()
return
F
.
zerocopy_from_dlpack
(
dlpack
)
def
_exist_shared_mem_array
(
graph_name
,
name
):
return
exist_shared_mem_array
(
_get_edata_path
(
graph_name
,
name
))
def
_get_graph_from_shared_mem
(
graph_name
):
''' Get the graph from the DistGraph server.
...
...
@@ -129,6 +136,9 @@ def _get_graph_from_shared_mem(graph_name):
g
.
edata
[
'inner_edge'
]
=
_get_shared_mem_edata
(
g
,
graph_name
,
'inner_edge'
)
g
.
edata
[
EID
]
=
_get_shared_mem_edata
(
g
,
graph_name
,
EID
)
# heterogeneous graph has ETYPE
if
_exist_shared_mem_array
(
graph_name
,
ETYPE
):
g
.
edata
[
ETYPE
]
=
_get_shared_mem_edata
(
g
,
graph_name
,
ETYPE
)
return
g
...
...
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