Streaming AssemblerSASS
The assembly language for NVIDIA GPUs, the lowest-level human-readable form of GPU code, tied to a specific SM architecture.
Streaming ASSembler (SASS) is the assembly format for programs running on NVIDIA GPUs. It is the lowest-level format in which you can write human-readable code. Along with PTX, it is one of the formats output by nvcc, the NVIDIA CUDA Compiler Driver, and it is converted to device-specific binary microcode during execution.
The "Streaming" presumably refers to the Streaming Multiprocessors that the assembly language programs.
Versioning#
SASS is versioned and tied to a specific NVIDIA GPU SM architecture. See also Compute Capability.
Example instructions#
Two SASS instructions for the SM90a architecture of Hopper GPUs:
FFMA R0, R7, R0, 1.5 ;performs a Fused Floating point Multiply Add: it multiplies Register 7 by Register 0, adds1.5, and stores the result in Register 0.S2UR UR4, SR_CTAID.X ;copies theXvalue of the Cooperative Thread Array's InDex from its Special Register to Uniform Register 4.
How people use it#
Writing SASS by hand is very uncommon, even more so than writing assembly for CPUs. It is more common to read compiler-generated SASS while profiling and editing high-level CUDA C/C++ or in-line PTX, especially when building the highest-performance kernels.
- Godbolt can show CUDA C/C++, SASS and PTX side by side.
- This talk by Arun Demeure covers SASS with a focus on performance debugging.
Key idea You rarely write SASS, but reading it is how you see what the GPU will actually execute.
Documentation#
SASS is very lightly documented. The instructions are listed in the documentation for NVIDIA's CUDA binary utilities, but their semantics are not defined. The mapping from ASCII assembly to binary opcodes and operands is entirely undocumented, though it has been reverse-engineered in some cases (Maxwell, Lovelace).
Related#
- Parallel Thread Execution: the portable IR that compiles down to SASS
- CUDA Binary Utilities: tools for inspecting SASS in binaries
- Compute Capability: how GPU targets are versioned