Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[Tensorize][runtime] Add support for AMX(Advanced Matrix Extensions) through Tensor intrinsics #13642
[Tensorize][runtime] Add support for AMX(Advanced Matrix Extensions) through Tensor intrinsics #13642
Changes from 13 commits
3230886
2312242
3e2fc4e
3f19099
c53c394
98b9a23
79d6636
b866673
48fa37e
dd1eb24
73f45ef
b921052
e749360
5718a05
581331a
2bda03e
c2e9f26
4469fd9
f763d52
1f59aff
383d0b2
9422363
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be removed, it is used here
tvm/tests/python/unittest/test_meta_schedule_vnni_integration.py
Line 198 in b16a64d
Since this only affects MetaSchedule, you don't have to provide this value for AMX. So only when
dense_int8_compute
is called for VNNI, you need to provide this attribute.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@masahi Is this case only use the x86 int8 compute method and inject a particular TIR scheduling? Can we just change the attribute
dense_vnni
todense_int8
which used here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but it is important that we specify that we use this compute for VNNI. If the schedule rule annotation only says "dense_int8", we don't know which intrinsic to tensorize this compute with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@masahi Sorry, may given the misunderstanding, I mean that can we use the
dense_int8
in this test case? cuz here inject the VNNI intrinsic explicitly.And by default in relay build flow, it will check if the VNNI or AMX is availiable and chose different schedulling.
I've verified that this test case still functional after the little modification in this commit bellow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course the test still works, because it was already written for VNNI. The point is that the name
dense_vnni
tells that the particular TE expression is meant for VNNI tensorization, in particular the weight is pre-packed appropriately. But a generic name likedense_int8
doesn't provide such information. Just because AMX can use the same layout doesn't mean we can usedense_int8
. If MetaSchedule finds a compute annotated withdense_int8
, it cannot tell if it should apply VNNI or AMX tensorization (if the latter is supported by MS in the future).So please revert that commit and restore and pass
attrs={"schedule_rule": "meta_schedule.x86.dense_vnni"}
when you create a compute expression for VNNI.schedule_rule
is not relevant for AMX for now.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@masahi yep, got it, the schedule rule for ms dense_vnni are restored.
Keep it remained but AMX not use it for now.
( A smalll question: How do we know inside of this compute expression if it's created for VNNI not AMX? )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest checking the target string in the op strategy, and create separate compute for VNNI or AMX (rather than using the same function,
dense_int8
, for both).