Repository navigation
[Codegen] Make ReconcileTranslationInfo work with multiple exports - #20801
Merged
Merged
Conversation
Symbol uniqueness guarantees that exports -> functions is injective (and
bijective with public functions) so we can greedily reconcile
translation info for each export. It is, however, possible for multiple
publicly exported functions to transiently call a shared function which
needs to resolve with consistent translation info (workgroup/subgroup
size).
To support the kind of code we generate today, this works in 2 steps.
Foreach export:
1. Resolve workgroup count from the immediately exported function
(guaranteed consistent by bijection). This means we don't support
transiently distributed function calls yet.
2. Walk the callgraph to find all locally annotated global kernel
parameters (subgroup/workgroup size) and make sure they are
consistent per export.
qedawkins
force-pushed
the
multi_export_reconcile
branch
from
May 14, 2025 17:19
c79ebe2 to
de8beb4
Compare
MaheshRavishankar
approved these changes
May 15, 2025
hanhanW
reviewed
May 15, 2025
hanhanW
approved these changes
May 16, 2025
AWoloszyn
pushed a commit
that referenced
this pull request
Dec 1, 2025
…20801) Symbol uniqueness guarantees that exports -> functions is injective (and bijective with public functions) so we can greedily reconcile translation info for each export. It is, however, possible for multiple publicly exported functions to transiently call a shared function which needs to resolve with consistent translation info (workgroup/subgroup size). To support the kind of code we generate today, this works in 2 steps. Foreach export: 1. Resolve workgroup count from the immediately exported function (guaranteed consistent by bijection). This means we don't support transiently distributed function calls yet. 2. Walk the callgraph to find all locally annotated global kernel parameters (subgroup/workgroup size) and make sure they are consistent per export.
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.
Symbol uniqueness guarantees that exports -> functions is injective (and bijective with public functions) so we can greedily reconcile translation info for each export. It is, however, possible for multiple publicly exported functions to transiently call a shared function which needs to resolve with consistent translation info (workgroup/subgroup size).
To support the kind of code we generate today, this works in 2 steps. Foreach export: