TVM 스택 도식. PyTorch·CoreML·TensorFlow·ONNX·Keras·MXNet 이 High-Level Differentiable IR 로 들어오고, Tensor Expression 과 최적화 탐색 공간을 거쳐 LLVM·CUDA·Metal 과 VTA 로 내려가며, AutoTVM 이 디바이스 플릿과 주고받으며 탐색한다

제목

TVM: An Automated End-to-End Optimizing Compiler for Deep Learning

TVM?

해당논문은 머신러닝용 컴파일러중에 대표적인 TVM에 대한 paper입니다. 현재는 apache에서 관리 하고 있으며 graph level IR 을 통한 target-independent optimization, autotune을 통한 target-dependent optimization 을 지원하며 llvm 및 vta를 통하여 cpu,gpu뿐만 아니라 FPGA를 backend로 지원합니다.

저자

Tianqi Chen and Thierry Moreau, University of Washington; Ziheng Jiang, University of Washington, AWS; Lianmin Zheng, Shanghai Jiao Tong University; Eddie Yan, Haichen Shen, and Meghan Cowan, University of Washington; Leyuan Wang, UC Davis, AWS; Yuwei Hu, Cornell; Luis Ceze, Carlos Guestrin, and Arvind Krishnamurthy

Motivation

기존 머신러닝을 이용한 compiler optimizaion 방법에서는 human experts를 이용한다양한 hardward back-end(GPU,FPGA,ASIC)이 늘어남에 따라 그 구조에 적합한 complier optimization이 달라 질 수 밖에 없다.

Contribution

해당논문은 머신러닝 High level Graph 연산을 ML 기반으로 특정 device 적합한 excutable 코드를 만들도록 수행하는 방법을 제시. 전체적인 framework의 blueprint 느낌이 강하고 전형적인 DL compiler의 구조라서 큰 contribution을 느끼지는 못함.

Content

Graph level modification & hareware-aware optimization

  • Operator Fusion
    • Combines many small ops
  • Constant Folding
    • Pre-computes static graphs
  • Static Memory Planning Pass
    • Pre-allocates memory for needed tensors
  • Data Layout Transformations
    • Optimize data storage for each backend
  • cost model에 ML을 이용
    • Query에서 추출한 feature 를XGBoost 를 이용하여 costs 를 예측

references

https://arxiv.org/abs/1802.04799

Project Page

https://tvm.apache.org

라이선스

작성자: Jaehun Ryu

링크: https://jaehun.me/posts/%EA%B0%84%EB%8B%A8%EB%85%BC%EB%AC%B8-%EC%A0%95%EB%A6%AC-tvm-an-automated-end-to-end-optimizing-compiler-for-deep-learning-osdi-18/

라이선스: CC BY 4.0

이 저작물은 크리에이티브 커먼즈 저작자표시 4.0 국제 라이선스에 따라 이용할 수 있습니다. 출처를 밝히면 상업적 목적을 포함해 자유롭게 이용 가능합니다.

댓글