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

[MetaSchedule][Hexagon] Add postproc for verifying VTCM usage #13538

Merged
merged 6 commits into from
Dec 6, 2022

Conversation

masahi
Copy link
Member

@masahi masahi commented Dec 2, 2022

Building on #13349, and similar to VerifyGPUCode, add a postproc check for the VTCM usage.

@csullivan @Icemist @nverke

@tvm-bot
Copy link
Collaborator

tvm-bot commented Dec 2, 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

@masahi masahi changed the title [MetaSchedule] Add postproc for verifying VTCM usage [MetaSchedule][Hexagon] Add postproc for verifying VTCM usage Dec 2, 2022

def test_conv2d_vtcm():
def get_target(vtcm_cap):
target = tvm.target.hexagon("v68", vtcm_capacity=vtcm_cap)
Copy link
Contributor

Choose a reason for hiding this comment

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

You can use get_hexagon_target (from .infrastructure import get_hexagon_target) instead of writing your own version

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't want to depend on a file from contrib/test_hexagon from this file.

@@ -87,6 +87,15 @@ TVM_REGISTER_GLOBAL("tir.analysis.calculate_allocated_bytes").set_body_typed([](
return CalculateAllocatedBytes(func);
});

bool VerifyVTCMLimit(const PrimFunc& func, Integer limit) {
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like transform::VerifyVTCMLimit also uses this logic. Can we reuse this function inside that one?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I wanted to do that, but the pass variant needs vtcm_allocated in its error message, while this one wants to return only true / false. Refactoring is possible but I thought just duplicating might be cleaner in this case.

@Icemist
Copy link
Contributor

Icemist commented Dec 3, 2022

LGTM

Copy link
Contributor

@csullivan csullivan left a comment

Choose a reason for hiding this comment

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

Thanks @masahi @Icemist!

@csullivan csullivan merged commit 6574e16 into apache:main Dec 6, 2022
mikeseven pushed a commit to mikeseven/tvm that referenced this pull request Sep 27, 2023
…#13538)

* add new postproc VerifyVTCMLimit

* remove pass

* add test

* add doc, missing file

* Add back VectorizeLoop in prereq lowering pass

* fix lint
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.

4 participants