-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Relay] PlanDevices supports 'free' on_device annotations (#9693)
* [Relay] PlanDevices supports 'free' on_device annotations This is in support of #9613, which allows PlanDevices to be run after lowering so as to flow memory constraints in and out of PrimFuncs. That requires a way to insert device_copies when the memory scopes chosen during separate lowering of fused primitive functions clashes, but otherwise avoid device_copies when scopes can be chosen so as to avoid them. We support that by generalizing the "on_device" annotation to allow the device constraint to be independently controlled for its 'body' and 'result'. # Standard user annotation: body is constrained to S on_device(body, S) # Used by PlanDevices to 'fix' expression to S # (was is_fixed=True) on_device(body, S, constrain_result=True) # Used by PlanDevices to indicate a device_copy can be # inserted if necessary. on_device(body, S, constrain_body=False) # Supported, but currently has no use. on_device(body, S, constrain_result=True, constrain_body=False) A few extra odd's 'n ends collected along the way: - Some CallLowered cleanup which I found useful. - The usual extra debugging output needed as I debugged. In return I removed some particularly verbose logging I'd added while tracking down unexpected object copies. - Cleanup warnings from clang-12 as I touch files. * [checkpoint] unused var
- Loading branch information
1 parent
01599d1
commit e3379a6
Showing
28 changed files
with
831 additions
and
418 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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.