Skip to content

[NupharEP] symbolic_shape_infer improvements#2299

Merged
ke1337 merged 1 commit into
masterfrom
gt/kedeng/sym
Nov 1, 2019
Merged

[NupharEP] symbolic_shape_infer improvements#2299
ke1337 merged 1 commit into
masterfrom
gt/kedeng/sym

Conversation

@ke1337
Copy link
Copy Markdown
Contributor

@ke1337 ke1337 commented Nov 1, 2019

Description: This change is to expand model support for Nuphar EP

  • Improves symbolic shape inference in following ways:
  1. Extend suggested merge to map to literals with --auto_merge. For example, MatMul of ['ax1', 'ax2'] x [128, 256] would now map 'ax2' to 128
  2. Add --int_max option to simplify computations like Min(100000, 'dim') to be 'dim'. This helps ops like Slice to generate correct shape, i.e. start=0, end=Min(100000, dim - 2) on dim. It was previously treated as equal, since sympy cannot determine Min(100000, dim - 2) < dim.
  • Fix a bug in create_shared script on Windows, that AOT dll is not generated because of failure in link, when there are too many obj files
  • Some build warning fixes for NupharEP.

This change improves symbolic shape inference in following ways:
1. Extend suggested merge to map to literals with --auto_merge. For example, MatMul of ['ax1', 'ax2'] x [128, 256] would now map 'ax2' to 128
2. Add --int_max option to simplify computations like Min(100000, 'dim') to be 'dim'. This helps ops like Slice to generate correct shape, i.e. start=0, end=Min(100000, dim - 2) on dim. It was previously treated as equal, since sympy cannot determine Min(100000, dim - 2) < dim.

Besides, the change contains a bug fix for create_shared script on Windows, that AOT dll is not generated because of failure in link, when there are too many obj files. Plus, some build warning fixes for NupharEP.
@ke1337 ke1337 requested a review from a team as a code owner November 1, 2019 16:40
Copy link
Copy Markdown
Contributor

@yangchen-MS yangchen-MS left a comment

Choose a reason for hiding this comment

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

LGTM

@ke1337 ke1337 merged commit 6e65dcf into master Nov 1, 2019
@ke1337 ke1337 deleted the gt/kedeng/sym branch November 1, 2019 18:40
yuslepukhin pushed a commit that referenced this pull request Mar 17, 2026
## Describe your changes
- Update the supported bits to `[2, 4, 8]`

## Checklist before requesting a review
- [x] Add unit tests for this change.
- [x] Make sure all tests can pass.
- [ ] Update documents if necessary.
- [x] Lint and apply fixes to your code by running `lintrunner -a`
- [ ] Is this a user-facing change? If yes, give a description of this
change to be included in the release notes.

## (Optional) Issue link
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