Skip to content

Conversation

@zjgarvey
Copy link
Collaborator

Pure floating point pow operations no-longer support negative base values (see llvm/llvm-project#126338), but many models coming from ONNX use floating point representations of integers as the exponent.

This change:

  1. matches on constant rank-0 exponents and converts them to scalar constants.
  2. matches on constant floating-point scalar exponents and converts them to ints if possible.
  3. lowers Tensor(float)^int cases to math.fpowi

Addresses some remaining test failures related to iree-org/iree#19996.

Copy link
Contributor

@praveen-g-ctt praveen-g-ctt left a comment

Choose a reason for hiding this comment

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

LGTM

@zjgarvey zjgarvey merged commit fe5abf0 into llvm:main Feb 19, 2025
3 checks passed
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