Skip to content

Commit

Permalink
Decoupling AOT from graph memory planner (apache#8096)
Browse files Browse the repository at this point in the history
* Fix an issue with storage-rewrite pass and packed functions

Change-Id: I13888471d4b8927a4012d6a8e749fb7a8935dd77

* Rebasing

Change-Id: I7aa12e0217b8a2e1ff2a97a7c5fdda6b7597ae64

* Addressing comments

Change-Id: If9f1ee190690f9a810fe41eb1933d736f1eb4ec3

* Add a pass to legalize packed calls

Change-Id: I8aa43d3a1b837b03a5cf3c6b32fc760bd78d3436

* Add a unit test for the legalization pass

Change-Id: I5b0d75380ff660dd5a0acf5b14fa84bb992fbec4

* rebasing

Change-Id: I52ceab5cf6e9b54390cb36c18dbb8e22505d8e18

* Use common StorageInfo

Change-Id: Ia8b7de1373f167ca7d0d69a99846d417405bbe48
  • Loading branch information
Giuseppe Rossini authored and ylc committed Jan 13, 2022
1 parent ca72195 commit 681f266
Show file tree
Hide file tree
Showing 9 changed files with 573 additions and 126 deletions.
5 changes: 5 additions & 0 deletions include/tvm/tir/transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,11 @@ TVM_DLL Pass ConvertBlocksToOpaque();
*/
TVM_DLL Pass CompactBufferAllocation();

/*!
* This pass legalizes packed calls by wrapping their arguments into TVMValues
*/
TVM_DLL Pass LegalizePackedCalls();

/*!
* \brief Flatten the multi-dimensional BufferLoad and BufferStore
* to single dimensional Load/Store. Also remove Block to
Expand Down
11 changes: 11 additions & 0 deletions python/tvm/tir/transform/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,17 @@ def LowerTVMBuiltin():
return _ffi_api.LowerTVMBuiltin()


def LegalizePackedCalls():
"""Legalize packed calls to have its arguments wrapped in TVMValues
Returns
-------
fpass : tvm.transform.Pass
The result pass
"""
return _ffi_api.LegalizePackedCalls()


def LowerIntrin():
"""Lower target specific intrinsic calls.
Expand Down
Loading

0 comments on commit 681f266

Please sign in to comment.