[quantization] Introduce a wrapper for nn.Embedding#455
[quantization] Introduce a wrapper for nn.Embedding#455mhs4670go merged 1 commit intoSamsung:mainfrom
nn.Embedding#455Conversation
514d9a6 to
0c64e7a
Compare
| self.weight_obs = self._make_obs( | ||
| "weight", | ||
| qscheme=QScheme.PER_CHANNEL_ASYMM, # tensorwise quantization breaks the model | ||
| channel_axis=0, # weight ~ (vocab_size, inner_dim) so we quantize by inner dimension so that scales ~ (1, vocab_size) |
There was a problem hiding this comment.
"inner dimension" is vocal_size here. Right?
There was a problem hiding this comment.
No. It's hidden_dim from LLama config.
There was a problem hiding this comment.
@mhs4670go
I mean inner_dim is dimension of internal float representation.
There was a problem hiding this comment.
@mhs4670go
Do you mean comment is wrong ? Scales are of ~ (1, vocab_size) shape for channel_axis = 0 (i've tested it)
There was a problem hiding this comment.
@mhs4670go
Finally i got inner dimension in inner dimension so .... I've tried to underscore the fact that scales will have 1, vocab_size dimension. So in inner dimension so ... may be confusing. It can be changed tp:
# weight ~ (vocab_size, inner_dim) so that scales ~ (1, vocab_size)
There was a problem hiding this comment.
@mhs4670go
Changed to a more clear comment.
There was a problem hiding this comment.
Thank you! It's more clear!
This commit introduces a wrapper for nn.Embedding. TICO-DCO-1.0-Signed-off-by: s.malakhov <s.malakhov@partner.samsung.com>
0c64e7a to
8030686
Compare
|
@stamalakhov Stas, it looks like |
@dvsav |
This commit introduces a wrapper for
nn.Embedding../ccex test -k "quantization.wrapq.wrappers.nn.test_quant_embedding"
Draft: #436
TICO-DCO-1.0-Signed-off-by: s.malakhov s.malakhov@partner.samsung.com