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

[SR-14240] [AutoDiff] IR / TBD discrepancy when registering pow() derivative #56600

Closed
porterchild opened this issue Feb 16, 2021 · 1 comment
Assignees
Labels
AutoDiff bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@porterchild
Copy link

Previous ID SR-14240
Radar None
Original Reporter @porterchild
Type Bug
Status Resolved
Resolution Done
Environment

Development snapshot Feb 9 2021

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, AutoDiff
Assignee @BradLarson
Priority Medium

md5: 84148fcd9e9e4aecb5610e3ff07a1155

Issue Description:

Registering this derivative for `pow`

@inlinable
@derivative(of: pow)
func powVJP(_ base: Double, _ exponent: Double) -> (value: Double, pullback: (Double) -> (Double, Double)) {
    let output: Double = pow(base, exponent)
    func pullback(_ vector: Double) -> (Double, Double) {
        let baseDerivative = vector * (exponent * pow(base, exponent - 1))
        let exponentDerivative = vector * output * log(base)
        return (baseDerivative, exponentDerivative)
    }

    return (value: output, pullback: pullback)
}

results in the compiler error:

<unknown>:0: error: symbol 'powTJfSSpSr' (powTJfSSpSr) is in generated IR file, but not in TBD file

@BradLarson
Copy link
Collaborator

Resolved by PR #38850.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AutoDiff bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

2 participants