support OpenCL backend#55
Conversation
|
Thanks!
|
Sure, I can add some tests using PoCL. Are you fine with removing the
Just above, the logic is: if restart_stats.restart_from_avg
sol_cand = sol_avg
else
sol_cand = sol
endso iff |
1453099 to
23a6c44
Compare
|
I had to disable |
|
Perhaps we could just temporarily slap an |
|
OK, I now added the |
|
The buildkite failure is a red herring (any idea why it happens?). |
|
Hangs should hopefully be fixed by JuliaGPU/GPUCompiler.jl#830 |
86a1b1d to
257764b
Compare
|
You can merge from |
This causes problems when running with the OpenCL backend where aliased memcopies throw an error. According to the docstring of `copy!`: > Behavior can be unexpected when any mutated argument shares memory with any other argument. so this should probably be avoided. (This doesn't fully fix CoolPDLP.jl on OpenCL.jl, since `adapt(OpenCLBackend(), arr)` is not type stable, so the `@stable` annotation would need to be removed for `perform_conversion`)
257764b to
6a5a14d
Compare
gdalle
left a comment
There was a problem hiding this comment.
Thanks! I gave it some further thought and I don't think it's worth making so many functions @unstable just to accommodate one (rather seldom used) backend. A better option would be to deactivate DispatchDoctor for the OpenCL tests specifically, using e.g. https://github.com/MilesCranmer/DispatchDoctor.jl#-options. What do you think?
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 14 files with indirect coverage changes 🚀 New features to boost your workflow:
|
I must admit that I am not a big fan of the DispatchDoctor approach in general, since you are trying to make type stability guarantees for generic methods that then end up calling arbitrary code you have no control over and which might have good reasons to not be type stable in all instances. As I said above, I tend to prefer testing method on the exact type signatures that you want to be type stable with JET, which is more manual, but it doesn't break the flexibility multiple dispatch and a dynamic type system gives you in the same way DispatchDoctor does. That said, this is not my package and this is just my personal opinion, so I am fine going with your proposal for now of disabling DispatchDoctor for the OpenCL tests specifically |
This reverts commit 0909160.
|
DispatchDoctor is much easier for developers than JET, which frequently breaks or is overly sensitive and requires manual testing for each function. Let's keep it that way for the time being. Note that, like our OpenCL test suite, downstream users can also disable DispatchDoctor specifically for CoolPDLP if they have purposefully type-unstable routines. |
|
OK, I have implemented those changes, does this look good to you? |
Copying memory to itself causes problems when running with the OpenCL backend where aliased memcopies throw an error. According to the docstring of
copy!:so this should probably be avoided.
(This doesn't fully fix CoolPDLP.jl on OpenCL.jl, since
Implementedadapt(OpenCLBackend(), arr)is not type stable, so the@stableannotation would need to be removed for
perform_conversion)