Tag
The post explains why LLM inference is nondeterministic due to non-associative floating-point addition and batch-dependent kernel selection, then presents DetLLM, a system that runs all LLM operations (matmuls, softmax, normalization, RoPE) in integer-only arithmetic to achieve bit-identical outputs across any GPU, CPU, or batch size. DetLLM became a paper accepted at two NeurIPS 2026 workshops.
A technical explainer on why LLM outputs can vary between identical requests: floating-point accumulation order changes with batch size on the GPU, causing tied tokens to flip and completions to diverge even at temperature 0. It highlights batch-invariance flags in vLLM, SGLang, and DeepSeek's DeepInfer, noting the throughput trade-offs for reproducible outputs.
A blog post reveals that a loss function can evaluate to exactly 0.0 in PyTorch while its backward pass executes arbitrary Turing-complete computation, enabling supply-chain attacks where a malicious regularization package silently modifies model weights during training.
Ken Shirriff decapsulates an Intel 8087 and digs into its microcode and datapath to explain how floating-point addition and subtraction were implemented in silicon, including special-case handling for infinities and the shifter, adder, and leading-zero circuits that gave the chip its ~100x speedup over the 8086.
Ken Shirriff 的深度技术文章,通过开盖显微成像与微码逆向分析,详解 Intel 8087 协处理器如何实现浮点加法与减法,包括 1648 条微指令、整数加法器、移位器与指数转换器等关键电路模块及其处理无穷大等特殊值的方式。
A blog post describing how the author brute-force searched over short formula space to superoptimize a floating-point lowest-set-bit computation, eliminating a branchy special case for powers of two in about 4 minutes of search time.
博客文章探讨了标准 C 中 string-to-float 转换函数(strtod 等)无法可移植地检测转换错误的问题:标准依赖 math_errhandling,而 POSIX 总是要求设置 errno,二者兼容性存疑。
一篇技术博客,介绍如何利用浮点数指数相当于对数这一特性,用 AVX2 浮点指令实现可向量化的 clz(前导零计数)和 ctz(尾随零计数)多播(polyfill),并在 Haswell/Alder Lake 上给出优于标量版本的性能数据。
博客文章指出整数与浮点算术遵循不同范式:整数运算需在灾难发生前预防溢出,而 IEEE-754 浮点运算中的 NaN 与无穷值会自然传播,不应照搬预防式检查(如用零分母或 FLT_EPSILON 守卫),这些检查在多数场景下无效且被 LLM 频繁写错。
This article explains the rounding errors in decimal calculations with floating-point numbers in programming, using Python examples to illustrate the patterns that emerge from IEEE double-precision floats.
This article explains various software-based alternatives to floating-point arithmetic, including decimal floating point, fractions, symbolic computation, interval arithmetic, and binary-coded decimal.
This paper presents accurate software models of AMD GPU matrix cores for CDNA 1/2/3 architectures, validated for bit-level reproducibility against hardware, and demonstrates their use in numerical applications to compare accuracy with NVIDIA tensor cores.
This article benchmarks the performance of subnormal floating-point numbers on Intel, AMD, and ARM processors, revealing that Intel processors experience significant slowdowns with subnormals while AMD and ARM are unaffected.
The article details the reverse-engineering of microcode in Intel's 8087 floating-point chip, focusing on the complex implementation of the FSCALE instruction and the chip's historical role in establishing floating-point standards.
The author implemented a vectorized FMA for Rust's fearless_simd library, leading to performance improvements and the discovery of bugs in Rust and musl libc standard libraries.
Chris Lomont explains accurate methods for converting between integer and floating-point color values in C++, highlighting common pitfalls and providing a roundtrip-safe solution with uniform mapping.
This article explains the double-double arithmetic technique, which achieves about 31 digits of precision by combining two double-precision numbers, and compares its performance to arbitrary-precision libraries like MPFR for applications such as deep zoom fractal rendering.
A technical blog post explains how to perform integer division and remainder using floating-point division and fused multiply-add, with constraints on operand bit widths, and discusses practical considerations for SIMD and rounding modes.
Rust 1.98 introduces a new API to enable faster floating-point math by allowing more aggressive compiler optimizations, while still giving developers control over rounding errors.
An article explaining why floating point numbers are a leaky abstraction, covering precision limits, subtraction issues, and overflow/underflow, with references to Goldberg's classic paper.