EnzymeAD / EnzymeAD/Reactant.jl

`Ops.cbrt` crashes for complex number but spec says it supports them

Open
#291 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
370
Forks
74
Avg merge
18h 47m
Merged PRs (30d)
30

Description

The test is the following:

```julia
x = ConcreteRArray([1.0 + 2.0im, 8.0 + 16.0im, 27.0 + 54.0im, 64.0 + 128.0im])
@test Array(x) .^ (1//3) ≈ @jit Ops.cbrt(x)
```

and yields the following error: https://github.com/EnzymeAD/Reactant.jl/actions/runs/11915696798/job/33206565483?pr=267#step:9:812

```
terminate called after throwing an instance of 'xla::XlaRuntimeError'
what(): UNKNOWN: :0: error: Expected element type in shape to be floating for cbrt operation; got C128.:
:0: note: see current operation: "func.return"(%0) : (tensor<4xcomplex>) -> ()
```

The [StableHLO spec](https://openxla.org/stablehlo/spec#cbrt) says it supports complex numbers
![Image](https://github.com/user-attachments/assets/161a21b0-c591-4b34-8591-1799a2323294)

@wsmoses should we raise this to XLA repo?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.