Balancing INT8 Accuracy and Performance on Domestic AI Accelerators Without FP8 Support
This article explains how to run large language models on domestic AI accelerators that lack native FP8 support, focusing on fine-grained low-bit quantization schemes. It covers why INT8 can lose accuracy despite matching FP8's bit width, how group size controls quantization error, the difference between uniform and floating-point scales, why FP8 weights should not be converted directly to INT8, and how to place scale application along the K dimension for performance. It closes with a practical checklist for quantization granularity, weight calibration, operator design, and layer-wise evaluation.
On domestic AI accelerators without native FP8 support, running large models—especially those built on fine-grained low-bit quantization—while preserving both accuracy and throughput is a typical engineering challenge. This article approaches the problem from four angles: quantization granularity, numerical format differences, weight provenance, and operator implementation, and lays out a practical INT8 design and tuning path.
1. The Core Issue: Same Bit Width, Different Accuracy
The first instinct is that FP8 and INT8 are both 8 bits, so they hold the same amount of information and the accuracy gap should be small. In real deployments, however, switching the same model to INT8 often causes a noticeable drop. The cause is not bit width but two things: the granularity of the scale and the assumption about the in-group value distribution.
The general formula for low-bit quantization can be written as:
# Pseudocode: group quantization and dequantizationdef quantize(x, group_size):scale = x.abs().amax(dim=-1, keepdim=True) / 127.0 # computed onlineq = torch.round(x / scale).clamp(-127, 127)return q, scaledef dequantize(q, scale):return q.to(torch.float32) * scale
As long as group_size is small enough, quantization error is confined to a local range. Once a single scale is shared across an entire tensor or an entire row, any numerical format will break down. This is the premise for understanding the whole problem.
2. Group Granularity: The First Factor in Accuracy
Mature fine-grained schemes in the industry typically split things as follows:
- Activations: one scale per token per 128 channels, i.e., 1×128;
- Weights: one scale per 128×128 block;
- The scale is computed online from the amax of the current tile, without relying on offline statistics.
The value of this is outlier isolation. Outliers in large-model activations are highly concentrated, usually appearing in only a few channels of a few tokens. Once the groups are cut finely, an extreme value can contaminate at most the 128 numbers in its group, rather than an entire channel or an entire matrix. Under coarse-grained quantization, outliers push the scale up, compressing the vast majority of normal values into very few quantization levels—this is the main cause of the accuracy drop.
A practical note: the finer the groups, the greater the storage and computation overhead for scales, which is why 128 is a widely adopted compromise between accuracy and overhead.
3. In-Group Differences: Uniform vs. Floating-Point Scale
After grouping to 128, a fundamental difference still remains within the group.
An 8-bit floating-point format like E4M3 covers roughly 18 binades (the interval between two adjacent powers of 2) from the smallest subnormal number up to 448, with constant relative precision within each binade. As a result, small values in the group still retain meaningful precision. INT8 uses a uniform scale with constant absolute error, so the relative error of values near zero is amplified.
The good news is that after grouping to 128, the in-group dynamic range is already compressed very small, greatly weakening the disadvantage of the uniform scale, and INT8 is sufficient for most tasks. But “sufficient” does not mean “lossless”—how much accuracy is actually lost must be measured on the target task, and you cannot copy someone else’s conclusions. The recommended validation order is: first look at perplexity/task metrics, then do layer-by-layer error attribution, and finally pinpoint the specific operator.
4. Weight Provenance: Do Not Convert FP8 Weights to INT8
A common misconception is that since FP8 weights are already published, you can just convert them to INT8. This is lossy, because E4M3 values do not fall on a uniform grid, and converting to INT8 amounts to a second quantization, stacking errors.
The correct approach is to go back to the original BF16/FP16 weights and redo calibration and quantization, re-measuring amax and re-determining the scales. If only low-bit weights are available, you should also dequantize to high precision first and then requantize, accepting some expected accuracy loss.
5. The Performance Key: Where the Scale Is Applied
When the hardware does not support in-block scale, the performance bottleneck shifts to where the scale is applied. A workable approach is to take out the partial sums every 128 elements along the K direction, multiply by the scale, and then accumulate into a high-precision accumulator:
# Pseudocode: segmented dequantization + high-precision accumulationacc = torch.zeros(M, N, dtype=torch.float32)for k0 in range(0, K, 128):a_tile = A[:, k0:k0+128] # int8w_tile = B[k0:k0+128, :] # int8partial = int32_matmul(a_tile, w_tile) # int32 accumulationacc += partial.to(torch.float32) * (scale_a[:, k0:k0+128] * scale_w[k0:k0+128, :])
There are three key points:
- Align the segment length with the scale group length, so that “applying the scale” and “raising accumulation precision” happen in the same step, avoiding an extra pass;
- Keep the accumulator in high precision (int32 or fp32) to prevent segmented accumulation from introducing secondary error;
- Reduce intermediate tensor materialization, keeping things on-chip as much as possible to avoid bandwidth becoming the new bottleneck.
The same idea transfers directly to INT8 operators: set the segment length to 128, which naturally aligns with the quantization grouping and actually lowers implementation complexity.
6. Deployment Checklist
- Prefer quantization granularity of 1×128 / 128×128; do not degrade to per-tensor;
- Recalibrate weights from the original high-precision weights to avoid double quantization;
- Segment operators into 128 along the K direction, applying the scale and accumulation together;
- Establish a dual evaluation of layer-wise error and task metrics; quantization gains must be measured;
- Keep higher precision for sensitive layers (such as the first and last layers, and around normalization) as a fallback.
Summary: accelerators without FP8 support are not incapable of handling fine-grained low-bit schemes. The key is to get two things right—“controlling error by grouping” and “controlling performance by segmentation.” The former sets the accuracy floor, the latter sets the throughput ceiling. Only by designing the two in a decoupled way can you achieve a usable balance of accuracy and performance on domestic hardware.
