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

[Performance] Optimize the use of alternative streams in dataloader #4177

Merged
merged 7 commits into from
Jun 29, 2022

Conversation

yaox12
Copy link
Collaborator

@yaox12 yaox12 commented Jun 28, 2022

Description

Main changes:

  1. Use a fixed alternative stream for H2D copy in the dataloader instead of creating a new stream every time. H2D copy to the same GPU in different streams won't overlap.
  2. Put input nodes, seed nodes, and subgraph transfer in the alternative stream.

Before, only node/edge features transfer can overlap with the last step's computing kernels, while the subgraph transfer is not in the alternative stream. There is a launch gap between the H2D copy and the following computing kernels.
image
With this PR, all data transfer in the dataloader can overlap with computation, and the launch gap is reduced.
image

The timeline comes from RGCN training on MAG240M.

Checklist

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [$CATEGORY] (such as [NN], [Model], [Doc], [Feature]])
  • Changes are complete (i.e. I finished coding on this PR)
  • To the best of my knowledge, examples are either not affected by this change,
    or have been fixed to be compatible with this change

@dgl-bot
Copy link
Collaborator

dgl-bot commented Jun 28, 2022

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

This comment was marked as outdated.

@dgl-bot

This comment was marked as outdated.

@dgl-bot

This comment was marked as outdated.

@jermainewang jermainewang added the Release Candidate Candidate PRs for the upcoming release label Jun 29, 2022
@dgl-bot

This comment was marked as outdated.

@dgl-bot
Copy link
Collaborator

dgl-bot commented Jun 29, 2022

Commit ID: 817be8a

Build ID: 5

Status: ✅ CI test succeeded

Report path: link

Full logs path: link

@yaox12 yaox12 merged commit 5bef48d into dmlc:master Jun 29, 2022
@yaox12 yaox12 deleted the fix_use_alternative_streams branch June 29, 2022 08:32
@frozenbugs frozenbugs removed the Release Candidate Candidate PRs for the upcoming release label Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants