Fix nested workunits - #435
Open
WeiTaShao wants to merge 3 commits into
Open
Conversation
IvanGrigorik
reviewed
Aug 8, 2026
IvanGrigorik
left a comment
Collaborator
There was a problem hiding this comment.
self.add_called_functions is highly questionable.
I'm not sure if this is the easiest way to check which function is called.
Instead of gathering all possible functions (which is insanely heavy) we can check which function is called based on the current context directly from the AST translator.
And yes, don't remote @pk.function decorator nor ignore it. It will be a pain if we will try to visit each function without looking at its source of it.
| self, | ||
| path: List[str], | ||
| name: str, | ||
| ast_signature: str, |
Collaborator
There was a problem hiding this comment.
So...
Now you will recompile if ANYTHING in AST changed?
That's questionable.
Collaborator
There was a problem hiding this comment.
Please add a test of defining a function in one module (file) and using it from another module workunit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implicit helper functions
Standalone PyKokkos workunits can call compatible module-level Python functions without requiring the
@pk.functiondecorator. PyKokkos discovers helper functions reachable from the workunit, recursively includes their same-module dependencies in translation, and excludes unrelated host-side functions.