NVIDIA / NVIDIA/TensorRT

TensorRT 2:4 sparsity is not applied with Q/DQ quantization

Open
#4,694 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Module:Performance Module:Quantization
Dominant language
C++
Stars
13.4k
Forks
2.4k
Avg merge
5d 3h
Merged PRs (30d)
2

Description

I’m testing INT8 quantization using ASP 2:4 sparse model.

  • Case A: Export sparse FP32 ONNX without QuantizeLinear/DequantizeLinear(Q/DQ) and build INT8 model using Polygraphy (with sparsity enabled).
    -> TensorRT layer info indicates sparsity-enabled tactics/kernels are selected for some layers.

  • Case B: Starting from the same sparse model, export an ONNX with Q/DQ using pytorch-quantization and build with: trtexec --int8 --sparsity=enable
    -> Layer info still shows HasSparseWeights=1 for some layers, but sparsity-enabled tactics/kernels do not appear to be selected.

Question:
Is this difference between no Q/DQ ONNX vs Q/DQ ONNX expected for 2:4 sparsity?
If not, are there recommended export/build settings for Q/DQ ONNX to enable sparsity tactics ?

Environment: Jetson (JetPack 6.1.2 / TensorRT 8.6.1)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing Case A and Case B with the stated JetPack 6.1.2 and TensorRT 8.6.1 environment, using Polygraphy for the sparse FP32 ONNX model and trtexec --int8 --sparsity=enable for the Q/DQ model. Compare the layer information and selected tactics; the issue is resolved when the expected relationship between Q/DQ quantization and 2:4 sparsity tactics, or the required export/build settings, is established.

Written by the indexing model from the issue text.

Assessment

Domain
embedded-iot, machine-learning, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.