liveBook · Manning

Asm attribute

As explained in GPU Programming with Triton

The asm attribute is a compiled Triton kernel object's mapping from compilation-stage names to generated source or binary representations.

After a Triton kernel compiles, its `asm` attribute maps compiler-stage names such as `ttir`, `ptx`, and `cubin` to generated representation strings. Inspect these outputs to understand how block-level logic is lowered or to investigate memory access, tiling, and control flow. section 2.3.2

Save compiler stages

Launch an addition kernel, then write `compiled.asm["ttir"]` and other stage entries to separate files for inspection. section 2.3.2

How GPU Programming with Triton covers it

How deep it goes
Defines the stage-name-to-source mapping and describes programmatic retrieval, without detailing representation internals.
Examples
Uses an addition kernel to save TTIR, TTGIR, LLVM IR, and PTX outputs into separate files.
What you can do after
Diagnose or tune kernel behavior by inspecting generated intermediate representations and assembly.
How it connects
Connects Triton IR, LLVM IR, and PTX to compiler lowering and GPU instruction generation.

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.