Skip to content

Conversation

@masahi
Copy link
Member

@masahi masahi commented Oct 25, 2022

I'm working on enabling "anchor block" tuning for MS. This is a utility to extract anchor blocks.

I define the "anchor block" to be the block (1) with an init statement and (2) having the biggest flops count. The latter condition is only used when there are multiple blocks with an init statement.

For example, if the input module is conv2d + fused spatial blocks, conv2d is the anchor block. A module created from winograd convolution has multiple blocks with an init statement (input transform, batched GEMM, and output transform). We use the second condition, the flops count, to determine that the batched GEMM block is the anchor block.

cc @junrushao @Hzfengsy

@tvm-bot
Copy link
Collaborator

tvm-bot commented Oct 25, 2022

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

Generated by tvm-bot

throw;
}

const PrimFuncNode* FindEntryFunc(const IRModule& mod, GlobalVar* result_g_var) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Moved to src/tir/analysis/stmt_finding.cc

* \param result_g_var The result GlobalVar of the entry function.
* \return The entry function.
*/
const PrimFuncNode* FindEntryFunc(const IRModule& mod, GlobalVar* result_g_var);
Copy link
Member Author

Choose a reason for hiding this comment

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

Moved to include/tir/analysis.h

Copy link
Member

@junrushao junrushao left a comment

Choose a reason for hiding this comment

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

LGTM!

@junrushao junrushao merged commit 697533e into apache:main Oct 26, 2022
xinetzone pushed a commit to daobook/tvm that referenced this pull request Nov 10, 2022
I'm working on enabling "anchor block" tuning for MS. This is a utility to extract anchor blocks. 

I define the "anchor block" to be the block (1) with an init statement and (2) having the biggest flops count. The latter condition is only used when there are multiple blocks with an init statement.

For example, if the input module is conv2d + fused spatial blocks, conv2d is the anchor block. A module created from winograd convolution has multiple blocks with an init statement (input transform, batched GEMM, and output transform). We use the second condition, the flops count, to determine that the batched GEMM block is the anchor block.
xinetzone pushed a commit to daobook/tvm that referenced this pull request Nov 25, 2022
I'm working on enabling "anchor block" tuning for MS. This is a utility to extract anchor blocks. 

I define the "anchor block" to be the block (1) with an init statement and (2) having the biggest flops count. The latter condition is only used when there are multiple blocks with an init statement.

For example, if the input module is conv2d + fused spatial blocks, conv2d is the anchor block. A module created from winograd convolution has multiple blocks with an init statement (input transform, batched GEMM, and output transform). We use the second condition, the flops count, to determine that the batched GEMM block is the anchor block.
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