Skip to content

[15/17] DLA TopK and dtype compatibility - #2967

Draft
mgohil-png wants to merge 1 commit into
dla/review-14-dla-boolean-and-comparison-rewritesfrom
dla/review-15-dla-topk-and-dtype-compatibility
Draft

mgohil-png wants to merge 1 commit into
dla/review-14-dla-boolean-and-comparison-rewritesfrom
dla/review-15-dla-topk-and-dtype-compatibility

Conversation

@mgohil-png

@mgohil-png mgohil-png commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Type of change: new feature

Simplify the supported TopK/Cast/Reshape/Tile/GatherElements chain, handle eligible integer Unsqueeze inputs, and provide standalone InstanceNormalization channel-layout compatibility. Preserve unsupported/shared patterns and register the ordered TopK and Unsqueeze stages.

Part 15/17. Depends on part 14; merge from the bottom of the stack upward.

Usage

from modelopt.onnx.graph_surgery.dla_transforms.dla_topk import _apply_topk

# model is an onnx.ModelProto with the supported input pattern.
model = _apply_topk(model)

This is an internal pass; the public pipeline is registered in part 16.

Testing

  • Validated on this branch's current commit on Windows CPU with Python 3.10 and ONNX 1.21.0: 7 passed, 1 warning.
  • TopK pattern matching and outputs, shared/unsupported patterns, and InstanceNormalization layout behavior.
  • Repository pre-commit hooks passed for this slice; the commit is signed off and its SSH signature was verified.
python -m pytest tests/unit/onnx/graph_surgery/dla_transforms/test_dla_fix_instancenorm_channel_mismatch.py tests/unit/onnx/graph_surgery/dla_transforms/test_dla_topk.py --noconftest -o addopts= -q --tb=short --durations=5

Tests ran with Hugging Face offline mode and without the repository-wide conftest/addopts; test-module fixtures still ran. GPU execution and DLA compilation were not run. The final stacked branch also passed the combined focused suite: 317 passed, 2 warnings.

Before your PR is "Ready for review"

  • Backward compatible: yes; this slice adds DLA-specific functionality.
  • Third-party code/new runtime dependencies: no new runtime dependency; contribution and security guidance reviewed.
  • Necessary tests: included for this slice, with focused synthetic fixtures.
  • Changelog: public feature entry follows in part 16.
  • Claude approval: pending for the current commit. Submitted as a draft.

Additional Information

Base branch: dla/review-14-dla-boolean-and-comparison-rewrites. Review this slice against that branch; subsequent slices are reviewed separately.

Merge order: PR1 (merged) → Part 2/17 → Part 3/17 → Part 4/17 → Part 5/17 → Part 6/17 → Part 7/17 → Part 8/17 → Part 9/17 → Part 10/17 → Part 11/17 → Part 12/17 → Part 13/17 → Part 14/17 → Part 15/17 → Part 16/17 → Part 17/17

@copy-pr-bot

copy-pr-bot Bot commented Oct 23, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@mgohil-png

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

@mgohil-png
mgohil-png force-pushed the dla/review-15-dla-topk-and-dtype-compatibility branch from 7af9e1c to 6489713 Compare October 23, 2026 08:49
@mgohil-png
mgohil-png force-pushed the dla/review-15-dla-topk-and-dtype-compatibility branch from 6489713 to c12468f Compare October 23, 2026 08:54
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://NVIDIA.github.io/Model-Optimizer/pr-preview/pr-2967/

Built to branch gh-pages at 2026-10-23 17:34 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@mgohil-png
mgohil-png force-pushed the dla/review-15-dla-topk-and-dtype-compatibility branch from c12468f to 9c80569 Compare October 23, 2026 10:18
@mgohil-png
mgohil-png force-pushed the dla/review-15-dla-topk-and-dtype-compatibility branch from 9c80569 to 378715f Compare October 23, 2026 10:32
@mgohil-png
mgohil-png force-pushed the dla/review-15-dla-topk-and-dtype-compatibility branch 2 times, most recently from b4069b8 to 9857bcb Compare October 23, 2026 11:46
@mgohil-png
mgohil-png force-pushed the dla/review-15-dla-topk-and-dtype-compatibility branch from 9857bcb to 752dac1 Compare October 23, 2026 12:10
@mgohil-png
mgohil-png force-pushed the dla/review-15-dla-topk-and-dtype-compatibility branch from 752dac1 to d56d4d3 Compare October 23, 2026 12:28
@mgohil-png
mgohil-png force-pushed the dla/review-15-dla-topk-and-dtype-compatibility branch from d56d4d3 to 3cdcc10 Compare October 23, 2026 12:42
@mgohil-png
mgohil-png force-pushed the dla/review-15-dla-topk-and-dtype-compatibility branch 2 times, most recently from 5903522 to e3d424c Compare October 23, 2026 13:22
@mgohil-png
mgohil-png force-pushed the dla/review-15-dla-topk-and-dtype-compatibility branch from e3d424c to 221de94 Compare October 23, 2026 13:42
@mgohil-png
mgohil-png force-pushed the dla/review-15-dla-topk-and-dtype-compatibility branch 2 times, most recently from 1300d38 to 7ec0e18 Compare October 23, 2026 15:04
@mgohil-png
mgohil-png force-pushed the dla/review-15-dla-topk-and-dtype-compatibility branch from 7ec0e18 to 82885c5 Compare October 23, 2026 15:22
@mgohil-png
mgohil-png force-pushed the dla/review-15-dla-topk-and-dtype-compatibility branch from 82885c5 to 8ac0ba5 Compare October 23, 2026 15:39
@mgohil-png
mgohil-png force-pushed the dla/review-15-dla-topk-and-dtype-compatibility branch from 8ac0ba5 to da7137c Compare October 23, 2026 16:49
@mgohil-png
mgohil-png force-pushed the dla/review-15-dla-topk-and-dtype-compatibility branch from da7137c to 451cb98 Compare October 23, 2026 17:06
Signed-off-by: mgohil <mgohil@nvidia.com>
@mgohil-png
mgohil-png force-pushed the dla/review-15-dla-topk-and-dtype-compatibility branch from 451cb98 to c11fc95 Compare October 23, 2026 17:25

This branch has not been deployed

No deployments
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.

1 participant