-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Conversation
To trigger regression tests:
|
): | ||
if sampler.__name__ == "sample_layer_neighbors": |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Description
Depends on #7207.
Checklist
Please feel free to remove inapplicable items for your PR.
Changes