Tensor language model enables generative scheduling for efficient tensor compilation - Nature
Nature
The paper has introduced a Generative Tensor Program Optimisation framework known as Tensor Language Model (TLM). The framework is an optimization scheme in a generative tensor program to solidify large language models into the decision-making of compilers. Compared to search-based or heuristic compilers, TLM does not require run-time exploration but instead uses offline learned inference to scale, reproducibly, and e.g. 100 times fasteroptimisation generate both programs as scalable, composed programs, with no rules being hard-coded. Learned over millions of device-specific and workload-diverse tensor sentences, TLM absorbs global and device-specific scheduling. Experimental evaluations yet again point to ResNet-50, BERT-base and GPT-2, wherein TLM either matches the performance of [...] In mitigation of this gap, this paper proposes the Tensor Language Model (TLM) Framework, a New tensor program generation system that can turn the problem of tensor program exploration into language generation. The principle behind it is to maintain a large, free decision space that is essential to do well but to take out inefficient sampling in favour of generating decisions based on language models16."). In that direction we propose a language-model-friendly tensor representation, the tensor language, where the structure of tensor programs (their operator graphs, hardware specifications, and scheduling decisions) is embedded in the form of compact sequences (tensor sentences). Compared to a typical representation of source code, these sentences are much shorter and they are optimised to [...] More recently, huge language models have also been added to the compilation workflow. Compilation aided 27. arXiv:2408.03408 .") Shows that GPT-4 can compile code at the accelerator level by prompting with structured pipelines, which can cut manual engineering work. AutoComp 28. arXiv:2505.18574
阅读原文