“Rodent: generating renderers without writing a generator” by Pérard-Gayot, Membarth, Leissa, Hack and Slusallek
Conference:
Type(s):
Title:
- Rodent: generating renderers without writing a generator
Session/Category Title: Light Science
Presenter(s)/Author(s):
Abstract:
Monte-Carlo Renderers must generate many color samples to produce a noise-free image, and for each of those, they must evaluate complex mathematical models representing the appearance of the objects in the scene. These models are usually in the form of shaders: Small programs that are executed during rendering in order to compute a value for the current sample.Renderers often compile and optimize shaders just before rendering, taking advantage of the knowledge of the scene. In principle, the entire renderer could benefit from a-priori code generation. For instance, scheduling can take advantage of the knowledge of the scene in order to maximize hardware usage. However, writing such a configurable renderer eventually means writing a compiler that translates a scene description into machine code.In this paper, we present a framework that allows generating entire renderers for CPUs and GPUs without having to write a dedicated compiler: First, we provide a rendering library in a functional/imperative language that elegantly abstracts the individual rendering concepts using higher-order functions. Second, we use partial evaluation to combine and specialize the individual components of a renderer according to a particular scene.Our results show that the renderers we generate outperform equivalent high-performance implementations written with state-of-the-art ray tracing libraries on the CPU and GPU.
References:
1. Attila T. Áfra, Carsten Benthin, Ingo Wald, and Jacob Munkberg. 2016. Local Shading Coherence Extraction for SIMD-efficient Path Tracing on CPUs. In Proceedings of High Performance Graphics. Eurographics Association, 119–128. Google ScholarDigital Library
2. P.H. Andersen. 1995. Partial Evaluation Applied to Ray Tracing. DIKU Research Report 95/2. DIKU.Google Scholar
3. Kenichi Asai. 2002. Can Partial Evaluation Improve the Performance of Ray Tracing? Technical Report Vol. 53, Nr. 1. Ochanomizu University. 97–100.Google Scholar
4. Benedikt Bitterli. 2016. Rendering resources. https://benedikt-bitterli.me/resources/Google Scholar
5. Jacques Carette, Oleg Kiselyov, and Chung-chieh Shan. 2007. Finally Tagless, Partially Evaluated. In Programming Languages and Systems, 5th Asian Symposium, APLAS 2007, Singapore, November 29-December 1, 2007, Proceedings. 222–238. Google ScholarDigital Library
6. Charles Consel. 1988. New Insights into Partial Evaluation: the SCHISM Experiment. In ESOP ’88, 2nd European Symposium on Programming, Nancy, France, March 21–24, 1988, Proceedings. 236–246. Google ScholarDigital Library
7. J. Döllner and K. Hinrichs. 2002. A Generic Rendering System. IEEE Transactions on Visualization and Computer Graphics 8, 2 (2002), 99–118. Google ScholarDigital Library
8. Philip Dutre, Paul Heckbert, Vincent Ma, Fabio Pellacini, Robert Porschka, Mahesh Ramasubramanian, Cyril Soler, and Greg Ward. 2001. Global Illumination Compendium.Google Scholar
9. Yoshihiko Futamura. 1982. Parital Computation of Programs. In RIMS Symposium on Software Science and Engineering, Kyoto, Japan, 1982, Proceedings. 1–35. Google ScholarDigital Library
10. Iliyan Georgiev and Philipp Slusallek. 2008. RTfact: Generic Concepts for Flexible and High Performance Ray Tracing. In Proceedings of the IEEE Symposium on Interactive Ray Tracing (RT). IEEE, 115–122.Google ScholarCross Ref
11. Andrew S. Glassner (Ed.). 1989. An Introduction to Ray Tracing. Academic Press Ltd., London, UK, UK. Google ScholarDigital Library
12. Brian Guenter, Todd B. Knoblock, and Erik Ruf. 1995. Specializing Shaders. In Proceedings of the 22Nd Annual Conference on Computer Graphics and Interactive Techniques (SIGGRAPH ’95). ACM, New York, NY, USA, 343–350. Google ScholarDigital Library
13. Maurice H. Halstead. 1977. Elements of Software Science (Operating and Programming Systems Series). Elsevier Science Inc., New York, NY, USA. Google ScholarDigital Library
14. Yong He, Kayvon Fatahalian, and Tim Foley. 2018. Slang: Language Mechanisms for Extensible Real-time Shading Systems. ACM Trans. Graph. 37, 4, Article 141 (2018), 13 pages. Google ScholarDigital Library
15. Neil D. Jones. 1996. An Introduction to Partial Evaluation. ACM Comput. Surv. 28, 3 (1996), 480–503. Google ScholarDigital Library
16. James T. Kajiya. 1986. The Rendering Equation. SIGGRAPH Comput. Graph. 20, 4 (1986), 143–150. Google ScholarDigital Library
17. Samuli Laine, Tero Karras, and Timo Aila. 2013. Megakernels Considered Harmful: Wavefront Path Tracing on GPUs. In Proceedings of the 5th High-Performance Graphics Conference (HPG). ACM, 137–143. Google ScholarDigital Library
18. Roland Leißa, Klaas Boesche, Sebastian Hack, Arsène Pérard-Gayot, Richard Membarth, Philipp Slusallek, André Müller, and Bertil Schmidt. 2018. AnyDSL: A Partial Evaluation Framework for Programming High-Performance Libraries. PACMPL 2, OOPSLA (2018), 119:1–119:30. Google ScholarDigital Library
19. Michael D. McCool, Zheng Qin, and Tiberiu S. Popa. 2002. Shader Metaprogramming. In Proceedings of the ACM SIGGRAPH/EUROGRAPHICS Conference on Graphics Hardware (HWWS ’02). Eurographics Association, Aire-la-Ville, Switzerland, Switzerland, 57–68. Google ScholarDigital Library
20. Simon Moll and Sebastian Hack. 2018. Partial Control-Flow Linearization. In Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI). ACM, 543–556. Google ScholarDigital Library
21. NVIDIA. 2019. CUDA Toolkit Documentation. http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html, visited 10/01/19.Google Scholar
22. Steven G. Parker, James Bigler, Andreas Dietrich, Heiko Friedrich, Jared Hoberock, David Luebke, David McAllister, Morgan McGuire, Keith Morley, Austin Robison, and Martin Stich. 2010. OptiX: A General Purpose Ray Tracing Engine. ACM Transactions on Graphics (TOG) 29, 4, Article 66 (July 2010), 13 pages. Google ScholarDigital Library
23. Matt Pharr and William R. Mark. 2012. ispc: A SPMD Compiler for High-Performance CPU Programming. In 2012 Innovative Parallel Computing (InPar). IEEE, 1–13.Google Scholar
24. Pixar 1988. RenderMan Interface Specification. Pixar. version 3.0.Google Scholar
25. Arsène Pérard-Gayot, Martin Weier, Richard Membarth, Philipp Slusallek, Roland Leißa, and Sebastian Hack. 2017. RaTrace: Simple and Efficient Abstractions for BVH Ray Traversal Algorithms. In Proceedings of the 16th International Conference on Generative Programming: Concepts & Experiences (GPCE). ACM, 157–168. Google ScholarDigital Library
26. Jonathan Ragan-Kelley, Connelly Barnes, Andrew Adams, Sylvain Paris, Frédo Durand, and Saman Amarasinghe. 2013. Halide: A Language and Compiler for Optimizing Parallelism, Locality, and Recomputation in Image Processing Pipelines. SIGPLAN Not. 48, 6 (2013), 519–530. Google ScholarDigital Library
27. James Reinders. 2007. Intel Threading Building Blocks – Outfitting C++ for Multi-Core Processor Parallelism. O’Reilly. http://www.oreilly.com/catalog/9780596514808/index.html Google ScholarDigital Library
28. Kai Selgrad, Alexander Lier, Franz Köferl, Marc Stamminger, and Daniel Lohmann. 2015. Lightweight, Generative Variant Exploration for High-performance Graphics Applications. In Proceedings of the 14th International Conference on Generative Programming: Concepts & Experiences (GPCE). ACM, 141–150. Google ScholarDigital Library
29. Philipp Slusallek and Hans-Peter Seidel. 1995. Vision – An Architecture for Global Illumination Calculations. IEEE Transactions on Visualization & Computer Graphics 1 (1995), 77–96. Google ScholarDigital Library
30. Kristian Sons, Felix Klein, Jan Sutter, and Philipp Slusallek. 2014. shade.js: Adaptive Material Descriptions. Computer Graphics Forum 33, 7 (2014), 51–60. Google ScholarDigital Library
31. Sony Pictures Imageworks 2017. Open Shading Language Specification. Sony Pictures Imageworks. version 1.9.Google Scholar
32. Eric Veach and Leonidas J. Guibas. 1995. Optimally Combining Sampling Techniques for Monte Carlo Rendering. In Proceedings of the 22Nd Annual Conference on Computer Graphics and Interactive Techniques (SIGGRAPH ’95). ACM, New York, NY, USA, 419–428. Google ScholarDigital Library
33. Ingo Wald, Sven Woop, Carsten Benthin, Gregory S. Johnson, and Manfred Ernst. 2014. Embree: A Kernel Framework for Efficient CPU Ray Tracing. ACM Transactions on Graphics (TOG) 33, 4, Article 143 (July 2014), 8 pages. Google ScholarDigital Library
34. Turner Whitted. 1980. An Improved Illumination Model for Shaded Display. Commun. ACM 23, 6 (1980), 343–349. Google ScholarDigital Library
35. Stefan Zellmann, Daniel Wickeroth, and Ulrich Lang. 2017. Visionaray: A Cross-Platform Ray Tracing Template Library. In Proceedings of the 10th Workshop on Software Engineering and Architectures for Realtime Interactive Systems (IEEE SEARIS 2017). 1–8.Google ScholarCross Ref
36. Yunming Zhang, Mengjiao Yang, Riyadh Baghdadi, Shoaib Kamil, Julian Shun, and Saman P. Amarasinghe. 2018. GraphIt: A High-Performance Graph DSL. PACMPL 2, OOPSLA (2018), 121:1–121:30. Google ScholarDigital Library