Advanced NVIDIA CUDA Kernel Optimization Techniques: Handwritten PTX
AI-generated summary of reporting by NVIDIA Developer Blog. Read the original for the full story.
Why it matters
Very little changes for most developers: NVIDIA's own guidance is that hand-written PTX is a last resort, and the 7-14% gains shown apply only to a specific fused GEMM kernel on Hopper GPUs.
NVIDIA published a tutorial on PTX, which is the assembly language, the most low-level code, that runs on its GPUs. Using an example from its CUTLASS library that handles a common step in mixture-of-experts AI models, NVIDIA shows that writing PTX by hand instead of its usual C++ code speeds things up by 7-14% on a GH200 server GPU. The company stresses almost nobody should do this: the code is harder to write and debug, and may not work on other GPU models.
This is an advanced engineering tutorial, not a product launch, so there is nothing to buy or adopt. The message for decision-makers is that NVIDIA's optimised libraries (CUBLAS, CUTLASS) already contain hand-tuned GPU assembly where it pays off, and most teams gain nothing by going lower. The 7-14% throughput gain was measured only on the Hopper architecture (GH200), so hand-written low-level code risks not porting to future GPUs, an argument for building on NVIDIA's libraries rather than duplicating them.
NVIDIA benchmarks CUTLASS example 61 (fused GEMM with top_k=2 and softmax, the MoE routing pattern) on a GH200, toggling inline PTX in sm90_visitor_topk_softmax.hpp against CUDA C++ fallbacks. PTX versions of top_2/top_4 reduce and fast_masked_softmax deliver 7-14% higher GFlop/s across m=1,024 to 16,384 tokens (n=8, k=4096), with the PTX run reaching 5,704 GFlop/s at m=1024. Embedding options are inline PTX asm and the cuda::ptx namespace in libcu++; Hopper features require building with -DCUTLASS_NVCC_ARCHS=90a. Gains are kernel-specific and may not transfer across GPU architectures.
Read the original
This summary exists to save you time, not to replace the source.
Key terms
Was this summary useful?
One click, anonymous. It tells us which summaries to re-run.
Related reading
Code-driven AI illustrations are more useful than images from dedicated image models
Code‑driven AI illustrations let designers edit assets directly in code, saving time on iteration and ensuring consistency, which is a game‑changer for teams that need rapid, reusable visual content.
A hierarchical note-taking app for building large personal knowledge bases
Trilium lets users build and navigate massive personal knowledge bases without duplicating content, saving time on organization and retrieval.
Desktop apps in Go with native UI or web frontend
Go developers can now ship cross‑platform desktop and mobile apps in a single small binary without cgo or heavy runtimes, cutting build complexity and deployment size.
OpenBitFun: an agent workspace with four harness modes and phone remote control
OpenBitFun lets agents run on any machine and be controlled from a phone, eliminating the need to choose between local power and remote access, saving developers time switching contexts.
Intel One Mono: a monospaced font designed with low-vision developers
Developers with low vision or eye fatigue can read code more clearly, reducing errors and improving productivity.