Smoke test integration of XTC in Pytorch#80
Draft
ElectrikSpace wants to merge 3 commits into
Draft
Conversation
Lower ub dialect to llvm when using the LLVMIR target.
This patch adds a "layout" option when creating XTC tensors to relayout the storage in memory. The relayouting is considered done outside the evaluation or at compile time if the data is constat. Thus this patch also add a "const" option to specify if the tensor data is constant.
guillon
reviewed
May 26, 2026
|
|
||
|
|
||
| def schedule_matmul(sch: object) -> None: | ||
| sch.strip_mine("i", {"i1": 2}) # type: ignore[attr-defined] |
Member
There was a problem hiding this comment.
why not using the right itf.sch.Scheduler type?
Contributor
Author
There was a problem hiding this comment.
[Because of the vide coded code x)]
It's fixed
| @@ -0,0 +1,371 @@ | |||
| # | |||
Member
There was a problem hiding this comment.
Couldn't you use jinja2 templates instead?
Contributor
Author
There was a problem hiding this comment.
I have never used jinja2 template, maybe that's a good idea.
c7deab1 to
50d0ece
Compare
- Create custom ops for xtc operators in pytorch (only xtc.matmul for now) - Create a pre_grad fx pass to rewrite torch operators to xtc torch operators (e.g. linear to matmul) - Provide a eager implementation of the xtc torch operators that do one shot compile with xtc - Provide a torch inductor lowering for xtc torch operators (with cpp wrapper), and call one shot xtc compile at compile time of aot inductor run - patch runtime inductor ops lib with compiled kernel from xtc + codegen a cpp wrapper around This is still work in progress
50d0ece to
7294fd1
Compare
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
Following discussions with the maintainers, we would like to propose a lighweight integration of XTC in the Pytorch ecosystem. The goal is to be able to compile with XTC selected operators coming from models written with Pytorch, and execute the model by combining code generated with XTC and a default code generator for the other operators.
Description
The PR proposes an integration of XTC in Pytorch, by extending Pytorch withing the XTC repo.
now)
operators (e.g. linear to matmul)
shot compile with xtc
wrapper), and call one shot xtc compile at compile time of aot
inductor run
a cpp wrapper around
This is still work in progres
(copied from commit message)
Commits
This PR contains 3 commits. The first two are the same as #79
The last commit contains the proposed integration of XTC with Pytorch.
[DO NOT MERGE BEFORE #79]
Discussion
Some points need to be discussed before merging the PR:
TODO: