-
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.
We replace use of the TECompiler::{Lower,LowerShapeFunc} methods from the VM's compiler.cc with LowerTEPass. This clears the way for performing post-lowering IRModule->IRModule transformations which combine Relay and TIR analysis. In particular, it will allow us to use the PlanDevices pass to propagate memory scope constraints across PrimFuncs. We run LowerTEPass fairly early in the pipeline, which required quite a few passes to become 'post-lowering friendly'. In particular, ManifestAlloc is now run after rather than before lowering, and so must now work in a mixed Function/PrimFunc world. The "vm.shape_func" operator has been removed since a) lowering has already generated the necessary dynamic shape function, and b) the call to that function can be represented by an 'ordinary' vm.invoke_tvm_op call. We worked our way through the following glitches: - Lowering was choosing definitional GlobalVars which were not pointer-equal to the referential GlobalVars left behind in the rewritten Calls. We fixed that in te_compiler.cc, though better would be to push GlobalVars deeper into the lowering machinery. - device_copy was rewritten to a call to @__copy without any definition. We retain it as if it were an 'external'. - Calls to already-compiled BYOC functions were indistinguishable from calls to (non-primitive) Relay functions. We move them into the call_lowered calling convention, and leave behind a Function tagged with "ExternalSymbol". Better would be a first-class representatn for externals in the IRModule but one step at a time. - Functions with dynamic shapes tagged for BYOC compilation were not tracking their connection to their dynamic shape function. We now use exactly the same attributes as for non-BYOC primitives.
- Loading branch information
1 parent
6832309
commit 47cae68
Showing
55 changed files
with
1,567 additions
and
1,202 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
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.