liveBook · Manning

Embedded domain-specific language

As explained in GPU Programming with Triton

An embedded domain-specific language is a domain-specific language expressed within a host programming language.

An embedded domain-specific language (eDSL) expresses specialized operations inside a host language. Triton embeds its kernel language in Python, so developers can write GPU code without leaving the Python ecosystem. section 1.1.1

Decorating a Python function with @triton.jit lets Triton capture and compile it into GPU code on the first call. The language and compiler work together at runtime; unlike CUDA C++, Triton does not require a separate ahead-of-time compilation and linking step. section 1.1.1

How GPU Programming with Triton covers it

How deep it goes
Traces decorated functions through runtime compilation to backend-specific GPU code, while leaving register and thread management to Triton.
Examples
Uses a Python function decorated with @triton.jit and names PTX and AMDGPU IR as backend-specific outputs.
What it assumes
Assumes Python use and an appropriate GPU runtime, but accommodates developers with little or no CUDA experience.
What you can do after
Build GPU kernels in Python while focusing on the algorithm rather than manually managing registers and threads.
How it connects
Connects Python, compilers, GPU kernels, and CUDA through its contrast between runtime and ahead-of-time compilation.

Also explained in

Compare how 2 books explain embedded domain-specific language →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of GPU Programming with Triton. The section links point to the parts of the book it draws on.