dmlc / dmlc/dgl

[Feature][Performance] Optimize `graph.local_scope()` to take less CPU time (currently takes 50 - 100us)

Open
#4,527 1 comment 0 reactions 2 assignees Claimed by @jermainewang View on GitHub
topic: system performance
Dominant language
Python
Stars
14.3k
Forks
3.1k
PR merge metrics
No merged PRs in 30d

Description

## 🚀 Feature
When performing message passing, we often do:
```
with graph.local_sope():
graph.dstdata['h'] = ...
```
However, the local scope operation which duplicates all of the Frame and Column objects, can take longer than the SpMM operation executing on the GPU in message passing. Bringing down the CPU time of this function could help better utilize the GPU and make DGL more effective for small batch sizes.

## Alternatives

If we can't get the time of .local_scope() down, we may want to consider having function maintain the data separate from the graph.

## Pitch

Looking at the code, the optimization path isn't clear, but in general we would want to try to reduce the number of for loops and memory allocations needed.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.