Skip to content

Conversation

@willg-nv
Copy link

@willg-nv willg-nv commented Dec 17, 2025

What does this PR do?

Type of change: new feature

Overview: This PR integrates an automatical QDQ placment tool into ModelOpt.

This PR is the 1/4 parts of the change, it contains the following changes:

  1. Defines common types: Region, RegionType, Error types
  2. Defines InsertionPoints (the logical localtion to place QDQ pairs), InsertionScheme (a set of insertion points)
  3. Unit tests for new types

Part 1: #701
Part 2: #702
Part 3: #703
Part 4: #704

Usage

        # Region type usage:
        region = Region(region_id=1, level=0, region_type=RegionType.LEAF)
        assert region.get_id() == 1
        assert region.get_level() == 0
        region.add_node(1) # 1 is the index of ONNX graph node
        ...

        point = NodeInputInsertionPoint(node_index=0, input_index=2)
        assert point.node_index == 0 # relative node index in region
        assert point.input_index == 2 # relative input tensor index in specific node
        resolved = point.resolve(region, graph)
        ...

Testing

Implement unit tests, all tests could get passed.

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
  • Did you add or update any necessary documentation?: No, document change will be included in part 4.
  • Did you update Changelog?: No, this could be done when all parts of the change are merged.

Additional Information

@willg-nv willg-nv requested a review from a team as a code owner December 17, 2025 06:18
@willg-nv willg-nv requested a review from gcunhase December 17, 2025 06:18
@copy-pr-bot
Copy link

copy-pr-bot bot commented Dec 17, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Signed-off-by: Will Guo <willg@nvidia.com>
@willg-nv willg-nv force-pushed the dev-willg-integrate-auto-qdq-placement-part1 branch from 9c53783 to f872e70 Compare December 19, 2025 05:32
@willg-nv
Copy link
Author

Hi @gcunhase, could you help me review this PR? thanks!

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.

2 participants