[{"data":1,"prerenderedAt":2329},["ShallowReactive",2],{"learning-material-cmu-15-779-triton-paper-zh":3},{"courseSlug":4,"slug":5,"fileName":6,"title":7,"description":8,"language":9,"sourcePdf":10,"sourceLanguage":11,"body":12,"toc":2299,"bytes":2327,"downloadPath":2328},"cmu-15-779","triton-paper-zh","triton-paper-zh.md","Triton：用于分块神经网络计算的中间语言和编译器","Triton 论文中文学习译稿。","zh","\u002Fmaterials\u002Fcmu-15-779\u002Foriginals\u002Ftriton-paper-original.pdf","en",{"type":13,"children":14},"root",[15,23,35,45,54,60,65,70,85,90,96,101,106,117,122,127,132,142,147,200,206,211,244,249,456,468,474,479,486,491,533,596,622,640,645,654,660,667,672,678,683,705,710,719,725,730,740,745,758,764,769,774,780,786,791,796,802,807,812,818,823,828,834,840,936,948,954,959,984,994,1042,1048,1053,1058,1083,1087,1096,1102,1107,1113,1119,1124,1151,1157,1397,1403,1408,1431,1437,1442,1452,1457,1463,1468,1473,1478,1488,1494,1506,1511,1521,1527,1532,1537,1543,1548,1553,1571,1576,1582,1587,1593,2060,2065,2075,2167,2173,2178,2188,2200,2206,2218,2227,2232,2238,2243,2248,2257,2263,2268,2273,2278,2284,2289,2294],{"type":16,"tag":17,"props":18,"children":20},"element","h1",{"id":19},"triton用于分块神经网络计算的中间语言和编译器",[21],{"type":22,"value":7},"text",{"type":16,"tag":24,"props":25,"children":26},"p",{},[27,33],{"type":16,"tag":28,"props":29,"children":30},"strong",{},[31],{"type":22,"value":32},"作者：",{"type":22,"value":34}," Philippe Tillet、H. T. Kung、David Cox",{"type":16,"tag":24,"props":36,"children":37},{},[38,43],{"type":16,"tag":28,"props":39,"children":40},{},[41],{"type":22,"value":42},"来源：",{"type":22,"value":44}," MAPL ’19，2019 年 6 月 22 日，第 3 届 ACM SIGPLAN 机器学习与编程语言国际研讨会。",{"type":16,"tag":46,"props":47,"children":48},"blockquote",{},[49],{"type":16,"tag":24,"props":50,"children":51},{},[52],{"type":22,"value":53},"说明：本文根据用户提供的论文 PDF 翻译。Triton\u002FC 代码、LLVM IR、公式和引用编号保留，便于与原文对照。",{"type":16,"tag":55,"props":56,"children":58},"h2",{"id":57},"摘要",[59],{"type":22,"value":57},{"type":16,"tag":24,"props":61,"children":62},{},[63],{"type":22,"value":64},"在深度学习领域，新研究思想的验证和部署经常受限于某些基础原语缺少高效计算 kernel。尤其是无法利用厂商库（例如 cuBLAS、cuDNN）的操作，如果没有专家编写自定义实现，就可能无法充分利用设备；而手工实现通常又会牺牲可移植性。因此，在性能代价很小的前提下，为指定自定义深度学习工作负载提供新的编程抽象，已经变得非常重要。",{"type":16,"tag":24,"props":66,"children":67},{},[68],{"type":22,"value":69},"我们提出 Triton：一种围绕 tile（分块）概念设计的语言和编译器。tile 指静态形状的多维子数组。我们的方法包括两部分：",{"type":16,"tag":71,"props":72,"children":73},"ol",{},[74,80],{"type":16,"tag":75,"props":76,"children":77},"li",{},[78],{"type":22,"value":79},"一种基于 C 的语言和基于 LLVM 的中间表示（IR），用参数化 tile 变量上的操作来表达张量程序；",{"type":16,"tag":75,"props":81,"children":82},{},[83],{"type":22,"value":84},"一组新的 tile 级优化 pass，把这些程序编译为高效 GPU 代码。",{"type":16,"tag":24,"props":86,"children":87},{},[88],{"type":22,"value":89},"我们展示了 Triton 如何构造性能接近手工调优厂商库（cuBLAS\u002FcuDNN）的矩阵乘法和卷积 kernel，并高效实现 shift convolution 等近期研究思想。",{"type":16,"tag":55,"props":91,"children":93},{"id":92},"_1-引言",[94],{"type":22,"value":95},"1 引言",{"type":16,"tag":24,"props":97,"children":98},{},[99],{"type":22,"value":100},"近年来，深度神经网络（DNN）的复兴在很大程度上得益于可编程并行计算设备的普及。尤其是多核架构（如 GPU）性能持续提升，使研究人员和工程师能够使用越来越多的数据探索规模越来越大的模型。",{"type":16,"tag":24,"props":102,"children":103},{},[104],{"type":22,"value":105},"厂商库 cuBLAS 和 cuDNN 也支持了这一过程，它们把最新硬件创新快速带给使用者。然而，这些库只支持有限的一组张量操作，使新原语的实现仍然需要专家完成。",{"type":16,"tag":24,"props":107,"children":108},{},[109],{"type":16,"tag":110,"props":111,"children":116},"img",{"alt":112,"src":113,"width":114,"height":115},"不同实现的矩阵乘与卷积性能（原文图 1）","\u002Fimages\u002Fmaterials\u002Fcmu-15-779\u002Ftriton\u002Ffigure-01.webp",967,737,[],{"type":16,"tag":24,"props":118,"children":119},{},[120],{"type":22,"value":121},"这一观察推动了多种 DNN 领域专用语言（DSL）的发展，包括基于多面体模型的 Tensor Comprehensions，以及基于循环综合技术的 Halide、TVM 和 PlaidML。这些系统在深度可分离卷积（如 MobileNet）等部分问题上通常表现良好，但实践中往往比厂商库慢很多，而且缺少表达结构化稀疏模式所需的表达能力；这类模式无法直接用嵌套循环中的仿射数组索引指定。",{"type":16,"tag":24,"props":123,"children":124},{},[125],{"type":22,"value":126},"人们经常使用 micro-kernel（手写的 tile 级内核指令）解决上述问题，但这需要大量人工工作且缺少可移植性。近来也有人提出高层次的分块编程抽象，但底层编译器后端仍不支持 tile 级操作和优化。",{"type":16,"tag":24,"props":128,"children":129},{},[130],{"type":22,"value":131},"因此，我们提出 Triton（图 2）：一种开源的中间语言和编译器，用于指定并把 tile 程序编译为高效 GPU 代码。",{"type":16,"tag":24,"props":133,"children":134},{},[135],{"type":16,"tag":110,"props":136,"children":141},{"alt":137,"src":138,"width":139,"height":140},"Triton 编译流程概览（原文图 2）","\u002Fimages\u002Fmaterials\u002Fcmu-15-779\u002Ftriton\u002Ffigure-02.webp",525,754,[],{"type":16,"tag":24,"props":143,"children":144},{},[145],{"type":22,"value":146},"本文主要贡献如下：",{"type":16,"tag":148,"props":149,"children":150},"ul",{},[151,161,171,181],{"type":16,"tag":75,"props":152,"children":153},{},[154,159],{"type":16,"tag":28,"props":155,"children":156},{},[157],{"type":22,"value":158},"Triton-C（第 3 节）：",{"type":22,"value":160}," 一种类似 C 的语言，用参数化 tile 变量表达张量程序。它为现有 DNN 转译编译器（如 PlaidML、Tensor Comprehensions）以及熟悉 CUDA 的程序员提供稳定接口。",{"type":16,"tag":75,"props":162,"children":163},{},[164,169],{"type":16,"tag":28,"props":165,"children":166},{},[167],{"type":22,"value":168},"Triton-IR（第 4 节）：",{"type":22,"value":170}," 一种基于 LLVM 的中间表示，为 tile 级程序分析、变换和优化提供环境。",{"type":16,"tag":75,"props":172,"children":173},{},[174,179],{"type":16,"tag":28,"props":175,"children":176},{},[177],{"type":22,"value":178},"Triton-JIT（第 5 节）：",{"type":22,"value":180}," 一个即时编译器和代码生成后端，把 Triton-IR 编译为高效 LLVM bitcode。它包含与机器无关的 tile 级优化 pass、与机器相关的 pass，以及自动调优器。",{"type":16,"tag":75,"props":182,"children":183},{},[184,189,191,198],{"type":16,"tag":28,"props":185,"children":186},{},[187],{"type":22,"value":188},"数值实验（第 6 节）：",{"type":22,"value":190}," 实验表明 Triton 能生成性能接近 cuBLAS 的矩阵乘法，在循环和 Transformer 网络上最多比其他 DSL 快 3 倍；能够无性能损失地重新实现 cuDNN 的 ",{"type":16,"tag":192,"props":193,"children":195},"code",{"className":194},[],[196],{"type":22,"value":197},"IMPLICIT_GEMM",{"type":22,"value":199}," 稠密卷积算法；还可以为 shift-conv 模块等新研究思想生成高效实现。",{"type":16,"tag":55,"props":201,"children":203},{"id":202},"_2-相关工作",[204],{"type":22,"value":205},"2 相关工作",{"type":16,"tag":24,"props":207,"children":208},{},[209],{"type":22,"value":210},"深度学习框架和库对新神经网络架构与算法的出现至关重要。但尽管线性代数编译器在分析式启发式和经验式启发式方面不断进步，它们仍然依赖手工优化子程序，例如 cuBLAS 和 cuDNN。因此，人们发展了多种 DNN DSL 和编译器，主要基于三种方法：",{"type":16,"tag":148,"props":212,"children":213},{},[214,224,234],{"type":16,"tag":75,"props":215,"children":216},{},[217,222],{"type":16,"tag":28,"props":218,"children":219},{},[220],{"type":22,"value":221},"张量级 IR：",{"type":22,"value":223}," XLA [16] 和 Glow [38] 使用张量级 IR，通过模式匹配把张量程序转换为预定义的 LLVM-IR 和 CUDA-C 操作模板（如张量收缩和逐元素运算）。",{"type":16,"tag":75,"props":225,"children":226},{},[227,232],{"type":16,"tag":28,"props":228,"children":229},{},[230],{"type":22,"value":231},"多面体模型：",{"type":22,"value":233}," Tensor Comprehensions（TC）[43] 和 Diesel [14] 使用多面体模型，对一个或多个 DNN 层进行参数化，并自动编译为 LLVM-IR 和 CUDA-C 程序。",{"type":16,"tag":75,"props":235,"children":236},{},[237,242],{"type":16,"tag":28,"props":238,"children":239},{},[240],{"type":22,"value":241},"循环综合器：",{"type":22,"value":243}," Halide [37] 和 TVM [10] 把张量计算转换为循环嵌套，之后由用户定义的、可能带参数的 schedule 手工优化。",{"type":16,"tag":24,"props":245,"children":246},{},[247],{"type":22,"value":248},"与这些方法相比，Triton 把 tile 级操作与 tile 级优化加入传统编译流水线。这种方法相比 XLA 和 Glow 更灵活；支持非仿射张量索引，克服 TC 和 Diesel 的限制；并且可以自动推断执行 schedule，而 Halide 和 TVM 通常需要手工指定。代价是编程工作量增加。",{"type":16,"tag":24,"props":250,"children":251},{},[252,254,454],{"type":22,"value":253},"对于 ",{"type":16,"tag":255,"props":256,"children":259},"span",{"className":257},[258],"katex",[260,321],{"type":16,"tag":255,"props":261,"children":264},{"className":262},[263],"katex-mathml",[265],{"type":16,"tag":266,"props":267,"children":269},"math",{"xmlns":268},"http:\u002F\u002Fwww.w3.org\u002F1998\u002FMath\u002FMathML",[270],{"type":16,"tag":271,"props":272,"children":273},"semantics",{},[274,314],{"type":16,"tag":275,"props":276,"children":277},"mrow",{},[278,284,290,295,300],{"type":16,"tag":279,"props":280,"children":281},"mi",{},[282],{"type":22,"value":283},"C",{"type":16,"tag":285,"props":286,"children":287},"mo",{},[288],{"type":22,"value":289},"=",{"type":16,"tag":279,"props":291,"children":292},{},[293],{"type":22,"value":294},"A",{"type":16,"tag":285,"props":296,"children":297},{},[298],{"type":22,"value":299},"×",{"type":16,"tag":301,"props":302,"children":303},"msup",{},[304,309],{"type":16,"tag":279,"props":305,"children":306},{},[307],{"type":22,"value":308},"B",{"type":16,"tag":279,"props":310,"children":311},{},[312],{"type":22,"value":313},"T",{"type":16,"tag":315,"props":316,"children":318},"annotation",{"encoding":317},"application\u002Fx-tex",[319],{"type":22,"value":320},"C = A \\times B^T",{"type":16,"tag":255,"props":322,"children":326},{"className":323,"ariaHidden":325},[324],"katex-html","true",[327,362,391],{"type":16,"tag":255,"props":328,"children":331},{"className":329},[330],"base",[332,338,346,352,358],{"type":16,"tag":255,"props":333,"children":337},{"className":334,"style":336},[335],"strut","height:0.6833em;",[],{"type":16,"tag":255,"props":339,"children":344},{"className":340,"style":343},[341,342],"mord","mathnormal","margin-right:0.0715em;",[345],{"type":22,"value":283},{"type":16,"tag":255,"props":347,"children":351},{"className":348,"style":350},[349],"mspace","margin-right:0.2778em;",[],{"type":16,"tag":255,"props":353,"children":356},{"className":354},[355],"mrel",[357],{"type":22,"value":289},{"type":16,"tag":255,"props":359,"children":361},{"className":360,"style":350},[349],[],{"type":16,"tag":255,"props":363,"children":365},{"className":364},[330],[366,371,376,381,387],{"type":16,"tag":255,"props":367,"children":370},{"className":368,"style":369},[335],"height:0.7667em;vertical-align:-0.0833em;",[],{"type":16,"tag":255,"props":372,"children":374},{"className":373},[341,342],[375],{"type":22,"value":294},{"type":16,"tag":255,"props":377,"children":380},{"className":378,"style":379},[349],"margin-right:0.2222em;",[],{"type":16,"tag":255,"props":382,"children":385},{"className":383},[384],"mbin",[386],{"type":22,"value":299},{"type":16,"tag":255,"props":388,"children":390},{"className":389,"style":379},[349],[],{"type":16,"tag":255,"props":392,"children":394},{"className":393},[330],[395,400],{"type":16,"tag":255,"props":396,"children":399},{"className":397,"style":398},[335],"height:0.8413em;",[],{"type":16,"tag":255,"props":401,"children":403},{"className":402},[341],[404,410],{"type":16,"tag":255,"props":405,"children":408},{"className":406,"style":407},[341,342],"margin-right:0.0502em;",[409],{"type":22,"value":308},{"type":16,"tag":255,"props":411,"children":414},{"className":412},[413],"msupsub",[415],{"type":16,"tag":255,"props":416,"children":419},{"className":417},[418],"vlist-t",[420],{"type":16,"tag":255,"props":421,"children":424},{"className":422},[423],"vlist-r",[425],{"type":16,"tag":255,"props":426,"children":429},{"className":427,"style":398},[428],"vlist",[430],{"type":16,"tag":255,"props":431,"children":433},{"style":432},"top:-3.063em;margin-right:0.05em;",[434,440],{"type":16,"tag":255,"props":435,"children":439},{"className":436,"style":438},[437],"pstrut","height:2.7em;",[],{"type":16,"tag":255,"props":441,"children":447},{"className":442},[443,444,445,446],"sizing","reset-size6","size3","mtight",[448],{"type":16,"tag":255,"props":449,"children":452},{"className":450,"style":451},[341,342,446],"margin-right:0.1389em;",[453],{"type":22,"value":313},{"type":22,"value":455},"，不同 DSL 的表达形式例如：",{"type":16,"tag":457,"props":458,"children":463},"pre",{"className":459,"code":461,"language":22,"meta":462},[460],"language-text","C = tf.matmul(A, tf.transpose(B))       \u002F\u002F TensorFlow\nC[i, j:J] = +(A[i, k] * B[j, k])        \u002F\u002F PlaidML\nC(i, j) +=! A(i, k) * B(j, k)            \u002F\u002F Tensor Comprehensions\ntvm.sum(A[i, k] * B[j, k], axis=k)       \u002F\u002F TVM\n","",[464],{"type":16,"tag":192,"props":465,"children":466},{"__ignoreMap":462},[467],{"type":22,"value":461},{"type":16,"tag":55,"props":469,"children":471},{"id":470},"_3-triton-c-语言",[472],{"type":22,"value":473},"3 Triton-C 语言",{"type":16,"tag":24,"props":475,"children":476},{},[477],{"type":22,"value":478},"Triton-C 的目标是为现有和未来的 DNN 转译编译器，以及熟悉底层 GPU 编程的程序员，提供稳定前端。本节介绍 Triton-C 类 CUDA 的语法、类似 NumPy 的语义，以及“单程序多数据”（SPMD）编程模型。",{"type":16,"tag":480,"props":481,"children":483},"h3",{"id":482},"_31-语法",[484],{"type":22,"value":485},"3.1 语法",{"type":16,"tag":24,"props":487,"children":488},{},[489],{"type":22,"value":490},"Triton-C 的语法基于 ANSI C，更具体地说基于 CUDA-C，但为了适应 tile 语义和编程模型进行了修改和扩展。",{"type":16,"tag":24,"props":492,"children":493},{},[494,499,501,507,509,515,517,523,525,531],{"type":16,"tag":28,"props":495,"children":496},{},[497],{"type":22,"value":498},"Tile 声明：",{"type":22,"value":500}," 我们增加了声明多维数组的特殊语法，例如 ",{"type":16,"tag":192,"props":502,"children":504},{"className":503},[],[505],{"type":22,"value":506},"int tile[16, 16]",{"type":22,"value":508},"，以强调它与 ANSI C 中嵌套数组（例如 ",{"type":16,"tag":192,"props":510,"children":512},{"className":511},[],[513],{"type":22,"value":514},"int tile[16][16]",{"type":22,"value":516},"）的语义差异。tile 的形状必须是常量，但使用 ",{"type":16,"tag":192,"props":518,"children":520},{"className":519},[],[521],{"type":22,"value":522},"tunable",{"type":22,"value":524}," 关键字后也可以参数化。一维整数 tile 可以用省略号初始化，例如 ",{"type":16,"tag":192,"props":526,"children":528},{"className":527},[],[529],{"type":22,"value":530},"int range[8] = 0 ... 8",{"type":22,"value":532},"。",{"type":16,"tag":24,"props":534,"children":535},{},[536,541,543,549,551,557,558,564,565,571,573,579,580,586,588,594],{"type":16,"tag":28,"props":537,"children":538},{},[539],{"type":22,"value":540},"内置函数：",{"type":22,"value":542}," 普通 C 语法保留给逐元素数组运算（",{"type":16,"tag":192,"props":544,"children":546},{"className":545},[],[547],{"type":22,"value":548},"+",{"type":22,"value":550},"、",{"type":16,"tag":192,"props":552,"children":554},{"className":553},[],[555],{"type":22,"value":556},"-",{"type":22,"value":550},{"type":16,"tag":192,"props":559,"children":561},{"className":560},[],[562],{"type":22,"value":563},"&&",{"type":22,"value":550},{"type":16,"tag":192,"props":566,"children":568},{"className":567},[],[569],{"type":22,"value":570},"*",{"type":22,"value":572}," 等）；同时增加 ",{"type":16,"tag":192,"props":574,"children":576},{"className":575},[],[577],{"type":22,"value":578},"dot",{"type":22,"value":550},{"type":16,"tag":192,"props":581,"children":583},{"className":582},[],[584],{"type":22,"value":585},"trans",{"type":22,"value":587}," 和 ",{"type":16,"tag":192,"props":589,"children":591},{"className":590},[],[592],{"type":22,"value":593},"get_global_range",{"type":22,"value":595}," 等内置函数来支持 tile 语义和 SPMD 模型。",{"type":16,"tag":24,"props":597,"children":598},{},[599,604,606,612,614,620],{"type":16,"tag":28,"props":600,"children":601},{},[602],{"type":22,"value":603},"广播：",{"type":22,"value":605}," N 维 tile 可以使用 ",{"type":16,"tag":192,"props":607,"children":609},{"className":608},[],[610],{"type":22,"value":611},"newaxis",{"type":22,"value":613}," 关键字和通常的切片语法沿任意轴广播，例如 ",{"type":16,"tag":192,"props":615,"children":617},{"className":616},[],[618],{"type":22,"value":619},"int broadcast[8, 8] = range[:, newaxis]",{"type":22,"value":621},"。不过，切片 tile 以取得标量或子数组的做法被禁止。",{"type":16,"tag":24,"props":623,"children":624},{},[625,630,632,638],{"type":16,"tag":28,"props":626,"children":627},{},[628],{"type":22,"value":629},"谓词：",{"type":22,"value":631}," tile 操作内部的基本控制流通过带 ",{"type":16,"tag":192,"props":633,"children":635},{"className":634},[],[636],{"type":22,"value":637},"@",{"type":22,"value":639}," 前缀的谓词语句实现。",{"type":16,"tag":24,"props":641,"children":642},{},[643],{"type":22,"value":644},"Triton-C 的语法扩展可概括为：",{"type":16,"tag":457,"props":646,"children":649},{"className":647,"code":648,"language":22,"meta":462},[460],"slice           : ':' | 'newaxis'\nslice_list      : slice | slice_list ',' slice\nslice_expr      : postfix_expr | expr '[' slice_list ']'\nconstant_range  : expr '...' expr\nglobal_range    : 'get_global_range' '(' constant ')'\ndot             : 'dot' '(' expr ',' expr ')'\ntrans           : 'trans' '(' expr ',' expr ')'\npredicate_expr  : '@' expr\nabstract_decl   : abstract_decl | '[' constant_list ']'\nexpr            : expr | constant_range | slice_expr | intrinsic_expr\nstorage_spec    : storage_spec | 'kernel'\ntype_spec       : type_spec | 'tunable'\n",[650],{"type":16,"tag":192,"props":651,"children":652},{"__ignoreMap":462},[653],{"type":22,"value":648},{"type":16,"tag":480,"props":655,"children":657},{"id":656},"_32-语义",[658],{"type":22,"value":659},"3.2 语义",{"type":16,"tag":661,"props":662,"children":664},"h4",{"id":663},"_321-tile-语义",[665],{"type":22,"value":666},"3.2.1 Tile 语义",{"type":16,"tag":24,"props":668,"children":669},{},[670],{"type":22,"value":671},"Triton-C 的内置 tile 类型和操作有两个主要好处。首先，它隐藏了 tile 内存合并、缓存管理和专用硬件利用等性能细节，从而简化张量程序结构。其次，它为编译器自动执行这些优化打开了空间。",{"type":16,"tag":661,"props":673,"children":675},{"id":674},"_322-广播语义",[676],{"type":22,"value":677},"3.2.2 广播语义",{"type":16,"tag":24,"props":679,"children":680},{},[681],{"type":22,"value":682},"Triton-C 中的 tile 是强类型的：某些指令要求操作数满足严格形状约束。例如，标量不能直接加到数组上，除非它先被正确广播。广播语义提供了一组隐式转换规则：",{"type":16,"tag":71,"props":684,"children":685},{},[686,696],{"type":16,"tag":75,"props":687,"children":688},{},[689,694],{"type":16,"tag":28,"props":690,"children":691},{},[692],{"type":22,"value":693},"填充：",{"type":22,"value":695}," 向形状较短的操作数左侧补 1，直到两个操作数维度相同。",{"type":16,"tag":75,"props":697,"children":698},{},[699,703],{"type":16,"tag":28,"props":700,"children":701},{},[702],{"type":22,"value":603},{"type":22,"value":704}," 沿大小为 1 的维度复制两个操作数的内容，直到形状完全相同；如果无法完成则报告错误。",{"type":16,"tag":24,"props":706,"children":707},{},[708],{"type":22,"value":709},"示例：",{"type":16,"tag":457,"props":711,"children":714},{"className":712,"code":713,"language":22,"meta":462},[460],"int a[16], b[32, 16], c[16, 1];\nint x_1[32, 16] = a[newaxis, :] + b;\nint x_2[32, 16] = a + b;\nint y[16, 16] = a + c;\n",[715],{"type":16,"tag":192,"props":716,"children":717},{"__ignoreMap":462},[718],{"type":22,"value":713},{"type":16,"tag":661,"props":720,"children":722},{"id":721},"_33-编程模型",[723],{"type":22,"value":724},"3.3 编程模型",{"type":16,"tag":24,"props":726,"children":727},{},[728],{"type":22,"value":729},"CUDA [33] 在 GPU 上使用 SPMD [4] 编程模型：每个 kernel 与 launch grid 中一个可识别的线程块关联。Triton 的编程模型类似，但每个 kernel 是单线程的（编译器会自动并行化），并与一组会随实例变化的全局范围关联，如图 3 所示。",{"type":16,"tag":24,"props":731,"children":732},{},[733],{"type":16,"tag":110,"props":734,"children":739},{"alt":735,"src":736,"width":737,"height":738},"CUDA 与 Triton 编程模型的差异（原文图 3）","\u002Fimages\u002Fmaterials\u002Fcmu-15-779\u002Ftriton\u002Ffigure-03.webp",674,767,[],{"type":16,"tag":24,"props":741,"children":742},{},[743],{"type":22,"value":744},"这种方法产生更简单的 kernel，因为不存在 CUDA 风格的并发原语，如共享内存同步和线程间通信。",{"type":16,"tag":24,"props":746,"children":747},{},[748,750,756],{"type":22,"value":749},"kernel 可以通过 ",{"type":16,"tag":192,"props":751,"children":753},{"className":752},[],[754],{"type":22,"value":755},"get_global_range(axis)",{"type":22,"value":757}," 内置函数查询与之关联的全局范围，从而构造指针 tile，如前面的矩阵乘法示例所示。",{"type":16,"tag":55,"props":759,"children":761},{"id":760},"_4-triton-ir",[762],{"type":22,"value":763},"4 Triton IR",{"type":16,"tag":24,"props":765,"children":766},{},[767],{"type":22,"value":768},"Triton-IR 是一种基于 LLVM 的中间表示，目的是为 tile 级程序分析、变换和优化提供合适环境。本文中 Triton-IR 程序直接从 Triton-C 程序构造，但未来也可以从嵌入式 DSL 或 TVM 等更高层 DNN 编译器自动生成。",{"type":16,"tag":24,"props":770,"children":771},{},[772],{"type":22,"value":773},"Triton-IR 与 LLVM-IR 共享相同的高层结构，但增加了 tile 级数据流和控制流分析所需的扩展。这些扩展对第 5 节中的优化至关重要，也能安全访问任意形状的张量。",{"type":16,"tag":480,"props":775,"children":777},{"id":776},"_41-结构",[778],{"type":22,"value":779},"4.1 结构",{"type":16,"tag":661,"props":781,"children":783},{"id":782},"_411-模块",[784],{"type":22,"value":785},"4.1.1 模块",{"type":16,"tag":24,"props":787,"children":788},{},[789],{"type":22,"value":790},"在最高层，Triton-IR 程序由一个或多个称为模块的基本编译单元组成。模块彼此独立编译，最后由链接器合并；链接器负责解析前向声明并正确合并全局定义。",{"type":16,"tag":24,"props":792,"children":793},{},[794],{"type":22,"value":795},"每个模块由函数、全局变量、常量和其他符号（例如元数据和函数属性）组成。",{"type":16,"tag":661,"props":797,"children":799},{"id":798},"_412-函数",[800],{"type":22,"value":801},"4.1.2 函数",{"type":16,"tag":24,"props":803,"children":804},{},[805],{"type":22,"value":806},"Triton-IR 函数定义包含返回类型、名称和可能为空的参数列表。根据需要可以添加可见性、对齐方式和链接属性。还可以指定函数属性（例如内联提示）和参数属性（例如只读、别名提示），让编译器后端能够执行更激进的优化，例如更好地利用只读内存缓存。",{"type":16,"tag":24,"props":808,"children":809},{},[810],{"type":22,"value":811},"函数头部之后是由基本块列表组成的函数体；基本块之间的依赖构成函数的控制流图（CFG）。",{"type":16,"tag":661,"props":813,"children":815},{"id":814},"_413-基本块",[816],{"type":22,"value":817},"4.1.3 基本块",{"type":16,"tag":24,"props":819,"children":820},{},[821],{"type":22,"value":822},"基本块是直线代码序列，末尾只能包含终结指令，例如分支和返回。",{"type":16,"tag":24,"props":824,"children":825},{},[826],{"type":22,"value":827},"Triton-IR 使用静态单赋值（SSA）形式：每个基本块中的每个变量必须只被赋值一次，并且必须先定义后使用。这样，每个基本块隐式定义一个数据流图；不同路径对应 SSA 表示中的使用-定义链。",{"type":16,"tag":480,"props":829,"children":831},{"id":830},"_42-对-tile-级数据流分析的支持",[832],{"type":22,"value":833},"4.2 对 tile 级数据流分析的支持",{"type":16,"tag":661,"props":835,"children":837},{"id":836},"_421-类型",[838],{"type":22,"value":839},"4.2.1 类型",{"type":16,"tag":24,"props":841,"children":842},{},[843,845,851,853,934],{"type":22,"value":844},"多维 tile 是 Triton-IR 数据流分析的中心，可以使用类似 LLVM-IR 向量声明的语法。例如，",{"type":16,"tag":192,"props":846,"children":848},{"className":847},[],[849],{"type":22,"value":850},"i32\u003C8, 8>",{"type":22,"value":852}," 表示 ",{"type":16,"tag":255,"props":854,"children":856},{"className":855},[258],[857,889],{"type":16,"tag":255,"props":858,"children":860},{"className":859},[263],[861],{"type":16,"tag":266,"props":862,"children":863},{"xmlns":268},[864],{"type":16,"tag":271,"props":865,"children":866},{},[867,884],{"type":16,"tag":275,"props":868,"children":869},{},[870,876,880],{"type":16,"tag":871,"props":872,"children":873},"mn",{},[874],{"type":22,"value":875},"8",{"type":16,"tag":285,"props":877,"children":878},{},[879],{"type":22,"value":299},{"type":16,"tag":871,"props":881,"children":882},{},[883],{"type":22,"value":875},{"type":16,"tag":315,"props":885,"children":886},{"encoding":317},[887],{"type":22,"value":888},"8 \\times 8",{"type":16,"tag":255,"props":890,"children":892},{"className":891,"ariaHidden":325},[324],[893,920],{"type":16,"tag":255,"props":894,"children":896},{"className":895},[330],[897,902,907,911,916],{"type":16,"tag":255,"props":898,"children":901},{"className":899,"style":900},[335],"height:0.7278em;vertical-align:-0.0833em;",[],{"type":16,"tag":255,"props":903,"children":905},{"className":904},[341],[906],{"type":22,"value":875},{"type":16,"tag":255,"props":908,"children":910},{"className":909,"style":379},[349],[],{"type":16,"tag":255,"props":912,"children":914},{"className":913},[384],[915],{"type":22,"value":299},{"type":16,"tag":255,"props":917,"children":919},{"className":918,"style":379},[349],[],{"type":16,"tag":255,"props":921,"children":923},{"className":922},[330],[924,929],{"type":16,"tag":255,"props":925,"children":928},{"className":926,"style":927},[335],"height:0.6444em;",[],{"type":16,"tag":255,"props":930,"children":932},{"className":931},[341],[933],{"type":22,"value":875},{"type":22,"value":935}," 的 32 位整数 tile。",{"type":16,"tag":24,"props":937,"children":938},{},[939,941,946],{"type":22,"value":940},"Triton-IR 中没有 ",{"type":16,"tag":192,"props":942,"children":944},{"className":943},[],[945],{"type":22,"value":522},{"type":22,"value":947}," 关键字，因此参数化形状必须在生成程序之前解析。在本文实现中，这是由 Triton-JIT 的自动调优器完成的。",{"type":16,"tag":661,"props":949,"children":951},{"id":950},"_422-指令",[952],{"type":22,"value":953},"4.2.2 指令",{"type":16,"tag":24,"props":955,"children":956},{},[957],{"type":22,"value":958},"Triton-IR 引入了一组重新分块指令，用于支持第 3.2.2 节描述的广播语义：",{"type":16,"tag":148,"props":960,"children":961},{},[962,973],{"type":16,"tag":75,"props":963,"children":964},{},[965,971],{"type":16,"tag":192,"props":966,"children":968},{"className":967},[],[969],{"type":22,"value":970},"reshape",{"type":22,"value":972}," 根据输入数据创建指定形状的 tile。它特别适合通过在输入形状中补 1，把变量重新解释为更高维数组，以准备隐式或显式广播。",{"type":16,"tag":75,"props":974,"children":975},{},[976,982],{"type":16,"tag":192,"props":977,"children":979},{"className":978},[],[980],{"type":22,"value":981},"broadcast",{"type":22,"value":983}," 沿大小为 1 的维度复制输入参数，创建指定形状的 tile。",{"type":16,"tag":24,"props":985,"children":986},{},[987],{"type":16,"tag":110,"props":988,"children":993},{"alt":989,"src":990,"width":991,"height":992},"Triton-IR 的广播指令（原文图 4）","\u002Fimages\u002Fmaterials\u002Fcmu-15-779\u002Ftriton\u002Ffigure-04.webp",954,254,[],{"type":16,"tag":24,"props":995,"children":996},{},[997,999,1005,1006,1012,1013,1019,1020,1026,1028,1033,1035,1040],{"type":22,"value":998},"普通标量指令（",{"type":16,"tag":192,"props":1000,"children":1002},{"className":1001},[],[1003],{"type":22,"value":1004},"cmp",{"type":22,"value":550},{"type":16,"tag":192,"props":1007,"children":1009},{"className":1008},[],[1010],{"type":22,"value":1011},"getelementptr",{"type":22,"value":550},{"type":16,"tag":192,"props":1014,"children":1016},{"className":1015},[],[1017],{"type":22,"value":1018},"add",{"type":22,"value":550},{"type":16,"tag":192,"props":1021,"children":1023},{"className":1022},[],[1024],{"type":22,"value":1025},"load",{"type":22,"value":1027}," 等）被保留并扩展，以表示对 tile 操作数的逐元素操作。Triton-IR 还公开了处理转置（",{"type":16,"tag":192,"props":1029,"children":1031},{"className":1030},[],[1032],{"type":22,"value":585},{"type":22,"value":1034},"）和矩阵乘法（",{"type":16,"tag":192,"props":1036,"children":1038},{"className":1037},[],[1039],{"type":22,"value":578},{"type":22,"value":1041},"）的专用算术指令。",{"type":16,"tag":480,"props":1043,"children":1045},{"id":1044},"_43-对-tile-级控制流分析的支持",[1046],{"type":22,"value":1047},"4.3 对 tile 级控制流分析的支持",{"type":16,"tag":24,"props":1049,"children":1050},{},[1051],{"type":22,"value":1052},"Triton-IR 引入 tile 级操作后，一个问题是：无法在 tile 内表达分歧控制流。例如，程序可能需要部分保护 tile 级 load，避免内存访问越界，但不能通过普通分支实现，因为不能单独访问 tile 中的元素。",{"type":16,"tag":24,"props":1054,"children":1055},{},[1056],{"type":22,"value":1057},"我们使用 Predicated SSA（PSSA）形式 [8] 和 ψ 函数 [39] 解决这一问题。Triton-IR 增加两类指令：",{"type":16,"tag":148,"props":1059,"children":1060},{},[1061,1072],{"type":16,"tag":75,"props":1062,"children":1063},{},[1064,1070],{"type":16,"tag":192,"props":1065,"children":1067},{"className":1066},[],[1068],{"type":22,"value":1069},"cmpp",{"type":22,"value":1071}," 指令类似普通比较指令，但会返回两个相反的谓词，而不是一个。",{"type":16,"tag":75,"props":1073,"children":1074},{},[1075,1081],{"type":16,"tag":192,"props":1076,"children":1078},{"className":1077},[],[1079],{"type":22,"value":1080},"psi",{"type":22,"value":1082}," 指令合并来自不同谓词指令流的结果。",{"type":16,"tag":24,"props":1084,"children":1085},{},[1086],{"type":22,"value":709},{"type":16,"tag":457,"props":1088,"children":1091},{"className":1089,"code":1090,"language":22,"meta":462},[460],"; 若 x[i,j] \u003C 5，则 pt[i,j], pf[i,j] = (true, false)\n; 否则为 (false, true)\n% pt, % pf = icmpp slt %x, 5\n@%pt %x1 = add %y, 1\n@%pf %x2 = sub %y, 1\n; 合并不同谓词产生的值\n%x = psi i32\u003C8,8> [%pt, %x1], [%pf, %x2]\n%z = mul i32\u003C8,8> %x, 2\n",[1092],{"type":16,"tag":192,"props":1093,"children":1094},{"__ignoreMap":462},[1095],{"type":22,"value":1090},{"type":16,"tag":55,"props":1097,"children":1099},{"id":1098},"_5-triton-jit-编译器",[1100],{"type":22,"value":1101},"5 Triton-JIT 编译器",{"type":16,"tag":24,"props":1103,"children":1104},{},[1105],{"type":22,"value":1106},"Triton-JIT 的目标是通过一组与机器无关的 pass（第 5.1 节）和与机器相关的 pass（第 5.2 节），并由自动调优引擎支持（第 5.3 节），把 Triton-IR 程序简化并编译为高效机器代码。",{"type":16,"tag":480,"props":1108,"children":1110},{"id":1109},"_51-与机器无关的-pass",[1111],{"type":22,"value":1112},"5.1 与机器无关的 pass",{"type":16,"tag":661,"props":1114,"children":1116},{"id":1115},"_511-预取",[1117],{"type":22,"value":1118},"5.1.1 预取",{"type":16,"tag":24,"props":1120,"children":1121},{},[1122],{"type":22,"value":1123},"循环中的 tile 级内存操作可能产生严重延迟；如果没有足够多的独立指令，就难以隐藏这种延迟。不过，可以直接在 Triton-IR 中检测循环，并在需要的位置加入合适的预取代码。",{"type":16,"tag":24,"props":1125,"children":1126},{},[1127,1129,1134,1136,1142,1144,1150],{"type":22,"value":1128},"例如，原本的循环可能在当前迭代中 load 指针 ",{"type":16,"tag":192,"props":1130,"children":1132},{"className":1131},[],[1133],{"type":22,"value":24},{"type":22,"value":1135}," 指向的数据；自动预取后，会在当前迭代中计算并 load 下一次迭代需要的 ",{"type":16,"tag":192,"props":1137,"children":1139},{"className":1138},[],[1140],{"type":22,"value":1141},"p1",{"type":22,"value":1143},"，下一轮直接使用已经加载的 ",{"type":16,"tag":192,"props":1145,"children":1147},{"className":1146},[],[1148],{"type":22,"value":1149},"x1",{"type":22,"value":532},{"type":16,"tag":661,"props":1152,"children":1154},{"id":1153},"_512-tile-级窥孔优化",[1155],{"type":22,"value":1156},"5.1.2 Tile 级窥孔优化",{"type":16,"tag":24,"props":1158,"children":1159},{},[1160,1162,1206,1208,1395],{"type":22,"value":1161},"Triton-IR 中存在 tile 级操作，为窥孔优化器 [29] 带来了新的机会。例如，对任意 tile ",{"type":16,"tag":255,"props":1163,"children":1165},{"className":1164},[258],[1166,1188],{"type":16,"tag":255,"props":1167,"children":1169},{"className":1168},[263],[1170],{"type":16,"tag":266,"props":1171,"children":1172},{"xmlns":268},[1173],{"type":16,"tag":271,"props":1174,"children":1175},{},[1176,1184],{"type":16,"tag":275,"props":1177,"children":1178},{},[1179],{"type":16,"tag":279,"props":1180,"children":1181},{},[1182],{"type":22,"value":1183},"X",{"type":16,"tag":315,"props":1185,"children":1186},{"encoding":317},[1187],{"type":22,"value":1183},{"type":16,"tag":255,"props":1189,"children":1191},{"className":1190,"ariaHidden":325},[324],[1192],{"type":16,"tag":255,"props":1193,"children":1195},{"className":1194},[330],[1196,1200],{"type":16,"tag":255,"props":1197,"children":1199},{"className":1198,"style":336},[335],[],{"type":16,"tag":255,"props":1201,"children":1204},{"className":1202,"style":1203},[341,342],"margin-right:0.0785em;",[1205],{"type":22,"value":1183},{"type":22,"value":1207},"，恒等式 ",{"type":16,"tag":255,"props":1209,"children":1211},{"className":1210},[258],[1212,1267],{"type":16,"tag":255,"props":1213,"children":1215},{"className":1214},[263],[1216],{"type":16,"tag":266,"props":1217,"children":1218},{"xmlns":268},[1219],{"type":16,"tag":271,"props":1220,"children":1221},{},[1222,1262],{"type":16,"tag":275,"props":1223,"children":1224},{},[1225,1229,1233,1239,1250],{"type":16,"tag":279,"props":1226,"children":1227},{},[1228],{"type":22,"value":1183},{"type":16,"tag":285,"props":1230,"children":1231},{},[1232],{"type":22,"value":289},{"type":16,"tag":285,"props":1234,"children":1236},{"stretchy":1235},"false",[1237],{"type":22,"value":1238},"(",{"type":16,"tag":301,"props":1240,"children":1241},{},[1242,1246],{"type":16,"tag":279,"props":1243,"children":1244},{},[1245],{"type":22,"value":1183},{"type":16,"tag":279,"props":1247,"children":1248},{},[1249],{"type":22,"value":313},{"type":16,"tag":301,"props":1251,"children":1252},{},[1253,1258],{"type":16,"tag":285,"props":1254,"children":1255},{"stretchy":1235},[1256],{"type":22,"value":1257},")",{"type":16,"tag":279,"props":1259,"children":1260},{},[1261],{"type":22,"value":313},{"type":16,"tag":315,"props":1263,"children":1264},{"encoding":317},[1265],{"type":22,"value":1266},"X = (X^T)^T",{"type":16,"tag":255,"props":1268,"children":1270},{"className":1269,"ariaHidden":325},[324],[1271,1297],{"type":16,"tag":255,"props":1272,"children":1274},{"className":1273},[330],[1275,1279,1284,1288,1293],{"type":16,"tag":255,"props":1276,"children":1278},{"className":1277,"style":336},[335],[],{"type":16,"tag":255,"props":1280,"children":1282},{"className":1281,"style":1203},[341,342],[1283],{"type":22,"value":1183},{"type":16,"tag":255,"props":1285,"children":1287},{"className":1286,"style":350},[349],[],{"type":16,"tag":255,"props":1289,"children":1291},{"className":1290},[355],[1292],{"type":22,"value":289},{"type":16,"tag":255,"props":1294,"children":1296},{"className":1295,"style":350},[349],[],{"type":16,"tag":255,"props":1298,"children":1300},{"className":1299},[330],[1301,1306,1312,1353],{"type":16,"tag":255,"props":1302,"children":1305},{"className":1303,"style":1304},[335],"height:1.0913em;vertical-align:-0.25em;",[],{"type":16,"tag":255,"props":1307,"children":1310},{"className":1308},[1309],"mopen",[1311],{"type":22,"value":1238},{"type":16,"tag":255,"props":1313,"children":1315},{"className":1314},[341],[1316,1321],{"type":16,"tag":255,"props":1317,"children":1319},{"className":1318,"style":1203},[341,342],[1320],{"type":22,"value":1183},{"type":16,"tag":255,"props":1322,"children":1324},{"className":1323},[413],[1325],{"type":16,"tag":255,"props":1326,"children":1328},{"className":1327},[418],[1329],{"type":16,"tag":255,"props":1330,"children":1332},{"className":1331},[423],[1333],{"type":16,"tag":255,"props":1334,"children":1336},{"className":1335,"style":398},[428],[1337],{"type":16,"tag":255,"props":1338,"children":1339},{"style":432},[1340,1344],{"type":16,"tag":255,"props":1341,"children":1343},{"className":1342,"style":438},[437],[],{"type":16,"tag":255,"props":1345,"children":1347},{"className":1346},[443,444,445,446],[1348],{"type":16,"tag":255,"props":1349,"children":1351},{"className":1350,"style":451},[341,342,446],[1352],{"type":22,"value":313},{"type":16,"tag":255,"props":1354,"children":1357},{"className":1355},[1356],"mclose",[1358,1363],{"type":16,"tag":255,"props":1359,"children":1361},{"className":1360},[1356],[1362],{"type":22,"value":1257},{"type":16,"tag":255,"props":1364,"children":1366},{"className":1365},[413],[1367],{"type":16,"tag":255,"props":1368,"children":1370},{"className":1369},[418],[1371],{"type":16,"tag":255,"props":1372,"children":1374},{"className":1373},[423],[1375],{"type":16,"tag":255,"props":1376,"children":1378},{"className":1377,"style":398},[428],[1379],{"type":16,"tag":255,"props":1380,"children":1381},{"style":432},[1382,1386],{"type":16,"tag":255,"props":1383,"children":1385},{"className":1384,"style":438},[437],[],{"type":16,"tag":255,"props":1387,"children":1389},{"className":1388},[443,444,445,446],[1390],{"type":16,"tag":255,"props":1391,"children":1393},{"className":1392,"style":451},[341,342,446],[1394],{"type":22,"value":313},{"type":22,"value":1396}," 可以简化连续的转置操作。未来还可以利用与对角 tile 等结构相关的其他代数性质。",{"type":16,"tag":480,"props":1398,"children":1400},{"id":1399},"_52-与机器相关的-pass",[1401],{"type":22,"value":1402},"5.2 与机器相关的 pass",{"type":16,"tag":24,"props":1404,"children":1405},{},[1406],{"type":22,"value":1407},"现在考虑遵循图 5 所示高层模型的机器。Triton-JIT 执行的优化包括：",{"type":16,"tag":71,"props":1409,"children":1410},{},[1411,1416,1421,1426],{"type":16,"tag":75,"props":1412,"children":1413},{},[1414],{"type":22,"value":1415},"分层分块；",{"type":16,"tag":75,"props":1417,"children":1418},{},[1419],{"type":22,"value":1420},"内存合并；",{"type":16,"tag":75,"props":1422,"children":1423},{},[1424],{"type":22,"value":1425},"共享内存分配；",{"type":16,"tag":75,"props":1427,"children":1428},{},[1429],{"type":22,"value":1430},"共享内存同步。",{"type":16,"tag":661,"props":1432,"children":1434},{"id":1433},"_521-分层分块",[1435],{"type":22,"value":1436},"5.2.1 分层分块",{"type":16,"tag":24,"props":1438,"children":1439},{},[1440],{"type":22,"value":1441},"嵌套分块策略（图 5）把 tile 分解为 micro-tile，最终分解为 nano-tile，使其尽可能紧密地适配机器的计算能力和内存层次结构。",{"type":16,"tag":24,"props":1443,"children":1444},{},[1445],{"type":16,"tag":110,"props":1446,"children":1451},{"alt":1447,"src":1448,"width":1449,"height":1450},"Triton-IR 机器模型中的分层分块（原文图 5）","\u002Fimages\u002Fmaterials\u002Fcmu-15-779\u002Ftriton\u002Ffigure-05.webp",721,733,[],{"type":16,"tag":24,"props":1453,"children":1454},{},[1455],{"type":22,"value":1456},"虽然自动调优框架经常使用这一技术，但 Triton-IR 的结构使编译器能够自动枚举并优化任意可表达程序的有效嵌套分块配置，而不需要多面体工具。",{"type":16,"tag":661,"props":1458,"children":1460},{"id":1459},"_522-内存合并",[1461],{"type":22,"value":1462},"5.2.2 内存合并",{"type":16,"tag":24,"props":1464,"children":1465},{},[1466],{"type":22,"value":1467},"当相邻线程同时访问相邻内存位置时，内存访问称为合并访问。这一点很重要，因为内存通常以大块形式从 DRAM 取出。",{"type":16,"tag":24,"props":1469,"children":1470},{},[1471],{"type":22,"value":1472},"由于 Triton-IR 程序是单线程的、由编译器自动并行化，后端可以在每个 micro-tile 内部安排线程顺序，尽可能避免未合并访问。这会减少加载 tile 列所需的内存事务数量，如图 6 所示。",{"type":16,"tag":24,"props":1474,"children":1475},{},[1476],{"type":22,"value":1477},"图 6 中，未合并访问会让不同线程从 DRAM 读取彼此分散的位置；合并访问则把访问组织为相邻块，减少传输开销。",{"type":16,"tag":24,"props":1479,"children":1480},{},[1481],{"type":16,"tag":110,"props":1482,"children":1487},{"alt":1483,"src":1484,"width":1485,"height":1486},"未合并与合并 DRAM 访问（原文图 6）","\u002Fimages\u002Fmaterials\u002Fcmu-15-779\u002Ftriton\u002Ffigure-06.webp",1009,575,[],{"type":16,"tag":661,"props":1489,"children":1491},{"id":1490},"_523-共享内存分配",[1492],{"type":22,"value":1493},"5.2.3 共享内存分配",{"type":16,"tag":24,"props":1495,"children":1496},{},[1497,1499,1504],{"type":22,"value":1498},"具有高算术强度的 tile 级操作（例如 ",{"type":16,"tag":192,"props":1500,"children":1502},{"className":1501},[],[1503],{"type":22,"value":578},{"type":22,"value":1505},"）可以把操作数暂时存储在快速共享内存中。共享内存分配 pass 的目标是确定何时、何地把 tile 放入这块空间。",{"type":16,"tag":24,"props":1507,"children":1508},{},[1509],{"type":22,"value":1510},"如图 7 所示，首先计算每个相关变量的活跃区间，再使用 [15] 提出的线性时间存储分配算法。",{"type":16,"tag":24,"props":1512,"children":1513},{},[1514],{"type":16,"tag":110,"props":1515,"children":1520},{"alt":1516,"src":1517,"width":1518,"height":1519},"共享内存分配与变量活跃区间（原文图 7）","\u002Fimages\u002Fmaterials\u002Fcmu-15-779\u002Ftriton\u002Ffigure-07.webp",742,341,[],{"type":16,"tag":661,"props":1522,"children":1524},{"id":1523},"_524-共享内存同步",[1525],{"type":22,"value":1526},"5.2.4 共享内存同步",{"type":16,"tag":24,"props":1528,"children":1529},{},[1530],{"type":22,"value":1531},"在本文机器模型中，对共享内存的读写是异步的。共享内存同步 pass 会自动在生成的 GPU 源代码中插入屏障，以保持程序正确性。",{"type":16,"tag":24,"props":1533,"children":1534},{},[1535],{"type":22,"value":1536},"它使用前向数据流分析检测读后写（RAW）和写后读（WAR）冒险。若当前指令读取的数据与尚未解决的写集合相交，就插入屏障；若当前指令写入的数据与尚未解决的读集合相交，也插入屏障；否则将当前读写操作加入相应集合。",{"type":16,"tag":480,"props":1538,"children":1540},{"id":1539},"_53-自动调优器",[1541],{"type":22,"value":1542},"5.3 自动调优器",{"type":16,"tag":24,"props":1544,"children":1545},{},[1546],{"type":22,"value":1547},"传统自动调优器 [42, 45] 通常依赖手工编写的参数化代码模板，在预定义工作负载上获得良好性能。相比之下，Triton-JIT 可以直接从 Triton-IR 程序中提取优化空间：把各优化 pass 关联的元参数简单拼接起来即可。",{"type":16,"tag":24,"props":1549,"children":1550},{},[1551],{"type":22,"value":1552},"本文只考虑分层分块 pass，因此每个 tile 的每个维度最多有 3 个分块参数。这些参数通过穷举搜索优化：",{"type":16,"tag":148,"props":1554,"children":1555},{},[1556,1561,1566],{"type":16,"tag":75,"props":1557,"children":1558},{},[1559],{"type":22,"value":1560},"tile size 在 32 到 128 之间搜索 2 的幂；",{"type":16,"tag":75,"props":1562,"children":1563},{},[1564],{"type":22,"value":1565},"micro-tile size 在 8 到 32 之间搜索 2 的幂；",{"type":16,"tag":75,"props":1567,"children":1568},{},[1569],{"type":22,"value":1570},"nano-tile size 在 1 到 4 之间搜索 2 的幂。",{"type":16,"tag":24,"props":1572,"children":1573},{},[1574],{"type":22,"value":1575},"未来可以使用更好的自动调优方法。",{"type":16,"tag":55,"props":1577,"children":1579},{"id":1578},"_6-数值实验",[1580],{"type":22,"value":1581},"6 数值实验",{"type":16,"tag":24,"props":1583,"children":1584},{},[1585],{"type":22,"value":1586},"本节在深度学习文献中的多种工作负载上评估 Triton。实验使用 NVIDIA GeForce GTX1070，并与最新厂商库 cuBLAS 10.0、cuDNN 7.0，以及相关编译技术 Auto-TVM、TC 和 PlaidML 比较。在适用时，我们按照官方文档建议对这些 DSL 针对每个问题规模进行自动调优。",{"type":16,"tag":480,"props":1588,"children":1590},{"id":1589},"_61-矩阵乘法",[1591],{"type":22,"value":1592},"6.1 矩阵乘法",{"type":16,"tag":24,"props":1594,"children":1595},{},[1596,1598,1755,1757,1910,1912,2058],{"type":22,"value":1597},"矩阵乘法任务 ",{"type":16,"tag":255,"props":1599,"children":1601},{"className":1600},[258],[1602,1649],{"type":16,"tag":255,"props":1603,"children":1605},{"className":1604},[263],[1606],{"type":16,"tag":266,"props":1607,"children":1608},{"xmlns":268},[1609],{"type":16,"tag":271,"props":1610,"children":1611},{},[1612,1644],{"type":16,"tag":275,"props":1613,"children":1614},{},[1615,1619,1623,1628,1632],{"type":16,"tag":279,"props":1616,"children":1617},{},[1618],{"type":22,"value":294},{"type":16,"tag":285,"props":1620,"children":1621},{},[1622],{"type":22,"value":289},{"type":16,"tag":279,"props":1624,"children":1625},{},[1626],{"type":22,"value":1627},"D",{"type":16,"tag":285,"props":1629,"children":1630},{},[1631],{"type":22,"value":299},{"type":16,"tag":301,"props":1633,"children":1634},{},[1635,1640],{"type":16,"tag":279,"props":1636,"children":1637},{},[1638],{"type":22,"value":1639},"W",{"type":16,"tag":279,"props":1641,"children":1642},{},[1643],{"type":22,"value":313},{"type":16,"tag":315,"props":1645,"children":1646},{"encoding":317},[1647],{"type":22,"value":1648},"A = D \\times W^T",{"type":16,"tag":255,"props":1650,"children":1652},{"className":1651,"ariaHidden":325},[324],[1653,1679,1706],{"type":16,"tag":255,"props":1654,"children":1656},{"className":1655},[330],[1657,1661,1666,1670,1675],{"type":16,"tag":255,"props":1658,"children":1660},{"className":1659,"style":336},[335],[],{"type":16,"tag":255,"props":1662,"children":1664},{"className":1663},[341,342],[1665],{"type":22,"value":294},{"type":16,"tag":255,"props":1667,"children":1669},{"className":1668,"style":350},[349],[],{"type":16,"tag":255,"props":1671,"children":1673},{"className":1672},[355],[1674],{"type":22,"value":289},{"type":16,"tag":255,"props":1676,"children":1678},{"className":1677,"style":350},[349],[],{"type":16,"tag":255,"props":1680,"children":1682},{"className":1681},[330],[1683,1687,1693,1697,1702],{"type":16,"tag":255,"props":1684,"children":1686},{"className":1685,"style":369},[335],[],{"type":16,"tag":255,"props":1688,"children":1691},{"className":1689,"style":1690},[341,342],"margin-right:0.0278em;",[1692],{"type":22,"value":1627},{"type":16,"tag":255,"props":1694,"children":1696},{"className":1695,"style":379},[349],[],{"type":16,"tag":255,"props":1698,"children":1700},{"className":1699},[384],[1701],{"type":22,"value":299},{"type":16,"tag":255,"props":1703,"children":1705},{"className":1704,"style":379},[349],[],{"type":16,"tag":255,"props":1707,"children":1709},{"className":1708},[330],[1710,1714],{"type":16,"tag":255,"props":1711,"children":1713},{"className":1712,"style":398},[335],[],{"type":16,"tag":255,"props":1715,"children":1717},{"className":1716},[341],[1718,1723],{"type":16,"tag":255,"props":1719,"children":1721},{"className":1720,"style":451},[341,342],[1722],{"type":22,"value":1639},{"type":16,"tag":255,"props":1724,"children":1726},{"className":1725},[413],[1727],{"type":16,"tag":255,"props":1728,"children":1730},{"className":1729},[418],[1731],{"type":16,"tag":255,"props":1732,"children":1734},{"className":1733},[423],[1735],{"type":16,"tag":255,"props":1736,"children":1738},{"className":1737,"style":398},[428],[1739],{"type":16,"tag":255,"props":1740,"children":1741},{"style":432},[1742,1746],{"type":16,"tag":255,"props":1743,"children":1745},{"className":1744,"style":438},[437],[],{"type":16,"tag":255,"props":1747,"children":1749},{"className":1748},[443,444,445,446],[1750],{"type":16,"tag":255,"props":1751,"children":1753},{"className":1752,"style":451},[341,342,446],[1754],{"type":22,"value":313},{"type":22,"value":1756},"（",{"type":16,"tag":255,"props":1758,"children":1760},{"className":1759},[258],[1761,1814],{"type":16,"tag":255,"props":1762,"children":1764},{"className":1763},[263],[1765],{"type":16,"tag":266,"props":1766,"children":1767},{"xmlns":268},[1768],{"type":16,"tag":271,"props":1769,"children":1770},{},[1771,1809],{"type":16,"tag":275,"props":1772,"children":1773},{},[1774,1778,1783],{"type":16,"tag":279,"props":1775,"children":1776},{},[1777],{"type":22,"value":1627},{"type":16,"tag":285,"props":1779,"children":1780},{},[1781],{"type":22,"value":1782},"∈",{"type":16,"tag":301,"props":1784,"children":1785},{},[1786,1792],{"type":16,"tag":279,"props":1787,"children":1789},{"mathvariant":1788},"double-struck",[1790],{"type":22,"value":1791},"R",{"type":16,"tag":275,"props":1793,"children":1794},{},[1795,1800,1804],{"type":16,"tag":279,"props":1796,"children":1797},{},[1798],{"type":22,"value":1799},"M",{"type":16,"tag":285,"props":1801,"children":1802},{},[1803],{"type":22,"value":299},{"type":16,"tag":279,"props":1805,"children":1806},{},[1807],{"type":22,"value":1808},"K",{"type":16,"tag":315,"props":1810,"children":1811},{"encoding":317},[1812],{"type":22,"value":1813},"D \\in \\mathbb{R}^{M \\times K}",{"type":16,"tag":255,"props":1815,"children":1817},{"className":1816,"ariaHidden":325},[324],[1818,1845],{"type":16,"tag":255,"props":1819,"children":1821},{"className":1820},[330],[1822,1827,1832,1836,1841],{"type":16,"tag":255,"props":1823,"children":1826},{"className":1824,"style":1825},[335],"height:0.7224em;vertical-align:-0.0391em;",[],{"type":16,"tag":255,"props":1828,"children":1830},{"className":1829,"style":1690},[341,342],[1831],{"type":22,"value":1627},{"type":16,"tag":255,"props":1833,"children":1835},{"className":1834,"style":350},[349],[],{"type":16,"tag":255,"props":1837,"children":1839},{"className":1838},[355],[1840],{"type":22,"value":1782},{"type":16,"tag":255,"props":1842,"children":1844},{"className":1843,"style":350},[349],[],{"type":16,"tag":255,"props":1846,"children":1848},{"className":1847},[330],[1849,1853],{"type":16,"tag":255,"props":1850,"children":1852},{"className":1851,"style":398},[335],[],{"type":16,"tag":255,"props":1854,"children":1856},{"className":1855},[341],[1857,1863],{"type":16,"tag":255,"props":1858,"children":1861},{"className":1859},[341,1860],"mathbb",[1862],{"type":22,"value":1791},{"type":16,"tag":255,"props":1864,"children":1866},{"className":1865},[413],[1867],{"type":16,"tag":255,"props":1868,"children":1870},{"className":1869},[418],[1871],{"type":16,"tag":255,"props":1872,"children":1874},{"className":1873},[423],[1875],{"type":16,"tag":255,"props":1876,"children":1878},{"className":1877,"style":398},[428],[1879],{"type":16,"tag":255,"props":1880,"children":1881},{"style":432},[1882,1886],{"type":16,"tag":255,"props":1883,"children":1885},{"className":1884,"style":438},[437],[],{"type":16,"tag":255,"props":1887,"children":1889},{"className":1888},[443,444,445,446],[1890],{"type":16,"tag":255,"props":1891,"children":1893},{"className":1892},[341,446],[1894,1900,1905],{"type":16,"tag":255,"props":1895,"children":1898},{"className":1896,"style":1897},[341,342,446],"margin-right:0.109em;",[1899],{"type":22,"value":1799},{"type":16,"tag":255,"props":1901,"children":1903},{"className":1902},[384,446],[1904],{"type":22,"value":299},{"type":16,"tag":255,"props":1906,"children":1908},{"className":1907,"style":343},[341,342,446],[1909],{"type":22,"value":1808},{"type":22,"value":1911},"，",{"type":16,"tag":255,"props":1913,"children":1915},{"className":1914},[258],[1916,1965],{"type":16,"tag":255,"props":1917,"children":1919},{"className":1918},[263],[1920],{"type":16,"tag":266,"props":1921,"children":1922},{"xmlns":268},[1923],{"type":16,"tag":271,"props":1924,"children":1925},{},[1926,1960],{"type":16,"tag":275,"props":1927,"children":1928},{},[1929,1933,1937],{"type":16,"tag":279,"props":1930,"children":1931},{},[1932],{"type":22,"value":1639},{"type":16,"tag":285,"props":1934,"children":1935},{},[1936],{"type":22,"value":1782},{"type":16,"tag":301,"props":1938,"children":1939},{},[1940,1944],{"type":16,"tag":279,"props":1941,"children":1942},{"mathvariant":1788},[1943],{"type":22,"value":1791},{"type":16,"tag":275,"props":1945,"children":1946},{},[1947,1952,1956],{"type":16,"tag":279,"props":1948,"children":1949},{},[1950],{"type":22,"value":1951},"N",{"type":16,"tag":285,"props":1953,"children":1954},{},[1955],{"type":22,"value":299},{"type":16,"tag":279,"props":1957,"children":1958},{},[1959],{"type":22,"value":1808},{"type":16,"tag":315,"props":1961,"children":1962},{"encoding":317},[1963],{"type":22,"value":1964},"W \\in \\mathbb{R}^{N \\times K}",{"type":16,"tag":255,"props":1966,"children":1968},{"className":1967,"ariaHidden":325},[324],[1969,1995],{"type":16,"tag":255,"props":1970,"children":1972},{"className":1971},[330],[1973,1977,1982,1986,1991],{"type":16,"tag":255,"props":1974,"children":1976},{"className":1975,"style":1825},[335],[],{"type":16,"tag":255,"props":1978,"children":1980},{"className":1979,"style":451},[341,342],[1981],{"type":22,"value":1639},{"type":16,"tag":255,"props":1983,"children":1985},{"className":1984,"style":350},[349],[],{"type":16,"tag":255,"props":1987,"children":1989},{"className":1988},[355],[1990],{"type":22,"value":1782},{"type":16,"tag":255,"props":1992,"children":1994},{"className":1993,"style":350},[349],[],{"type":16,"tag":255,"props":1996,"children":1998},{"className":1997},[330],[1999,2003],{"type":16,"tag":255,"props":2000,"children":2002},{"className":2001,"style":398},[335],[],{"type":16,"tag":255,"props":2004,"children":2006},{"className":2005},[341],[2007,2012],{"type":16,"tag":255,"props":2008,"children":2010},{"className":2009},[341,1860],[2011],{"type":22,"value":1791},{"type":16,"tag":255,"props":2013,"children":2015},{"className":2014},[413],[2016],{"type":16,"tag":255,"props":2017,"children":2019},{"className":2018},[418],[2020],{"type":16,"tag":255,"props":2021,"children":2023},{"className":2022},[423],[2024],{"type":16,"tag":255,"props":2025,"children":2027},{"className":2026,"style":398},[428],[2028],{"type":16,"tag":255,"props":2029,"children":2030},{"style":432},[2031,2035],{"type":16,"tag":255,"props":2032,"children":2034},{"className":2033,"style":438},[437],[],{"type":16,"tag":255,"props":2036,"children":2038},{"className":2037},[443,444,445,446],[2039],{"type":16,"tag":255,"props":2040,"children":2042},{"className":2041},[341,446],[2043,2048,2053],{"type":16,"tag":255,"props":2044,"children":2046},{"className":2045,"style":1897},[341,342,446],[2047],{"type":22,"value":1951},{"type":16,"tag":255,"props":2049,"children":2051},{"className":2050},[384,446],[2052],{"type":22,"value":299},{"type":16,"tag":255,"props":2054,"children":2056},{"className":2055,"style":343},[341,342,446],[2057],{"type":22,"value":1808},{"type":22,"value":2059},"）是神经网络计算的核心。我们从循环网络（DeepSpeech2 [3]）和 Transformer [44] 中选择多种任务，并在图 8 中报告性能。",{"type":16,"tag":24,"props":2061,"children":2062},{},[2063],{"type":22,"value":2064},"Triton 与 cuBLAS 通常性能相当，达到设备峰值性能的 90% 以上；在某些任务上，Triton 还比其他 DSL 快最多 3 倍。",{"type":16,"tag":24,"props":2066,"children":2067},{},[2068],{"type":16,"tag":110,"props":2069,"children":2074},{"alt":2070,"src":2071,"width":2072,"height":2073},"矩阵乘法性能（原文图 8）","\u002Fimages\u002Fmaterials\u002Fcmu-15-779\u002Ftriton\u002Ffigure-08.webp",938,859,[],{"type":16,"tag":24,"props":2076,"children":2077},{},[2078,2080,2122,2123,2165],{"type":22,"value":2079},"不过，在浅层 Transformer 网络上，cuBLAS 仍然更快，因为它使用了三维算法 [2]，把较深的归约拆分为独立块，在 ",{"type":16,"tag":255,"props":2081,"children":2083},{"className":2082},[258],[2084,2105],{"type":16,"tag":255,"props":2085,"children":2087},{"className":2086},[263],[2088],{"type":16,"tag":266,"props":2089,"children":2090},{"xmlns":268},[2091],{"type":16,"tag":271,"props":2092,"children":2093},{},[2094,2101],{"type":16,"tag":275,"props":2095,"children":2096},{},[2097],{"type":16,"tag":279,"props":2098,"children":2099},{},[2100],{"type":22,"value":1799},{"type":16,"tag":315,"props":2102,"children":2103},{"encoding":317},[2104],{"type":22,"value":1799},{"type":16,"tag":255,"props":2106,"children":2108},{"className":2107,"ariaHidden":325},[324],[2109],{"type":16,"tag":255,"props":2110,"children":2112},{"className":2111},[330],[2113,2117],{"type":16,"tag":255,"props":2114,"children":2116},{"className":2115,"style":336},[335],[],{"type":16,"tag":255,"props":2118,"children":2120},{"className":2119,"style":1897},[341,342],[2121],{"type":22,"value":1799},{"type":22,"value":587},{"type":16,"tag":255,"props":2124,"children":2126},{"className":2125},[258],[2127,2148],{"type":16,"tag":255,"props":2128,"children":2130},{"className":2129},[263],[2131],{"type":16,"tag":266,"props":2132,"children":2133},{"xmlns":268},[2134],{"type":16,"tag":271,"props":2135,"children":2136},{},[2137,2144],{"type":16,"tag":275,"props":2138,"children":2139},{},[2140],{"type":16,"tag":279,"props":2141,"children":2142},{},[2143],{"type":22,"value":1951},{"type":16,"tag":315,"props":2145,"children":2146},{"encoding":317},[2147],{"type":22,"value":1951},{"type":16,"tag":255,"props":2149,"children":2151},{"className":2150,"ariaHidden":325},[324],[2152],{"type":16,"tag":255,"props":2153,"children":2155},{"className":2154},[330],[2156,2160],{"type":16,"tag":255,"props":2157,"children":2159},{"className":2158,"style":336},[335],[],{"type":16,"tag":255,"props":2161,"children":2163},{"className":2162,"style":1897},[341,342],[2164],{"type":22,"value":1951},{"type":22,"value":2166}," 较小时提供更多并行性。除此之外，现有 DSL 通常比 Triton 慢 2–3 倍；当输入形状是 32 的倍数时，TVM 的差距小于 2 倍。",{"type":16,"tag":480,"props":2168,"children":2170},{"id":2169},"_62-卷积",[2171],{"type":22,"value":2172},"6.2 卷积",{"type":16,"tag":24,"props":2174,"children":2175},{},[2176],{"type":22,"value":2177},"卷积神经网络是机器学习模型的重要类别，DSL 和编译器应当很好地支持它们。CNN 以卷积层为基础（图 9a）；为了利用专用张量处理硬件，必须把卷积实现为矩阵乘法（图 9b），但现有 DSL 通常不支持这一点。",{"type":16,"tag":24,"props":2179,"children":2180},{},[2181],{"type":16,"tag":110,"props":2182,"children":2187},{"alt":2183,"src":2184,"width":2185,"height":2186},"稠密和移位卷积的实现（原文图 9）","\u002Fimages\u002Fmaterials\u002Fcmu-15-779\u002Ftriton\u002Ffigure-09.webp",1017,1083,[],{"type":16,"tag":24,"props":2189,"children":2190},{},[2191,2193,2198],{"type":22,"value":2192},"我们测试了 Triton 对 cuDNN ",{"type":16,"tag":192,"props":2194,"children":2196},{"className":2195},[],[2197],{"type":22,"value":197},{"type":22,"value":2199}," 算法的重新实现（第 6.2.1 节），并提供了第一个可用的 shift convolution 融合 kernel（第 6.2.2 节）。这些程序使用指针增量查找表实现，如代码清单 8 所示。",{"type":16,"tag":661,"props":2201,"children":2203},{"id":2202},"_621-稠密卷积",[2204],{"type":22,"value":2205},"6.2.1 稠密卷积",{"type":16,"tag":24,"props":2207,"children":2208},{},[2209,2211,2216],{"type":22,"value":2210},"本小节考虑深度学习文献中的卷积层，任务列在表 1 中。图 10 显示，Triton 在 ResNet 上超过了 cuDNN 的 ",{"type":16,"tag":192,"props":2212,"children":2214},{"className":2213},[],[2215],{"type":22,"value":197},{"type":22,"value":2217}," 实现。",{"type":16,"tag":24,"props":2219,"children":2220},{},[2221],{"type":16,"tag":110,"props":2222,"children":2226},{"alt":2223,"src":2224,"width":2072,"height":2225},"隐式矩阵乘法性能（原文图 10）","\u002Fimages\u002Fmaterials\u002Fcmu-15-779\u002Ftriton\u002Ffigure-10.webp",838,[],{"type":16,"tag":24,"props":2228,"children":2229},{},[2230],{"type":22,"value":2231},"可能的原因是 cuDNN 对 3×3 卷积还维护了更好的算法，例如 Winograd [25]，因此没有投入很多工程资源去优化重要性较低的 kernel。在没有快速算法可用的任务（如 DeepSpeech2）上，cuDNN 与 Triton 性能相当。",{"type":16,"tag":661,"props":2233,"children":2235},{"id":2234},"_622-shift-convolution",[2236],{"type":22,"value":2237},"6.2.2 Shift convolution",{"type":16,"tag":24,"props":2239,"children":2240},{},[2241],{"type":22,"value":2242},"最后，我们把表 1 中的 Task 1–5 作为 shift convolution（图 9a）进行实现。这是 CNN 的一种新方法。我们将 Triton 中融合的 shift-conv 模块与一种朴素实现比较：后者依赖手写 shift kernel，再单独调用 cuBLAS。",{"type":16,"tag":24,"props":2244,"children":2245},{},[2246],{"type":22,"value":2247},"我们还报告了不执行 shift 时的最大可达到性能，即 1×1 卷积的性能。如图 11 所示，Triton 实现几乎完全隐藏了 shift 操作的代价。",{"type":16,"tag":24,"props":2249,"children":2250},{},[2251],{"type":16,"tag":110,"props":2252,"children":2256},{"alt":2253,"src":2254,"width":2255,"height":1450},"Triton 移位卷积性能（原文图 11）","\u002Fimages\u002Fmaterials\u002Fcmu-15-779\u002Ftriton\u002Ffigure-11.webp",945,[],{"type":16,"tag":55,"props":2258,"children":2260},{"id":2259},"_7-结论",[2261],{"type":22,"value":2262},"7 结论",{"type":16,"tag":24,"props":2264,"children":2265},{},[2266],{"type":22,"value":2267},"本文提出 Triton：一种开源语言和编译器，用于表达并把分块神经网络计算编译为高效机器代码。",{"type":16,"tag":24,"props":2269,"children":2270},{},[2271],{"type":22,"value":2272},"我们展示了，只需向 LLVM-IR 增加少量数据流和控制流扩展，就可以实现多种 tile 级优化 pass；这些 pass 联合起来，可以达到接近厂商库的性能。我们还提出了更高层的 Triton-C 语言，并使用它为 CNN 中的新型神经网络架构简洁地实现了高效 kernel。",{"type":16,"tag":24,"props":2274,"children":2275},{},[2276],{"type":22,"value":2277},"未来工作包括支持 tensor core、实现量化 kernel [26]，以及集成到更高层 DSL 中。",{"type":16,"tag":55,"props":2279,"children":2281},{"id":2280},"_8-致谢",[2282],{"type":22,"value":2283},"8 致谢",{"type":16,"tag":24,"props":2285,"children":2286},{},[2287],{"type":22,"value":2288},"本工作得到 NVIDIA Graduate Fellowship 支持。",{"type":16,"tag":55,"props":2290,"children":2292},{"id":2291},"参考文献",[2293],{"type":22,"value":2291},{"type":16,"tag":24,"props":2295,"children":2296},{},[2297],{"type":22,"value":2298},"参考文献 [1]–[48] 的书目信息保留原文，便于检索原始论文、库和工具；正文中的引用编号与原文一致。",{"title":462,"searchDepth":2300,"depth":2301,"links":2302},3,2,[2303,2304,2305,2306,2310,2315,2320,2324,2325,2326],{"id":57,"depth":2301,"text":57},{"id":92,"depth":2301,"text":95},{"id":202,"depth":2301,"text":205},{"id":470,"depth":2301,"text":473,"children":2307},[2308,2309],{"id":482,"depth":2300,"text":485},{"id":656,"depth":2300,"text":659},{"id":760,"depth":2301,"text":763,"children":2311},[2312,2313,2314],{"id":776,"depth":2300,"text":779},{"id":830,"depth":2300,"text":833},{"id":1044,"depth":2300,"text":1047},{"id":1098,"depth":2301,"text":1101,"children":2316},[2317,2318,2319],{"id":1109,"depth":2300,"text":1112},{"id":1399,"depth":2300,"text":1402},{"id":1539,"depth":2300,"text":1542},{"id":1578,"depth":2301,"text":1581,"children":2321},[2322,2323],{"id":1589,"depth":2300,"text":1592},{"id":2169,"depth":2300,"text":2172},{"id":2259,"depth":2301,"text":2262},{"id":2280,"depth":2301,"text":2283},{"id":2291,"depth":2301,"text":2291},20468,"\u002Fmaterials\u002Fcmu-15-779\u002Ftriton-paper-zh.md",1795088941292]