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] Implement labor dependent minibatching - python side. #7208

Merged
merged 5 commits into from
Mar 13, 2024

Conversation

mfbalin
Copy link
Collaborator

@mfbalin mfbalin commented Mar 12, 2024

Description

Depends on #7207.

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

@mfbalin mfbalin requested a review from frozenbugs March 12, 2024 05:01
@dgl-bot
Copy link
Collaborator

dgl-bot commented Mar 12, 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 Mar 12, 2024

Commit ID: c48fd33

Build ID: 1

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 Mar 12, 2024

Commit ID: 0f820b8

Build ID: 2

Status: ✅ CI test succeeded.

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Mar 13, 2024

Commit ID: 1a176e6

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 Mar 13, 2024

Commit ID: 7a0ec6b

Build ID: 4

Status: ✅ CI test succeeded.

Report path: link

Full logs path: link

@mfbalin mfbalin merged commit a272efe into dmlc:master Mar 13, 2024
2 checks passed
@mfbalin mfbalin deleted the gb_labor_knobs_python branch March 13, 2024 17:05
):
if sampler.__name__ == "sample_layer_neighbors":
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of checking the sampler name here, why not move the self._init_seed(batch_dependency) to init of LayerNeighborSampler?

):
datapipe = datapipe.transform(
partial(self._prepare, graph.node_type_to_id)
)
is_labor = sampler.__name__ == "sample_layer_neighbors"
if is_labor:
datapipe = datapipe.transform(self._set_seed)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here, is it possible to move this sample_layer_neighbors specific code to its own class, instead of hack in the parent class.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

How do you propose we do that without replicating the whole implementation?

Copy link
Collaborator

Choose a reason for hiding this comment

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

it makes sense to replicating some code if needed, it is usually error prone to have parent class's behavior depend on child class's type, which is anti-"oop" pattern.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I understand that. But I feel anti-oop pattern is better than replicating the code. I plan to base Temporal samplers into the NeighborSamplerImpl as well, so that the GPU sampling optimizations can be enabled for the temporal case as well.

This pull request was closed.
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.

3 participants