Add strict validation for RVC4 quantization overrides - #288
Add strict validation for RVC4 quantization overrides#288rolandocortez wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe RVC4 exporter now supports optional strict quantization-override validation. It checks override names against the effective ONNX model and rejects invalid or ambiguous sources before Qualcomm tooling. ChangesRVC4 quantization validation
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: ⚪ Minimal · up to The PR adds opt-in validation for RVC4 quantization overrides while preserving existing behavior by default; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant User
participant RVC4Exporter
participant EncodingUtilities
participant EffectiveONNXModel
participant QualcommTooling
User->>RVC4Exporter: configure quantization overrides
RVC4Exporter->>EncodingUtilities: parse override source
EncodingUtilities->>EffectiveONNXModel: collect activation and parameter names
EffectiveONNXModel-->>RVC4Exporter: return model namespaces
RVC4Exporter->>RVC4Exporter: validate override names
RVC4Exporter->>QualcommTooling: invoke conversion if validation passes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #288 +/- ##
===========================================
+ Coverage 79.09% 99.04% +19.94%
===========================================
Files 84 85 +1
Lines 6875 7126 +251
===========================================
+ Hits 5438 7058 +1620
+ Misses 1437 68 -1369
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Summary
rvc4.strict_quantization_overridesvalidation, disabled by default.rvc4.encodingsand raw--quantization_overridesarguments.Qualcomm SNPE 2.41 accepts extra activation/parameter entries in quantization overrides without failing, and its
--strictoption does not apply to quantization override name matching. The validation is therefore implemented on the ModelConverter side.Strict matching uses subset semantics: missing encodings are allowed; only provided names that do not exist in the model are rejected.
Testing
18 passed—tests/unit/test_rvc4_encoding_strictness.py3 passed—tests/conversion/test_rvc4_encodings.pySummary by CodeRabbit
New Features
Bug Fixes