Skip to content

changes required to make subgraphs work in nvt #343

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

Merged
merged 2 commits into from
Jun 9, 2023

Conversation

jperez999
Copy link
Collaborator

This PR has some changes that fix some issues with graphs and it refactors the iter_nodes method in node to handle flattening of nodes in graphs that are subgraphs. These changes are required to make subgraphs work in nvtabular.

@jperez999 jperez999 added the enhancement New feature or request label Jun 9, 2023
@jperez999 jperez999 added this to the Merlin 23.06 milestone Jun 9, 2023
@jperez999 jperez999 requested a review from oliverholworthy June 9, 2023 06:55
@jperez999 jperez999 self-assigned this Jun 9, 2023
@github-actions
Copy link

github-actions bot commented Jun 9, 2023

Documentation preview

https://nvidia-merlin.github.io/core/review/pr-343

@@ -512,7 +512,7 @@ def fit_phase(self, dataset, nodes, strict=False):

dask_client = global_dask_client()
if dask_client:
results = [r.result() for r in dask_client.compute(stats)]
results = [r.result() for r in dask_client.compute(stats) if r is not None]
Copy link
Member

Choose a reason for hiding this comment

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

what's the scenario where the fit method of a on (Subraph op) returns None?

Copy link
Collaborator Author

@jperez999 jperez999 Jun 9, 2023

Choose a reason for hiding this comment

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

Always, because it does not have stats itself. It has operators within it that have stats. So it will return the stats when its graph runs the fit (subgraph runs its own fit) but it wont bubble that up. So in the case where you only have subgraphs and no other stat operator on the main graph you end up in a situation where stats is empty and then there is not r.

Copy link
Member

Choose a reason for hiding this comment

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

stats is empty and then there is not r

if stats is empty ([]) then the dask client compute also returns an empty list dask_client.compute([]) => []. and r is never reached as None in that case.

@jperez999 jperez999 merged commit 94cd515 into NVIDIA-Merlin:main Jun 9, 2023
root_schema, parents_schema, deps_schema, selector
)
self.graph = self.graph.construct_schema(input_schema)
self.graph = self.graph.construct_schema(root_schema)
Copy link
Member

Choose a reason for hiding this comment

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

can you explain why the compute_input_schema method didn't work here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants