Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GraphBolt][CUDA] Refactor overlap_graph_fetch, simplify gb.DataLoader. #7681

Merged
merged 9 commits into from
Aug 12, 2024

Conversation

mfbalin
Copy link
Collaborator

@mfbalin mfbalin commented Aug 11, 2024

Description

  1. Move the logic from gb.DataLoader to the sampling classes for overlap_graph_fetch. It is an argument of the sampler now.
  2. Move the gpu_graph_cache to the FusedCSCSamplingGraph because otherwise it won't be shared across train or validation dataloader for example. That way, there will be a single graph cache for multiple dataloader instances.

The end goal is to make sampling and compaction async and hide the latency of GPU CPU synchronizations during these stages. A lot of our optimizations also have inherent GPU CPU synchronization, which will be handled in the same way. I needed to clean the code and refactor before #7682.

I might refactor more and reduce the amount of code in our code base in the future.

Checklist

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [$CATEGORY] (such as [NN], [Model], [Doc], [Feature]])
  • I've leverage the tools to beautify the python and c++ code.
  • The PR is complete and small, read the Google eng practice (CL equals to PR) to understand more about small PR. In DGL, we consider PRs with less than 200 lines of core code change are small (example, test and documentation could be exempted).
  • All changes have test coverage
  • Code is well-documented
  • To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change
  • Related issue is referred in this PR
  • If the PR is for a new model/paper, I've updated the example index here.

Changes

@dgl-bot
Copy link
Collaborator

dgl-bot commented Aug 11, 2024

To trigger regression tests:

  • @dgl-bot run [instance-type] [which tests] [compare-with-branch];
    For example: @dgl-bot run g4dn.4xlarge all dmlc/master or @dgl-bot run c5.9xlarge kernel,api dmlc/master

@dgl-bot
Copy link
Collaborator

dgl-bot commented Aug 11, 2024

Commit ID: 3a424dc

Build ID: 1

Status: ❌ CI test failed in Stage [Lint Check].

Report path: link

Full logs path: link

@mfbalin mfbalin added the expedited if it doesn't affect the main path approve first to unblock related projects, and review later label Aug 11, 2024
@dgl-bot
Copy link
Collaborator

dgl-bot commented Aug 11, 2024

Commit ID: bde9214

Build ID: 2

Status: ⚪️ CI test cancelled due to overrun.

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Aug 11, 2024

Commit ID: 3b06ef0

Build ID: 3

Status: ⚪️ CI test cancelled due to overrun.

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Aug 11, 2024

Commit ID: 6e2970e

Build ID: 4

Status: ⚪️ CI test cancelled due to overrun.

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Aug 11, 2024

Commit ID: be4009d

Build ID: 5

Status: ⚪️ CI test cancelled due to overrun.

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Aug 11, 2024

Commit ID: 788cd3a

Build ID: 6

Status: ⚪️ CI test cancelled due to overrun.

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Aug 11, 2024

Commit ID: ee4ae84

Build ID: 7

Status: ⚪️ CI test cancelled due to overrun.

Report path: link

Full logs path: link

Copy link
Collaborator Author

@mfbalin mfbalin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went over the whole code and seems to look good to me.

@dgl-bot
Copy link
Collaborator

dgl-bot commented Aug 11, 2024

Commit ID: a76856c

Build ID: 8

Status: ❌ CI test failed in Stage [Torch CPU (Win64) Unit test].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Aug 12, 2024

Commit ID: 45541ad

Build ID: 9

Status: ✅ CI test succeeded.

Report path: link

Full logs path: link

@mfbalin mfbalin merged commit 4c1e14c into dmlc:master Aug 12, 2024
2 checks passed
@mfbalin mfbalin deleted the gb_cuda_refactor_overlap_graph_fetch branch August 12, 2024 02:20
@@ -134,16 +134,14 @@ def create_dataloader(
############################################################################
if args.storage_device != "cpu":
datapipe = datapipe.copy_to(device)
datapipe = datapipe.sample_neighbor(graph, args.fanout)
datapipe = datapipe.sample_neighbor(
graph, args.fanout, overlap_fetch=args.storage_device == "pinned"
Copy link
Collaborator

@frozenbugs frozenbugs Aug 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we release the overlap_fetch in last release, if so, we need to highlight the API change if we really believe this is a good api change.

Copy link
Collaborator Author

@mfbalin mfbalin Aug 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is in DGL 2.3. In this release, this parameter moved from gb.DataLoader to sample_neighbor.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
expedited if it doesn't affect the main path approve first to unblock related projects, and review later
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants