If NVINT8 exists, the performance is …

If NVINT8 exists, the performance is …

While studying NVIDIA’s new FP4 formats — MXFP4 and NVFP4 —
I started wondering:

What if the same quantization logic were applied not just to FP4, but to INT4 and INT8?
Would that make integer quantization even better?

So, I decided to try.

Code (CPU-based simulation, not TensorRT):

All quantization and evaluation were implemented in pure Python / NumPy.
No TensorRT or GPU quantization kernels were used — this is a CPU reference simulation to study numerical behavior.


Experiment Overview

I implemented MXINT4, NVINT4, MXINT8, NVINT8 based on the quantization behavior of MXFP4/NVFP4.
Then, I compared them against FP32 baselines using synthetic distributions representative of typical model activations (Transformer-like and Reasoning-like).

Test setup:

  • Base precision: FP32 (main baseline).
  • Distributions: FP32_FULL (= RangeProfile.FP32_IEEE; log-uniform sampled n=200,000, include_subnormals=False, max_abs_cap≈4.61e18), Transformer-like, Reasoning-like.
  • Formats: MXFP4 / NVFP4 / MXINT4 / NVINT4 / MXINT8 / NVINT8
  • Loops: 5 times (averaged). Throughput is measured in ms/loop on CPU (NumPy reference; not hardware-optimized).
  • Metrics:
    • Reconstruction error (MSE vs FP32)
    • Quantize / Dequant throughput (ms/loop)
    • Bits per value (and Total bits)
    • Nonlinear layer fidelity (GELU, LayerNorm, Softmax):
      • Softmax MSE, Softmax KL(p‖q), Softmax Top-1 delta rate (argmax change vs FP32)

Key Results

FP32_FULL (IEEE754 FP32 range, log-uniform sampled n=200,000)

Scheme MSE vs FP32 bits/value Total bits Quantize ms/loop Dequant ms/loop
MXFP4 1.013488e+33 4.25000 850000 3355.222306 128.279116
NVFP4 9.001336e+32 4.50016 900032 569.166559 179.929585
MXINT4 4.384233e+34 4.25000 850000 110.942443 47.343677
NVINT4 8.583500e+32 4.50016 900032 281.392532 97.133989
MXINT8 1.728744e+32 8.25000 1650000 110.809907 48.246607
NVINT8 4.610962e+30 8.50016 1700032 285.039266 97.157737

→ NVINT8 achieved the smallest reconstruction error —
orders of magnitude lower than FP4 or INT4,
while maintaining similar quantization/dequantization speed.


Transformer-like (synthetic activations from GELU, LayerNorm, Softmax, n=200,000)

Scheme GELU MSE LayerNorm MSE Softmax MSE Softmax KL(p‖q) Softmax Top-1 Δ rate
MXFP4 0.015742 0.014989 0.000157 0.052713 0.224712
NVFP4 0.008770 0.008159 0.000025 0.013377 0.099872
MXINT4 0.023316 0.021552 0.000106 0.050271 0.199744
NVINT4 0.010732 0.011094 0.000012 0.008405 0.065301
MXINT8 0.006313 0.004819 0.000100 0.042190 0.119078
NVINT8 0.000210 0.000139 0.000003 0.001137 0.021767

→ On Transformer-like distributions, NVINT8 almost perfectly reproduces FP32,
with negligible deviations in Softmax and LayerNorm outputs.


Reasoning-like (heavy-tailed activations, block-scale jitter, n=200,000)

Scheme GELU MSE LayerNorm MSE Softmax MSE Softmax KL(p‖q) Softmax Top-1 Δ rate
MXFP4 0.674760 0.022027 0.001473 0.324865 0.289373
NVFP4 0.217546 0.008232 0.000399 0.094912 0.096671
MXINT4 0.725123 0.025214 0.000848 0.241636 0.165173
NVINT4 0.335547 0.013386 0.000163 0.035941 0.064661
MXINT8 0.374638 0.007906 0.000813 0.192708 0.132522
NVINT8 0.005198 0.000145 0.000025 0.005392 0.018566

→ In reasoning-like (dynamic, scale-varying) contexts,
NVINT8 again shows near-zero functional deviation,
preserving FP32 behavior across GELU, normalization, and Softmax layers.


Thoughts

It’s just a hypothesis —
maybe my implementation has mistakes, or the logic is flawed somewhere.

If NVINT8 truly existed, wouldn’t that be amazing?
FP32-like accuracy, INT8 efficiency — and almost no quantization loss across GELU, LayerNorm, and Softmax.


Notes

  • Implemented in Python / NumPy, following MXFP4 and NVFP4 scaling behavior.
  • All tests simulated on CPU with n=200,000 samples (log-uniform FP32 range).

Discussion welcome

This is not a definitive result — just an experiment and a thought exercise.
I’d really appreciate any feedback, corrections, or insights from others who’ve worked with INT quantization kernels or TensorRT calibration.

Maybe there’s a bug.
Maybe it’s an accidental truth.
Either way — I’d love to hear your thoughts.


Summary

  • NVFP4/NVINT4 already show better numerical stability than MX variants.
  • NVINT8 (hypothetical) achieves FP32-level reconstruction and near-perfect Softmax behavior.
  • If real, it could be ideal for reasoning-heavy or LLM workloads.

Hi @naisy ,

I am currently not sure if this would be within Tensorrt scope however would keep this thread open for teh comunity to respond.

thank you.

Hi, @AakankshaS ,

Thanks for keeping the thread open!
I understand this topic might not be exactly within the TensorRT scope,
but I wasn’t sure which category would fit best —
TensorRT seemed the most technically relevant place for this kind of quantization discussion.
Thank you.

Hey,

I also noticed the numerical instability in the lower precision math, I actually have a forum post here that has the path I used it into a reliable state.

Hi @naisy, thanks for posting the notebook and the reconstruction tables. That is a careful numerical study, even though it is deliberately a CPU NumPy simulation rather than a TensorRT path.

Short answer on the product side: there is no TensorRT datatype named NVINT8. What TensorRT documents today for quantized inference is INT8, INT4 (weight-only), FP8 (E4M3), and FP4 (E2M1):

What you labeled NVINT8 is a research construction: take the dual-scale idea from NVFP4 (fine-grained block scales plus a second-level scale) and apply it to an 8-bit integer grid. As a reconstruction-error study that is fair. Your MSE ordering is also what you would expect from first principles. An 8-bit integer plus good block scales has more representational room than a 4-bit float, so Softmax / LayerNorm looking close to FP32 in a dequant-and-compare study is not surprising. It does not by itself mean a shipping NVINT8 path would match FP32 end-to-end accuracy at GPU speed.

A few caveats if someone wants to turn this into a TensorRT request:

1. Hardware vs software

NVFP4 exists as a published 4-bit floating-point format with a two-level scaling strategy (E4M3 scale per 16-value micro-block, plus a second-level FP32 scalar):

That is a different story from inventing an NVINT8 Tensor Core type. A software “NVINT8” scheme on today’s stacks would still be integer math plus scales, not a new TensorRT builder precision flag, unless/until hardware and the builder expose it.

2. Throughput numbers in the notebook

The ms/loop figures are NumPy CPU timings. They are not predictive of TensorRT GPU kernel throughput.

3. Closest real knobs today

For accuracy-sensitive TensorRT work, use the documented INT8 Q/DQ path (and INT4 weight-only where it applies). For the FP4 dual-scale idea you were studying, the published format is NVFP4 in the link above.

@gerron.burford, thanks for jumping in. Your reply mentions a related post that stabilized lower-precision math, but the URL did not make it into the message. Can you paste that link so @naisy and others can follow it?

Thanks,
Atharva

Hello @athkumar,

Yes, I have it in the forums so I did not want to cross post. I have actually furthered the topic since finding this post.

This article describes using E2M1 on a Hopper, it is the newest in my articles.

This was the exact article I was speaking of. I am new to the forums, and have apparently upset another user with these already, so I felt as though it world be unnecessary without request. Both of these options are technically FP4 emulation.

If you plan on using FP4 or FP8 for training, my one piece of advice would be to ensure that GA must be greater than, or equal to, 32. You may have a different experience, but based on my research GA 32 is the safest stable configuration in my system. With snapshotting, you can achieve numerical stability before that floor, but its a little more rework to get that in right.

Also, keep in mind that I am using a native C++/Cuda trainer and Lion as an optimizer, not AdamW, so I have more direct control.

Thank you for asking for the links,

Gerron