F2Asm Learns Exact NVIDIA SASS Encoders for GPU Rewriting

Jiading Gai· August 24, 2026 View original

Key takeaways

  • F2Asm learns exact NVIDIA SASS encoders, enabling controlled GPU machine-code rewriting.
  • It uses F2 linear algebra to build a compact basis for instruction sets.
  • F2Asm is the first open-source SASS assembler to support Rubin SM107.
  • It achieves exact reassembly of disassembled SASS in round-trip tests.

Who benefits

High-Performance ComputingAI/ML HardwareCybersecurityGame DevelopmentScientific Research

Summary

F2Asm is a new system that learns exact 128-bit SASS encoders for NVIDIA GPUs using F2 linear algebra, enabling controlled machine-code rewriting. It is the first open-source SASS assembler to support Rubin SM107 and matches original executable text sections exactly in round-trip tests.

NVIDIA provides disassemblers for its SASS (Streaming Assembler) instruction set but does not publicly offer an assembler for recent data-center GPUs. This absence restricts the ability to perform controlled machine-code rewriting, which is crucial for advanced GPU programming and security analysis. To address this, a new system called F2Asm has been developed. F2Asm is designed to learn precise 128-bit SASS encoders. It achieves this by analyzing paired disassembly and original CUBIN instruction words, employing techniques from F2 linear algebra, specifically Gaussian elimination over F2. This method allows F2Asm to incrementally build a compact basis for the instruction set, detect inconsistencies, and reject invalid inputs. The system also intelligently separates target-specific control bits, relocation rules, and CUBIN metadata from its core learning algorithm. The researchers successfully trained encoders for various NVIDIA architectures, including Hopper SM90/SM90a, Blackwell SM100, and Rubin SM107, using a large corpus of CUBINs from production libraries and CUDA packages. In rigorous round-trip tests, F2Asm was able to reassemble disassembled SASS code, with all compared executable text sections matching the originals exactly. This marks F2Asm as the first open-source NVIDIA SASS assembler to support the Rubin SM107 architecture.

Why it matters

This breakthrough provides unprecedented control over NVIDIA GPU machine code, enabling advanced optimization, security research, and custom kernel development for professionals working with high-performance computing and AI hardware.

How to implement this in your domain

  1. 1Utilize F2Asm for low-level GPU kernel optimization and performance tuning.
  2. 2Integrate F2Asm into security analysis tools to detect and mitigate GPU-specific vulnerabilities.
  3. 3Develop custom GPU instruction sets or extensions for specialized AI workloads.
  4. 4Explore the learned SASS encoders to gain deeper insights into NVIDIA GPU architecture.

Original post by Jiading Gai

"arXiv:2608.20532v1 Announce Type: new Abstract: NVIDIA provides a SASS disassembler but no public SASS assembler for recent data-center GPUs, limiting controlled machine-code rewriting. We present F2Asm, which learns exact 128-bit SASS encoders from paired disassembly and origina…"

View on X

Originally posted by Jiading Gai on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses

More in AI Engineering & DevTools