Skip to content

Add TIR Schedule and TIR support for consumer fusion#106

Draft
guillon wants to merge 5 commits into
xtc-tools:mainfrom
guillon:dev/cguillon/tir-schedule
Draft

Add TIR Schedule and TIR support for consumer fusion#106
guillon wants to merge 5 commits into
xtc-tools:mainfrom
guillon:dev/cguillon/tir-schedule

Conversation

@guillon

@guillon guillon commented Jul 22, 2026

Copy link
Copy Markdown
Member

Motivation

TVM's legacy TE scheduling API is no longer available in recent TVM releases. Add an opt-in TIR scheduling path while preserving the existing TE path and XTC scheduling interface.

Description

This introduces schedulable/scheduled TVM expression abstractions that lower TE expressions to either TE schedules or TIR PrimFunc schedules. The TVM scheduler now emits TIR transformations for tiling, interchange, caching, buffering, unrolling, vectorization, parallelization, and producer/consumer fusion. Compilation, IR dumping, C emission, and library generation handle both schedule forms, including TVM version differences.

The TIR path can be selected with the backend tir_schedule option or the exploration CLI's --tir-schedule flag. LoopNest now records and displays fuse_producer_at and fuse_consumer_at annotations, with the latter exposed through the scheduler interface. FileCheck coverage includes scheduled matmul and fused producer/consumer graphs, while retaining TE fusion coverage.

Commits

  • Fix schedule description dump expectations.
  • Add TE-to-TIR lowering and TIR scheduling support.
  • Add fuse_producer_at to LoopNest.
  • Emit producer fusion for TVM TIR schedules.
  • Add the fuse_consumer_at scheduling primitive and TVM TIR support.

Discussion

The TIR path is currently still optional, the TE scheduling remains the default. It my be changed in the future.

@guillon
guillon force-pushed the dev/cguillon/tir-schedule branch from 221f792 to cfb4805 Compare July 22, 2026 17:36
@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.80531% with 14 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/xtc/backends/tvm/TVMOpsCompiler.py 93.40% 3 Missing and 3 partials ⚠️
src/xtc/backends/tvm/TVMCompiler.py 84.84% 4 Missing and 1 partial ⚠️
src/xtc/backends/tvm/TVMScheduler.py 96.29% 1 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@guillon
guillon force-pushed the dev/cguillon/tir-schedule branch 3 times, most recently from a57e21e to bfc8e58 Compare July 23, 2026 19:47
@guillon
guillon force-pushed the dev/cguillon/tir-schedule branch from bfc8e58 to adfd220 Compare July 24, 2026 01:14
@guillon
guillon force-pushed the dev/cguillon/tir-schedule branch from adfd220 to 1239736 Compare July 24, 2026 02:13
@guillon guillon changed the title Add TIR Schedule Add TIR Schedule and TIR support for consumer fusion Jul 24, 2026
@guillon
guillon requested a review from qaco July 24, 2026 02:16
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.

1 participant