Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#2452] Fix Rank Mismatch in Quantization for Conv3d Layers #2454

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aryanmahawar205
Copy link

Changes

  • Modified the _construct_quantization_op method in converter.py to expand the scale tensor to match the rank of the weight tensor.
  • Added logic to handle the expansion of the zero-point tensor as well.

Testing

  • Verified the fix by quantizing a model with Conv3d layers and ensuring that the quantization process completes without errors.
  • Tested with both w8a8 and other quantization schemes to ensure compatibility.

Related Issue

Fixes #2452 - coremltools.optimize.torch.quantization fails to handle w8a8 quantization for Conv3d layers.

Checklist

  • Code changes adhere to the project's coding standards.
  • Tests have been added/updated to verify the fix.

@aryanmahawar205
Copy link
Author

@junpeiz can you have a look at my PR. Thanks!

@TobyRoseman
Copy link
Collaborator

There seems to be a lot of formatting changes in this pull request. I don't think we want those changes. Please revert the formatting changes and just include your fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

coremltools.optimize.torch.quantization fails to handle w8a8 conv3d quantization properly
2 participants