SLANG.D: Fast, Modular and Differentiable Shader Programming

SLANG.D: Fast, Modular and Differentiable Shader Programming
复制标题

DOI:
10.1145/3618353
复制
发表时间:
2023-12
期刊:
ACM Transactions on Graphics (TOG)
影响因子:
--
通讯作者:
Sai Praveen Bangaru;Lifan Wu;Tzu-Mao Li;Jacob Munkberg;Gilbert Bernstein;Jonathan Ragan-Kelley;Frédo Durand;Aaron E. Lefohn;Yong He
Sai Praveen Bangaru;Lifan Wu;Tzu-Mao Li;Jacob Munkberg;Gilbert Bernstein;Jonathan Ragan-Kelley;Frédo Durand;Aaron E. Lefohn;Yong He
中科院分区:
其他
文献类型:
--
作者:
Sai Praveen Bangaru;Lifan Wu;Tzu-Mao Li;Jacob Munkberg;Gilbert Bernstein;Jonathan Ragan-Kelley;Frédo Durand;Aaron E. Lefohn;Yong He

文献摘要

被引文献

相似文献

我们介绍slang.d,这是clang语的扩展,其中包含一流的自动分化支持。新的阴影语言使我们能够转换基于直接3D的路径示踪剂,并且对现有代码进行了少量修改,可以完全区分。 Slang.d启用了机器学习框架和预先存在的图形硬件API渲染系统之间的共享生态系统,从而促进了这两个域的组件和想法的互换。我们的贡献包括一个可区分的类型系统,旨在确保融合可区分和非差异代码的代码库中类型的安全性和语义清晰度,语言原始词自动生成向前和反向梯度传播方法,以及生成有效的衍生传播Shader代码的编译器体系结构用于图形管道。我们的编译器支持涉及任意控制流,动态调度,仿制药和高阶差异的区分代码,同时为开发人员提供了对检查点和梯度聚合策略的灵活控制,以获得最佳性能。我们的系统使我们能够区分现有的实时路径示踪剂Falcor,其着色器代码的更改最小。我们表明,编译器生成的衍生核的性能与手写的内核一样有效。在几个基准中,与先前的自动分化系统相比,s语代码可实现明显的加速。
We introduce SLANG.D, an extension to the Slang shading language that incorporates first-class automatic differentiation support. The new shading language allows us to transform a Direct3D-based path tracer to be fully differentiable with minor modifications to existing code. SLANG.D enables a shared ecosystem between machine learning frameworks and pre-existing graphics hardware API-based rendering systems, promoting the interchange of components and ideas across these two domains. Our contributions include a differentiable type system designed to ensure type safety and semantic clarity in codebases that blend differentiable and non-differentiable code, language primitives that automatically generate both forward and reverse gradient propagation methods, and a compiler architecture that generates efficient derivative propagation shader code for graphics pipelines. Our compiler supports differentiating code that involves arbitrary control-flow, dynamic dispatch, generics and higher-order differentiation, while providing developers flexible control of checkpointing and gradient aggregation strategies for best performance. Our system allows us to differentiate an existing real-time path tracer, Falcor, with minimal change to its shader code. We show that the compiler-generated derivative kernels perform as efficiently as handwritten ones. In several benchmarks, the SLANG.D code achieves significant speedup when compared to prior automatic differentiation systems.