dmlc / dmlc/dgl

[GraphBolt][Hetero] Utilize single tensor with offsets instead of dict

Open
#7,244 1 comment 0 reactions 0 assignees View on GitHub
Work Item
Dominant language
Python
Stars
14.3k
Forks
3.1k
PR merge metrics
No merged PRs in 30d

Description

## 🔨Work Item

**IMPORTANT:**
* This template is only for dev team to track project progress. For feature request or bug report, please use the corresponding issue templates.
* DO NOT create a new work item if the purpose is to fix an existing issue or feature request. We will directly use the issue in the project tracker.

Project tracker: https://github.com/orgs/dmlc/projects/2

## Description

If we can utilize a single tensor along with offsets to store seeds or sampled edges, that can make our code more performant by avoiding loops over etypes on the Python side.

So that we can almost remove these two functions:

https://github.com/dmlc/dgl/blob/2f585940a80efd39639388dfc206498b3279e58d/python/dgl/graphbolt/impl/fused_csc_sampling_graph.py#L454-L469

We can use `gb.expand_indptr` to perform batched computations on the whole tensor in a single call to first broadcast the elements of the operation and then perform the computation.

@frozenbugs @peizhou001

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.