Skip to content

How to print/display/show integer quantized weights? #1644

Answered by vshampor
V0XNIHILI asked this question in Q&A
Discussion options

You must be logged in to vote

@V0XNIHILI note that knowing quantized weight values themselves (the INT8 values) is not enough to specify the weights - you have to know the scale of quantization and its zero-point. Note also that this is not exactly the use case we are covering with NNCF right now.

The nncf.torch.quantization.algo.QuantizationController object should have all the info you need to build a quantized representation. Here's some code to get you started (would only work at the develop branch right now):

import nncf.torch
import torch

from nncf.torch import create_compressed_model
from nncf import NNCFConfig
from nncf.torch.quantization.algo import QuantizationController


class MyWeightedModel(torch.nn.Module

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@V0XNIHILI
Comment options

@vshampor
Comment options

Answer selected by V0XNIHILI
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants