![Page 1: Towards Tensor Expression Schedule operational · Schedule Tree IterVar-reIation DAG Operational Semantics split fuse (loop collapse) reorder tile compute at cache read An operational](https://reader035.vdocuments.net/reader035/viewer/2022063022/5fe79ccafa79bc2ad21bf957/html5/thumbnails/1.jpg)
Yuan Lin and Yongfeng Gu
TOWARDS AN OPERATIONAL MODEL OF SCHEDULES IN TENSOR EXPRESSION
2019-12-05
![Page 2: Towards Tensor Expression Schedule operational · Schedule Tree IterVar-reIation DAG Operational Semantics split fuse (loop collapse) reorder tile compute at cache read An operational](https://reader035.vdocuments.net/reader035/viewer/2022063022/5fe79ccafa79bc2ad21bf957/html5/thumbnails/2.jpg)
QQuestion: is this a legal schedule?
![Page 3: Towards Tensor Expression Schedule operational · Schedule Tree IterVar-reIation DAG Operational Semantics split fuse (loop collapse) reorder tile compute at cache read An operational](https://reader035.vdocuments.net/reader035/viewer/2022063022/5fe79ccafa79bc2ad21bf957/html5/thumbnails/3.jpg)
QIllegal, but why?
TVMError: Check failed: found_attach || stage_attach.size() == 0: Invalid Schedule, cannot find the producer compute(B, 0x2851e60) along the loop nest specified by compute_at of consumer compute(B.local, 0x2b83b00)
![Page 4: Towards Tensor Expression Schedule operational · Schedule Tree IterVar-reIation DAG Operational Semantics split fuse (loop collapse) reorder tile compute at cache read An operational](https://reader035.vdocuments.net/reader035/viewer/2022063022/5fe79ccafa79bc2ad21bf957/html5/thumbnails/4.jpg)
Show the Schedule Tree
![Page 5: Towards Tensor Expression Schedule operational · Schedule Tree IterVar-reIation DAG Operational Semantics split fuse (loop collapse) reorder tile compute at cache read An operational](https://reader035.vdocuments.net/reader035/viewer/2022063022/5fe79ccafa79bc2ad21bf957/html5/thumbnails/5.jpg)
LCA(B, C)
LCA(BL, C)
Illegal
Violation of Legality
![Page 6: Towards Tensor Expression Schedule operational · Schedule Tree IterVar-reIation DAG Operational Semantics split fuse (loop collapse) reorder tile compute at cache read An operational](https://reader035.vdocuments.net/reader035/viewer/2022063022/5fe79ccafa79bc2ad21bf957/html5/thumbnails/6.jpg)
LCA(B, C)
LCA(BL, C)
Legal
A Possible Fix
![Page 7: Towards Tensor Expression Schedule operational · Schedule Tree IterVar-reIation DAG Operational Semantics split fuse (loop collapse) reorder tile compute at cache read An operational](https://reader035.vdocuments.net/reader035/viewer/2022063022/5fe79ccafa79bc2ad21bf957/html5/thumbnails/7.jpg)
Background
• Describe schedule primitives and transformations in a more elaborate way
• Provide guidance to new TE users
• Help debugging tricky TE programs
• Provide a framework to discuss bugs (is this a bug or feature?)
• Ensure conherent development of new features
Motivations
![Page 8: Towards Tensor Expression Schedule operational · Schedule Tree IterVar-reIation DAG Operational Semantics split fuse (loop collapse) reorder tile compute at cache read An operational](https://reader035.vdocuments.net/reader035/viewer/2022063022/5fe79ccafa79bc2ad21bf957/html5/thumbnails/8.jpg)
Dataflow Graph
The Operational Model
IterVar-relation DAG
Tensor Expression
Schedule Tree
![Page 9: Towards Tensor Expression Schedule operational · Schedule Tree IterVar-reIation DAG Operational Semantics split fuse (loop collapse) reorder tile compute at cache read An operational](https://reader035.vdocuments.net/reader035/viewer/2022063022/5fe79ccafa79bc2ad21bf957/html5/thumbnails/9.jpg)
The Document
![Page 10: Towards Tensor Expression Schedule operational · Schedule Tree IterVar-reIation DAG Operational Semantics split fuse (loop collapse) reorder tile compute at cache read An operational](https://reader035.vdocuments.net/reader035/viewer/2022063022/5fe79ccafa79bc2ad21bf957/html5/thumbnails/10.jpg)
Example pages
![Page 11: Towards Tensor Expression Schedule operational · Schedule Tree IterVar-reIation DAG Operational Semantics split fuse (loop collapse) reorder tile compute at cache read An operational](https://reader035.vdocuments.net/reader035/viewer/2022063022/5fe79ccafa79bc2ad21bf957/html5/thumbnails/11.jpg)
• We would like to contribute the document to the TVM community.• We are also working on a visualization tool, Tensor Expression Debug Display (TEDD).
• Questions/Survey:• Is this model helpful?
• Is this or similar model well understood?
• Will you use it for future discussion?
• Let's work together to• improve the model
• complete the document
Help Needed!
![Page 12: Towards Tensor Expression Schedule operational · Schedule Tree IterVar-reIation DAG Operational Semantics split fuse (loop collapse) reorder tile compute at cache read An operational](https://reader035.vdocuments.net/reader035/viewer/2022063022/5fe79ccafa79bc2ad21bf957/html5/thumbnails/12.jpg)
Thank you