Int8 ONNX evaluation
- Model internal computations are scaled to Int8 -> Faster on modern GPUs
- Caveats:
- For float16: Input can be cast to float16 by rounding
- Int8 has better coverage with scaling -> Input cannot be cast without knowing the scaling factors
- Input to NN is therefore kept at float32 and model internally converts to int8
- Fusing of ONNX layers strongly improved performance of the graph eval
EPN000 (MI50 -> No speedup with int8)
(This shows how much the int8 internal conversion may slow down the graph evaluation compared to float16 computations)
GPU timeslice reconstruction excluding gaps
|
Default reco
|
2.06 ± 0.01 |
|
NN class. + default reg.
|
2.57 ± 0.02 |
|
NN full, float16, threshold 18%
|
2.93 ± 0.01 |
|
NN full, int8, threshold 18%
|
3.78 ± 0.01 |
RTX5080
ONNXRuntime error for INT8 execution
[E:onnxruntime:, sequential_executor.cc:572 ExecuteKernel]
Non-zero status code returned while running MatMulInteger node.
Name:'StaticINT8_Layer5__MatMulInteger' Status Message: CUBLAS failure 15: CUBLAS_STATUS_NOT_SUPPORTED ;
GPU=0 ; hostname=pdp-dev00.internal ; file=/home/csonnabe/MyO2/sw/BUILD/ce42118eb63c984cd8d7b1d3a7a79338b5e6a4dc/
ONNXRuntime/onnxruntime/core/providers/cuda/integer_gemm.cc ; line=52 ;
expr=cublasGemmEx( cublas, CUBLAS_OP_N, CUBLAS_OP_N, n, m, k, &alpha, ldb_aligned == ldb ? b : b_padded.get(),
CUDA_R_8I, ldb_aligned, lda_aligned == lda ? a : a_padded.get(), CUDA_R_8I, lda_aligned, &beta, c, CUDA_R_32I,
ldc, CUDA_R_32I, CUBLAS_GEMM_DFALT);
Tried the following
- Tried building with tensor-rt support, but Tensor-rt require gnu++17 -> c++ standards mismatch
- Fixed Tensor-RT support: https://github.com/alisw/alidist/pull/6266
- But finally worked only with CUDA EP
Benchmark result: 19.16 ± 0.14s -> Something is not right yet... but at least it runs. Baby steps.