Skip to content

[TIR][Analysis] Add SuggestIndexMap for layout rewriting#10732

Merged
junrushao merged 4 commits intoapache:mainfrom
vinx13:feat/suggest_index_map
Mar 25, 2022
Merged

[TIR][Analysis] Add SuggestIndexMap for layout rewriting#10732
junrushao merged 4 commits intoapache:mainfrom
vinx13:feat/suggest_index_map

Conversation

@vinx13
Copy link
Copy Markdown
Member

@vinx13 vinx13 commented Mar 23, 2022

This PR added an analysis function SuggestIndexMap to analyze buffer access pattern and suggest index map for layout transformations.

Co-authored-by: Siyuan Feng Hzfengsy@sjtu.edu.cn
Co-authored-by: Bohan Hou 32121147+spectrometerHBH@users.noreply.github.com
Co-authored-by: Hongyi Jin 3231950289@qq.com
Co-authored-by: Ruihang Lai lairuihangdongdong@qq.com
Co-authored-by: Junru Shao junrushao1994@gmail.com
Co-authored-by: Xiyou Zhou xiyou@octoml.ai

cc @junrushao1994 @jinhongyii @masahi

Co-authored-by: Siyuan Feng <Hzfengsy@sjtu.edu.cn>
Co-authored-by: Bohan Hou <32121147+spectrometerHBH@users.noreply.github.com>
Co-authored-by: Hongyi Jin <3231950289@qq.com>
Co-authored-by: Ruihang Lai <lairuihangdongdong@qq.com>
Co-authored-by: Junru Shao <junrushao1994@gmail.com>
Co-authored-by: Xiyou Zhou <xiyou@octoml.ai>
Comment thread python/tvm/tir/schedule/analysis.py Outdated
Co-authored-by: Junru Shao <junrushao1994@gmail.com>
@github-actions github-actions Bot requested review from junrushao and masahi March 23, 2022 17:53
Comment on lines +81 to +82
Array<arith::IterSumExpr> iter_sum_exprs = arith::DetectIterMap(
{analyzer->Simplify(index)}, input_iters, predicate, require_bijective, analyzer, diag_ctx);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I found it less convincing to couple frontend features (DiagnosticContext) with purely arithmetic analysis. we ideally should remove this argument in DetectIterMap @wrongtest

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@junrushao1994 Hi, any suggestion for the dbg info in DetectIterMap? We may remove them or change to logging if the diag ctx is not preferred.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Generally speaking, DiagnosticContext is a frontend feature, while arithmetic analysis is considered as a backend utility, which could be used with or without a particular frontend. Therefore, I would prefer moving error reporting to more frontend places instead of mixing them together in the backend

@github-actions github-actions Bot requested a review from junrushao March 23, 2022 17:59
@junrushao junrushao merged commit 937a14f into apache:main Mar 25, 2022
pfk-beta pushed a commit to pfk-beta/tvm that referenced this pull request Apr 11, 2022
This PR added an analysis function `SuggestIndexMap` to analyze buffer access pattern and suggest index map for layout transformations.

Co-authored-by: Siyuan Feng <Hzfengsy@sjtu.edu.cn>
Co-authored-by: Bohan Hou <32121147+spectrometerHBH@users.noreply.github.com>
Co-authored-by: Hongyi Jin <3231950289@qq.com>
Co-authored-by: Ruihang Lai <lairuihangdongdong@qq.com>
Co-authored-by: Junru Shao <junrushao1994@gmail.com>
Co-authored-by: Xiyou Zhou <xiyou@octoml.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants