tvm: support external microkernels - #133
Merged
Merged
Conversation
guillon
force-pushed
the
dev/cguillon/external_at
branch
from
September 8, 2026 18:07
fc4698d to
162a517
Compare
Member
Author
|
@qaco for information, may be useful if you want to call hand-optimized kernel tiles (or generated with another tool), xtc can mange the external memory tiling and call a C-abi compatible fast L1 resident tile for instance for matmul or conv2d. This is actually the long waited tentative implementation of the external_call/tensorize. I would appreciate a first feedback. Refer to the examples in |
guillon
force-pushed
the
dev/cguillon/external_at
branch
2 times, most recently
from
September 9, 2026 10:50
be048d1 to
dcee49c
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
guillon
force-pushed
the
dev/cguillon/external_at
branch
3 times, most recently
from
September 14, 2026 16:19
7cc7ffe to
2ef43f3
Compare
guillon
force-pushed
the
dev/cguillon/external_at
branch
from
September 16, 2026 12:27
2ef43f3 to
8f56c34
Compare
This was referenced Sep 16, 2026
guillon
marked this pull request as ready for review
September 16, 2026 17:32
Member
Author
|
Merging pull request, you may comment later @qaco |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
Allow TVM schedules to delegate an inner computation tile to a user-provided C-ABI microkernel.
Description
Add the
external_atschedule operation and lower externalized loop tiles toT.call_extern.The external ABI passes output and input pointers, inner-loop extents, and projected strides—including zero strides for invariant dimensions. Reduction initialization is separated from externally implemented updates.
Add support for compiling and linking additional C sources into TVM shared-library and archive outputs, or forwarding them with C-source outputs.
Add executable matmul and Conv2D examples covering spatial tiles, strip-mined reductions, multidimensional reductions, OpenMP SIMD, and aligned AVX-512 microkernels.
Commits
tvm: implement external_at for tvm scheduleDiscussion
Current limitations include one output, perfectly nested externalized loops.
TODO:
external_atfor the MLIR backend.Testing
pytest -q tests/pytest/unit— 53 passed