Closed psrivas2 closed 1 year ago
https://github.com/tlc-pack/relax/issues/453, this PR should be part of PRs to send to unity. We can either directly transition to PR to unity, or continue review merge before transition, depending on what authors and reviewers want
cc @sunggg @masahi @YuchenJin
Migrated to unity branch https://github.com/apache/tvm/pull/14066
This change adds a PrimFunc level analysis to propose layout transformations to block and buffers in the PrimFunc based on the layout transformations to PrimFunc outputs. It analyzes buffer access to figure this out. It tries to preserve sequential access to buffers when it does this.
For example given the following PrimFunc and write buffer "relu" transformation
lambda n, c, h, w: (n, h, w, c // 4, c % 4)
, it will suggest to make the following transformations.lambda n, c, h, w: (n, h, w, c // 4, c % 4)
lambda n, c, h, w: (n, h, w, c // 4, c % 4)
lambda n, c, h, w: (n, h, w, c // 4, c % 4)
These transformations can then be applied on the PrimFunc to get the PrimFunc with new layout.