Skip to content
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

[TensorIR][PASS][M1c] CompactBufferAllocation #7923

Merged
merged 1 commit into from
Apr 28, 2021
Merged

Conversation

Hzfengsy
Copy link
Member

This PR is part of the TensorIR upstreaming effort (#7527) as one of the M1c stages, introducing the pass ConvertBlocksToOpaque and CompactBufferAllocation

Pass ConvertBlocksToOpaque will substitute all the block vars with the PrimExprs they are bound to its iter_values and convert blocks into opaque ones.

Pass CompactBufferAllocation compacts the buffer access region by removing the buffer regions that are not accessed.

These two passes both are important passes for converting schedulable TensorIR to low-level tir.

cc @tqchen @junrushao1994 @comaniac @xqdan @jroesch
cc @tqchen @comaniac @jroesch @junrushao1994

Copy link
Contributor

@comaniac comaniac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just nits.

include/tvm/tir/stmt.h Show resolved Hide resolved
include/tvm/tir/transform.h Outdated Show resolved Hide resolved
Co-authored-by: Tianqi Chen <tqchen@users.noreply.github.com>
Co-authored-by: Junru Shao <junrushao1994@gmail.com>
Co-authored-by: Cody Yu <comaniac0422@gmail.com>
return _ffi_api.ConvertBlocksToOpaque()


def CompactBufferAllocation():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So,is this pass doing the same job as InferBound?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the functionality should be similar, except that infer bound needs to walk through the schedule tree, while in this case the split/reorder already updated the index, so the impl should be simpler

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for explaination!

@jcf94 jcf94 merged commit dee3133 into apache:main Apr 28, 2021
@jcf94
Copy link
Contributor

jcf94 commented Apr 28, 2021

Merged. Thanks! @Hzfengsy @tqchen @comaniac @junrushao1994 @xqdan

@junrushao junrushao linked an issue Apr 28, 2021 that may be closed by this pull request
29 tasks
echuraev pushed a commit to echuraev/tvm that referenced this pull request Apr 29, 2021
Co-authored-by: Tianqi Chen <tqchen@users.noreply.github.com>
Co-authored-by: Junru Shao <junrushao1994@gmail.com>
Co-authored-by: Cody Yu <comaniac0422@gmail.com>
umangyadav pushed a commit to umangyadav/tvm that referenced this pull request May 5, 2021
Co-authored-by: Tianqi Chen <tqchen@users.noreply.github.com>
Co-authored-by: Junru Shao <junrushao1994@gmail.com>
Co-authored-by: Cody Yu <comaniac0422@gmail.com>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
Co-authored-by: Tianqi Chen <tqchen@users.noreply.github.com>
Co-authored-by: Junru Shao <junrushao1994@gmail.com>
Co-authored-by: Cody Yu <comaniac0422@gmail.com>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
Co-authored-by: Tianqi Chen <tqchen@users.noreply.github.com>
Co-authored-by: Junru Shao <junrushao1994@gmail.com>
Co-authored-by: Cody Yu <comaniac0422@gmail.com>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
Co-authored-by: Tianqi Chen <tqchen@users.noreply.github.com>
Co-authored-by: Junru Shao <junrushao1994@gmail.com>
Co-authored-by: Cody Yu <comaniac0422@gmail.com>
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request May 11, 2021
Co-authored-by: Tianqi Chen <tqchen@users.noreply.github.com>
Co-authored-by: Junru Shao <junrushao1994@gmail.com>
Co-authored-by: Cody Yu <comaniac0422@gmail.com>
@Hzfengsy Hzfengsy deleted the compact branch August 25, 2021 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC][Tracking Issue] TensorIR Scheduling
6 participants