All models

ibert

I-BERT, a quantized RoBERTa-style encoder that runs inference with integer-only arithmetic.

Language · 668 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (29 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
109.5M
Operations
668
Framework
PyTorch
Recurrent
No
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m5401
Graph hash
4cebc89fa997acdf8803a8a9ba025b113153dbf9ee6f1ffb3a199e1d106a2bb6
Skeleton hash
8cc0683d2f08ba4dd7dff2a519707b6e53164e75a17ced8c70875c4bca9ffe6a
Architecture hash
36201104aeba0f2010090ca77782aef35c5e3d8bea08ce7165cef095c1426bdd
Diagram SHA-256
628cc75ef17c38b06e290d03e5867e48664aedfc0d2d729799f77bc2ba2ab56d
TorchLens version
2.35.3
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

How this diagram was made

transformers.AutoModel.from_config()

What it is

I-BERT is a quantized version of RoBERTa, proposed in the paper I-BERT: Integer-only BERT Quantization. Its quantization scheme carries out the entire inference with integer-only arithmetic. The paper's motivation is that previous work on quantizing Transformer based models used floating-point arithmetic during inference, which cannot make efficient use of integer-only hardware such as the Turing Tensor Cores or integer-only ARM processors.

To do without floating point, I-BERT relies on lightweight integer-only approximations of the nonlinear operations GELU, Softmax, and Layer Normalization. On GLUE downstream tasks with RoBERTa-Base/Large, the paper reports accuracy similar to, and slightly higher than, the full-precision baseline. It also reports a speedup of 2.4 - 4.0x for INT8 inference on a T4 GPU system compared to FP32 inference, from a preliminary implementation.

Key idea. I-BERT quantizes the entire inference of Transformer based models with integer-only arithmetic, using integer-only approximations of GELU, Softmax, and Layer Normalization.

  • i-bert
  • ibert
  • integer-only bert quantization
  • integer-only quantization
  • integer-only inference
  • quantized transformer
  • int8 inference
  • quantization

AI-written summary, based on the model's documentation and checked automatically against it; not reviewed by a person. Corrections welcome.