nncf
nncf copied to clipboard
Support 3D Weights in AWQ Algorithm
Changes
The core idea of this change is to first unsqueeze the weights so that it becomes 3D. Even the 2D weights. Then the rest of the algorithm implementation is changed such that it expects the weight shape to be 3D. Earlier we traversed each group in a weight individually. But now Since we want to find the scales for per-channel as well as per-expert, we traverse by group index as well as batch/expert index (this is just 1 for 2D weights so the behavior is same as before).
Reason for changes
Support AWQ for models with 3D weights such as MoE models.
Related tickets
175789 & 175212
Tests
Current AWQ tests were extended to include the AWQ test models with 3D weights.