-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[Unity][IR] Purity Tracking #14394
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
[Unity][IR] Purity Tracking #14394
Changes from all commits
Commits
Show all changes
73 commits
Select commit
Hold shift + click to select a range
1168c6f
Preliminary work
slyubomirsky e4bae67
Won't try to infer purity for now
slyubomirsky 8ba3041
Rename `pure` field to `purity`
slyubomirsky 33b992d
Use attrs to annotate function purity
slyubomirsky b7b5685
Start implementing purity tracking
slyubomirsky ecd85c9
Add purity into pretty printer for FuncStructInfo
slyubomirsky 15f864e
Process purity when parsing function declarations
slyubomirsky ca5aacf
Annotate purity for remaining operators
slyubomirsky b10f3cf
Whitespace
slyubomirsky ee8bf11
More whitespace and remove outdated comment
slyubomirsky 7181b4f
More linting fixes
slyubomirsky d6a4800
One more fixed comment
slyubomirsky 1c94524
Handle purity in the AST printer
slyubomirsky d288c31
Ensure we are parsing an Expr before checking for an attribute
slyubomirsky 29f01fe
Mark purity for remaining ops
slyubomirsky 34a6c80
Factor out repeated call_pure unwrapping
slyubomirsky e5c9da5
Add purity wrappers and annotations in test_vm_build
slyubomirsky 82a62b3
One more WrapCallPure in vm_shape_lower
slyubomirsky c485ed2
Handle call_pure in memory planning
slyubomirsky e8b0132
One more simplification
slyubomirsky 62d8852
Handle call_pure in one more case
slyubomirsky f843689
Fix struct info analysis test: cannot pass an opaque (impure) functio…
slyubomirsky 07b55e2
Transfer over StructInfo in the call_pure wrappers
slyubomirsky 7da2125
Make corrections to some VM shape lower tests
slyubomirsky 4e52206
Add transformation to disable purity checking at low levels of compil…
slyubomirsky 3932d4e
Remove purity checking before low-level passes, revert changes
slyubomirsky e4d9b6a
Also revert changes to VM code generation
slyubomirsky d005a55
Fix VMShapeLower tests
slyubomirsky 7cc7ef7
Fix TVMScript printer test
slyubomirsky e8c8365
Fix TVMScript parser test
slyubomirsky b9fff59
Add special handling for printing call_pure, print, and assert_op
slyubomirsky d89ff7d
Fix tests in test_transform.py
slyubomirsky 407547b
Remove purity checking in test_codegen_dnnl.py
slyubomirsky 0b1f667
Add purity annotation for tensor_to_shape
slyubomirsky 00316de
Handle call_pure in FuseTIR
slyubomirsky 6ee5773
Be more discerning about inserting call_pure in LegalizeOps
slyubomirsky 2a5cafe
Fix various tests to account for purity
slyubomirsky b51824c
Add ForcePure annotations in the static memory planning tests
slyubomirsky 66bee84
Add purity annotation for stop_lift_params
slyubomirsky 1239a36
Insert call_pure in LambdaLift for invoking closures
slyubomirsky 4df0097
Fix outdated comment in test
slyubomirsky 511dbfb
Need ToNonDataflow to keep everything consistent
slyubomirsky d995686
Missing call_pure for a BindParams test
slyubomirsky 88324c4
Preserve purity in RunCodegen
slyubomirsky 3c2eeeb
Address changes during rebase
slyubomirsky 4326188
Rebase fixes and add purity annotations for new ops
slyubomirsky 7d6cd1d
Fix docstring for contains_impure_call
slyubomirsky 99102aa
Remove manipulate ops tests that are intentionally not supported
slyubomirsky 1d42358
Address TODO: At least one builtin is impure
slyubomirsky ddc15db
Replace call_pure with call_pure_packed, call_pure_dps_packed, invoke…
slyubomirsky cc128ab
Formatting
slyubomirsky 382e467
Correct rebase errror
slyubomirsky 419a021
Address dynamic_strided_slice
slyubomirsky 4c9d28f
Linting: Remove unused import
slyubomirsky 51a5d42
Fix incorrect purity annotations
slyubomirsky b91878e
Fix incorrect comment in well_formed
slyubomirsky 1387180
Add explanatory comment in unusual test case
slyubomirsky cd8675a
Use call_pure_packed in pipeline test
slyubomirsky f26eedb
Update transform_fuse_ops test
slyubomirsky 697919d
Use ForcePure for the CUDA graph rewrite
slyubomirsky e00ba5c
Update comment
slyubomirsky fdb3370
Factor out search for purity annotation
slyubomirsky 0fa4843
Remove call_dps_pure_packed (call_dps_packed is pure) and remove wrap…
slyubomirsky 446d863
Remove unused var
slyubomirsky 587ba5f
Correct rebase mistake
slyubomirsky ba78ec4
Use ForcePure for tests of low-level codegen
slyubomirsky 85d5f62
lint
slyubomirsky f1982f5
Make LazyTransformParams compatible with purity tracking
slyubomirsky d83bfbb
Make is_pure and force_pure fields in Function instead of attrs
slyubomirsky 3ba972f
Lint
slyubomirsky 3616ec0
Unused imports
slyubomirsky e786f92
Use an attribute (relax.force_pure) to control forcing purity
slyubomirsky c920bf5
Indicate that RemovePurityChecking is also required for LazyTransform…
slyubomirsky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.