Commit 580c3d3
Integrate Automated QDQ placement tool - part 2.1 (#844)
## What does this PR do?
This PR implements RegionPattern class. RegionPattern describes local
topology structure of a Region. Regions with same Pattern could be
autotune together. Best insertion points of a given pattern could also
be saved to accelerate the next QDQ autotuning.
**Overview:** ?
## Usage
```python
python -m modelopt.onnx.quantization.autotune.region_search --model model.onnx --verbose
```
```
├─ Region 212 (Level 0, Type: COMPOSITE)
│ ├─ Direct nodes: 0
│ ├─ Total nodes (recursive): 9
│ ├─ Children: 1
│ ├─ Inputs: 3 tensors
│ │ - xxx
│ │ - xxx
│ │ - xxx
│ └─ Outputs: 1 tensors
│ - xxx
│
│ Child regions:
│
├─ Region 209 (Level 2, Type: LEAF)
│ ├─ Direct nodes: 9
│ ├─ Total nodes (recursive): 9
│ ├─ Children: 0
│ ├─ Inputs: 11 tensors
│ │ - xxx
```
## Testing
<!-- Mention how have you tested your change if applicable. -->
## Before your PR is "*Ready for review*"
<!-- If you haven't finished some of the above items you can still open
`Draft` PR. -->
- **Make sure you read and follow [Contributor
guidelines](https://github.com/NVIDIA/Model-Optimizer/blob/main/CONTRIBUTING.md)**
and your commits are signed.
- **Is this change backward compatible?**: Yes
- **Did you write any new necessary tests?**: Yes
- **Did you add or update any necessary documentation?**: No, document
update is in Part 4
- **Did you update
[Changelog](https://github.com/NVIDIA/Model-Optimizer/blob/main/CHANGELOG.rst)?**:
CHANGELOG update could be done after all changes are ready.
## Additional Information
<!-- E.g. related issue. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
## Release Notes
* **New Features**
* Enhanced ONNX quantization analysis with improved region pattern
matching and comparison capabilities.
* Added utility to identify quantized tensors in models for better
analysis.
* **Tests**
* Comprehensive test coverage for region pattern functionality and
quantization utilities.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Signed-off-by: Will Guo <willg@nvidia.com>1 parent e82a677 commit 580c3d3
File tree
4 files changed
+887
-0
lines changed- modelopt/onnx
- quantization
- autotune
- tests/unit/onnx/quantization/autotune
4 files changed
+887
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
0 commit comments