Skip to content

Conversation

@realAsma
Copy link
Contributor

What does this PR do?

Type of change: ?

Overview:

Add registry interface for custom quantization functional backend

Usage

see tests/unit/torch/quantization/test_custom_backend.py for usage example.

Testing

Before your PR is "Ready for review"

  • Make sure you read and follow Contributor guidelines and your commits are signed.
  • Is this change backward compatible?: Yes
  • Did you write any new necessary tests?: Yes/No
  • Did you add or update any necessary documentation?: Yes
  • Did you update Changelog?: Yes

Additional Information

@realAsma realAsma requested review from a team as code owners December 12, 2025 22:07
@realAsma realAsma requested a review from cjluo-nv December 12, 2025 22:07
@realAsma realAsma force-pushed the asma/support_for_private_backends branch from 0eac522 to 6e4c43f Compare December 12, 2025 22:12
@codecov
Copy link

codecov bot commented Dec 12, 2025

Codecov Report

❌ Patch coverage is 70.58824% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.69%. Comparing base (3fd8b80) to head (cdbb918).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
modelopt/torch/quantization/tensor_quant.py 0.00% 14 Missing ⚠️
.../torch/quantization/nn/modules/tensor_quantizer.py 91.42% 3 Missing ⚠️
modelopt/torch/utils/logging.py 33.33% 2 Missing ⚠️
modelopt/torch/utils/tensor.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #683      +/-   ##
==========================================
+ Coverage   74.65%   74.69%   +0.03%     
==========================================
  Files         192      192              
  Lines       18909    18946      +37     
==========================================
+ Hits        14117    14152      +35     
- Misses       4792     4794       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@realAsma realAsma requested a review from cjluo-nv December 17, 2025 22:15
@realAsma realAsma force-pushed the asma/support_for_private_backends branch from 6e4c43f to 5cb5ae8 Compare December 18, 2025 00:24
@realAsma realAsma requested a review from a team as a code owner December 19, 2025 00:22
@realAsma realAsma requested a review from ChenhanYu December 19, 2025 00:22
Copy link
Contributor

@meenchen meenchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall, one question for model restore, do users need to register custom backends before restoring models?

@realAsma
Copy link
Contributor Author

realAsma commented Dec 19, 2025

#683 (review)

Yes, the backend info is stored in the modelopt state. After restore if this backend is not found, an error will be raised.

@realAsma realAsma force-pushed the asma/support_for_private_backends branch from 8af2a0c to 7494116 Compare December 19, 2025 18:24
@realAsma realAsma force-pushed the asma/support_for_private_backends branch from 7494116 to 9b6e0fa Compare December 19, 2025 19:31
@realAsma realAsma enabled auto-merge (squash) December 19, 2025 19:32
@realAsma realAsma disabled auto-merge December 19, 2025 19:33
@realAsma realAsma force-pushed the asma/support_for_private_backends branch from c16e599 to 4320a05 Compare December 19, 2025 19:46
@realAsma realAsma enabled auto-merge (squash) December 19, 2025 19:47
@realAsma realAsma requested a review from a team as a code owner December 20, 2025 01:44
…/modelopt-r-150!2)

Added tests, minor changes

Signed-off-by: realAsma <[email protected]>

minor

Signed-off-by: realAsma <[email protected]>

minor

Signed-off-by: realAsma <[email protected]>

cleaned up implementation

Signed-off-by: realAsma <[email protected]>

more clean ups

Signed-off-by: realAsma <[email protected]>

addressed reviewer comments

minor

Signed-off-by: realAsma <[email protected]>

rank 0 only warning

minor

Signed-off-by: realAsma <[email protected]>
Signed-off-by: realAsma <[email protected]>
@realAsma realAsma force-pushed the asma/support_for_private_backends branch from 803f9b0 to cdbb918 Compare December 20, 2025 02:55
@realAsma realAsma requested a review from a team December 20, 2025 02:56
@realAsma realAsma merged commit cb34335 into main Dec 20, 2025
35 checks passed
@realAsma realAsma deleted the asma/support_for_private_backends branch December 20, 2025 04:17
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.

7 participants