Attempt to fix AMD 1.10 conj#64
Conversation
|
Your PR no longer requires formatting changes. Thank you for your contribution! |
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
|
Is this something we should report to |
|
I already opened an issue there JuliaGPU/AMDGPU.jl#931 |
|
Should we just wait and see what the verdict is there? In a perfect world this is just fixed upstream and we don't even have to include this :) |
|
Yeah, I don't know how long it's going to take for someone who knows the AMD compiler better than I to take a look, though. |
|
In the meantime people can |
|
Or use Julia 1.11+? |
|
IDK if anyone is stuck on 1.10 for whatever reason 🤷 |
|
This PR is the start of descending into Enzyme style code 🛩️ . |
😭 😭 😭 i just want to help people conjugate their arrays |
| @static if VERSION < v"1.11.0-rc" | ||
| function substitute_ops(ops) | ||
| # work around compiler issue on AMD on 1.10 | ||
| f_conj(x) = real(x) - imag(x) * im |
There was a problem hiding this comment.
This probably creates a new f_conj on every substitute_ops call? Is it not better to have an external _conj(x) = real(x) - imag(x) * im definition, and substitute that?
|
Does normal conjugation of an array work on AMD? It is just ridiculous that this solution works and normal |
Yes, which is crazy.
I'm not happy about it either 🙀 |
|
It helps me mostly by causing CI to pass :/ |
|
I think I would be okay with merging something like this if we could restrict it to be only for AMD, it seems silly to have to deal with this for CUDA? |
|
Yeah I can move it to the AMD extension and we could define a function |
|
Cleaned this up quite a bit and left comments reminding us to get rid of it as soon as we can |
lkdvos
left a comment
There was a problem hiding this comment.
As a small suggestion, how about instead of the type and substitute_op, we define _get_op(x::ROCStridedView) = x.op === conj ? _conj : x.op with a default _get_op(x::StridedView) = x.op? This can then be broadcast in the kernel, which might be easier to read there anyways.
|
Aren't we passing the raw |
|
Anyway, look ok now? Tests seem happy |
checked that 1.11 works with this. Happy for stylistic fixes -- it seems on 1.10 and AMD compilation of
conjdoesn't work but creating a customf_conjdoes, mysterious but ok.