首次用有限域代数学习精确的NVIDIA SASS编码器,支持最新显卡机器码重写。
Learning Exact NVIDIA SASS Encoders with $\mathbb{F}_2$ Linear Algebra
- 基于F2域线性代数,将SASS编码建模为向量仿射映射。
- 在3225个CUBIN上训练,往返测试中所有代码段完全复原无损。
- 开源支持SM107,可分离控制位与重定位规则,适合底层优化研究者。
NVIDIA提供SASS反汇编工具但未公开汇编器,限制了对数据中心GPU机器码的可控重写。本文提出F2Asm,通过成对的反汇编结果与原始CUBIN指令,学习精确的128位SASS编码器。据我们所知,F2Asm是首个将SASS指令编码建模为F2域上的向量值仿射映射的系统,也是首个支持Rubin SM107的开源NVIDIA SASS汇编器。F2Asm利用F2域上的高斯消元法,逐步构建紧凑基底,检测不一致并拒绝超出学习范围的输入。该方法将目标特定的控制位、重定位规则和CUBIN元数据与学习算法解耦。我们在3,225个来自指定NVIDIA及第三方生产库、CUDA 13.3与13.4开发者预览版存档的CUBIN上训练了针对Hopper SM90/SM90a、Blackwell SM100和Rubin SM107的编码器。在往返测试中,对每个CUBIN进行反汇编后再重新汇编,所有对比的可执行文本节均与原文件完全匹配。
原文摘要 · Abstract (English)
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 original CUBIN instruction words. To our knowledge, F2Asm is the first system to learn SASS instruction encoders as vector-valued affine maps over F2 and the first open-source NVIDIA SASS assembler to support Rubin SM107. F2Asm uses Gaussian elimination over F2 to incrementally build a compact basis, detect inconsistencies, and reject inputs outside the learned span. F2Asm separates target-specific control bits, relocation rules, and CUBIN metadata from its learning algorithm. We train encoders for Hopper SM90/SM90a, Blackwell SM100, and Rubin SM107 using 3,225 CUBINs from pinned NVIDIA and third-party production libraries, CUDA 13.3 packages, and CUDA 13.4 Developer Preview archives. In round-trip tests, F2Asm reassembles the disassembled SASS for each CUBIN, and all compared executable text sections match the originals exactly.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。