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

dual exponent #605

Merged
merged 2 commits into from
Nov 11, 2022
Merged

dual exponent #605

merged 2 commits into from
Nov 11, 2022

Conversation

ptiede
Copy link
Contributor

@ptiede ptiede commented Nov 11, 2022

This issue came up in FluxML/Zygote.jl#1324 (comment).

The problem is that on Julia 1.6, the GPU was sensing it could hit a code branch where exponent(::Dual) was being called, and unfortunately, exponent(::Dual) does not exist, so the GPU threw a dynamic call error and gave up. This pull request fixes this.

Solving this problem is pretty easy since exponent: Real --> Int function, so you can take a similar path compared to trunc and define the Dual argument to return the primal value, which I did.

@ptiede ptiede changed the title Pt exponent dual exponent Nov 11, 2022
Copy link
Member

@mcabbott mcabbott left a comment

Choose a reason for hiding this comment

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

Looks good, assuming tests pass

@ptiede
Copy link
Contributor Author

ptiede commented Nov 11, 2022

The tests passed! I think we are good to merge.

@mcabbott mcabbott merged commit 80b9d5d into JuliaDiff:master Nov 11, 2022
@ptiede ptiede deleted the pt-exponent branch November 11, 2022 13:35
@devmotion devmotion mentioned this pull request Dec 3, 2022
mcabbott pushed a commit to mcabbott/ForwardDiff.jl that referenced this pull request Dec 3, 2022
* add exponent(::Dual)

* revert spacing
mcabbott added a commit that referenced this pull request Dec 10, 2022
* dual exponent (#605)

* add exponent(::Dual)

* revert spacing

* tell CI to run on this branch

* version bump

Co-authored-by: Paul Tiede <[email protected]>
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