Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR #19913: [ROCm] Do not use fast approximation for exp and log #20187

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

copybara-service[bot]
Copy link

PR #19913: [ROCm] Do not use fast approximation for exp and log

Imported from GitHub PR #19913

Error started occurring from this commit for exp 6e9eefe (originally introduced here 9b19353#diff-61ab646c9c3b8b0fc5ed1e9a62f535e9df5843adddd071250343f3bec48eacb6) and from this one 53d5338 for log.

Trying to compile following MLIR code:

HloModule module

ENTRY main {
      p0 = bf16[4] parameter(0)
      ROOT exp = bf16[4] exp(p0)
}

would result in:

UNKNOWN: <unknown>:0: error: loc(callsite("wrapped_exponential" at "wrapped_exponential")): failed to legalize operation 'math.exp'
<unknown>:0: note: loc("wrapped_exponential"): called from
<unknown>:0: note: loc(callsite("wrapped_exponential" at "wrapped_exponential")): see current operation: %7 = "math.exp"(%6) <{fastmath = #arith.fastmath<afn>}> : (bf16) -> bf16

Copybara import of the project:

--
616c10b by Milica Makevic [email protected]:

Do not use fast approximation for exp and log for ROCm

--
3fa4914 by Milica Makevic [email protected]:

Add unit test for log and exp lowering on ROCm

Merging this change closes #19913

FUTURE_COPYBARA_INTEGRATE_REVIEW=#19913 from ROCm:fix_exp_log_lowering 3fa4914

Imported from GitHub PR #19913

Error started occurring from this commit for exp 6e9eefe (originally introduced here 9b19353#diff-61ab646c9c3b8b0fc5ed1e9a62f535e9df5843adddd071250343f3bec48eacb6) and from this one 53d5338 for log.

Trying to compile following MLIR code:
```
HloModule module

ENTRY main {
      p0 = bf16[4] parameter(0)
      ROOT exp = bf16[4] exp(p0)
}
```
would result in:
```
UNKNOWN: <unknown>:0: error: loc(callsite("wrapped_exponential" at "wrapped_exponential")): failed to legalize operation 'math.exp'
<unknown>:0: note: loc("wrapped_exponential"): called from
<unknown>:0: note: loc(callsite("wrapped_exponential" at "wrapped_exponential")): see current operation: %7 = "math.exp"(%6) <{fastmath = #arith.fastmath<afn>}> : (bf16) -> bf16
```

Copybara import of the project:

--
616c10b by Milica Makevic <[email protected]>:

Do not use fast approximation for exp and log for ROCm

--
3fa4914 by Milica Makevic <[email protected]>:

Add unit test for log and exp lowering on ROCm

Merging this change closes #19913

COPYBARA_INTEGRATE_REVIEW=#19913 from ROCm:fix_exp_log_lowering 3fa4914
PiperOrigin-RevId: 703035402
@copybara-service copybara-service bot merged commit e9e88e4 into main Dec 5, 2024
@copybara-service copybara-service bot deleted the test_701238261 branch December 5, 2024 10:28
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