Skip to content

Commit

Permalink
more fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
mfbalin committed Oct 11, 2024
1 parent bec6f17 commit 01b77dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions python/dgl/graphbolt/feature_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@ def _cooperative_exchange(self, data):
node_features = {key: {} for _, key in data.node_features.keys()}
for (ntype, key), feature in data.node_features.items():
node_features[key][ntype] = feature
for key, feature in node_features.items():
for key, feature in sorted(node_features.items()):
new_feature = CooperativeConvFunction.apply(subgraph, feature)
for ntype, tensor in new_feature.items():
data.node_features[(ntype, key)] = tensor
else:
for key in data.node_features:
for key in sorted(data.node_features):
feature = data.node_features[key]
new_feature = CooperativeConvFunction.apply(subgraph, feature)
data.node_features[key] = new_feature
Expand Down
6 changes: 4 additions & 2 deletions python/dgl/graphbolt/impl/cooperative_conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def forward(
seed_sizes,
)
outs = {}
for ntype, typed_tensor in convert_to_hetero(tensor).items():
for ntype, typed_tensor in sorted(convert_to_hetero(tensor).items()):
out = typed_tensor.new_empty(
(sum(counts_sent.get(ntype, [0])),) + typed_tensor.shape[1:],
requires_grad=typed_tensor.requires_grad,
Expand Down Expand Up @@ -70,7 +70,9 @@ def backward(
) = ctx.communication_variables
delattr(ctx, "communication_variables")
outs = {}
for ntype, typed_grad_output in convert_to_hetero(grad_output).items():
for ntype, typed_grad_output in sorted(
convert_to_hetero(grad_output).items()
):
out = typed_grad_output.new_empty(
(sum(counts_received[ntype]),) + typed_grad_output.shape[1:]
)
Expand Down

0 comments on commit 01b77dc

Please sign in to comment.