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
0504bc2c
Unverified
Commit
0504bc2c
authored
Feb 07, 2024
by
Rhett Ying
Committed by
GitHub
Feb 07, 2024
Browse files
[DistGB] use expand_indptr for csc to coo (#7090)
parent
43912418
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
python/dgl/distributed/graph_services.py
python/dgl/distributed/graph_services.py
+5
-2
python/dgl/distributed/partition.py
python/dgl/distributed/partition.py
+2
-3
No files found.
python/dgl/distributed/graph_services.py
View file @
0504bc2c
...
...
@@ -151,8 +151,11 @@ def _sample_neighbors_graphbolt(
# 3. Map local node IDs to global node IDs.
local_src
=
subgraph
.
indices
local_dst
=
torch
.
repeat_interleave
(
subgraph
.
original_column_node_ids
,
torch
.
diff
(
subgraph
.
indptr
)
local_dst
=
gb
.
expand_indptr
(
subgraph
.
indptr
,
dtype
=
local_src
.
dtype
,
node_ids
=
subgraph
.
original_column_node_ids
,
output_size
=
local_src
.
shape
[
0
],
)
global_nid_mapping
=
g
.
node_attributes
[
NID
]
global_src
=
global_nid_mapping
[
local_src
]
...
...
python/dgl/distributed/partition.py
View file @
0504bc2c
...
...
@@ -199,11 +199,10 @@ def _verify_graphbolt_partition(graph, part_id, gpb, ntypes, etypes):
field
in
graph
.
edge_attributes
for
field
in
required_edata_fields
),
"the partition graph should contain edge mapping to global edge ID."
num_nodes
=
graph
.
total_num_nodes
num_edges
=
graph
.
total_num_edges
local_src_ids
=
graph
.
indices
local_dst_ids
=
torch
.
repeat_interleave
(
torch
.
arange
(
num_nodes
),
torch
.
diff
(
graph
.
csc_indptr
)
local_dst_ids
=
gb
.
expand_indptr
(
graph
.
csc_indptr
,
dtype
=
local_src_ids
.
dtype
,
output_size
=
num_edges
)
global_src_ids
=
graph
.
node_attributes
[
NID
][
local_src_ids
]
global_dst_ids
=
graph
.
node_attributes
[
NID
][
local_dst_ids
]
...
...
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