NVIDIA / NVIDIA/TensorRT

bert model split into many layers after int8 quantization

Open
#4,397 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I first post the issue in
https://github.com/NVIDIA/TensorRT-Model-Optimizer/issues/159

I quantize a pytorch bert model using TensorRT-Model-Optimizer

before quantization, I export this model to tensorrt and there is only one layer

Image

but after quantization there are many layers, why?
can this be fixed?

Image

(only part of these layers)

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 reviewing the before-and-after TensorRT exports shown here and the referenced TensorRT-Model-Optimizer issue. Reproduce the BERT int8 quantization comparison, then determine whether the additional layers are expected or indicate an export problem and document the evidence for a fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, pytorch
Domain
machine-learning, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.