Skip to content

dual exponent - #605

Merged
mcabbott merged 2 commits into
JuliaDiff:masterfrom
ptiede:pt-exponent
Nov 11, 2022
Merged

dual exponent#605
mcabbott merged 2 commits into
JuliaDiff:masterfrom
ptiede:pt-exponent

Conversation

@ptiede

Copy link
Copy Markdown
Contributor

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.

@ptiedeptiede changed the title Pt exponentdual exponentNov 11, 2022

@mcabbottmcabbott left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
ContributorAuthor

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

@mcabbott
mcabbott merged commit 80b9d5d into JuliaDiff:masterNov 11, 2022
@ptiede
ptiede deleted the pt-exponent branch November 11, 2022 13:35
@devmotiondevmotion 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 <ptiede91@gmail.com>
Sign up for freeto 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

@ptiede@mcabbott