EnzymeAD / EnzymeAD/Reactant.jl
Need a mechanism to query whether a particular backend (e.g. CUDA) is actually available in Reactant
- Dominant language
- Julia
- Stars
- 370
- Forks
- 74
- Avg merge
- 18h 47m
- Merged PRs (30d)
- 30
Description
At the moment [we're using in a couple of places](https://github.com/search?q=repo%3AEnzymeAD%2FReactant.jl+cuda.functional&type=code) `CUDA.functional()` to check whether CUDA is available. However that refers to `CUDA.jl` only, using hermetic CUDA builds of XLA (🥲) in Reactant means that that check may disagree with what's actually available in Reactant (notable current cases: CUDA < 12.1 on x86_64-linux, or any CUDA GPU on aarch64-linux). This causes tests to fail on such systems, because for example at https://github.com/EnzymeAD/Reactant.jl/blob/29627dbbd69d65dc6875f9d0b5eae2965cf6a714/test/integration/cuda.jl#L30 Reactant tries to use CUDA capabilities which aren't there.
@mofeing suggested something like
```c++
extern "C" const char* PjRtClientPlatformVersion(PjRtClient* client)
{
auto text = client->platform_version();
char *cstr = (char *)malloc(text.size() + 1);
memcpy(cstr, text.data(), text.size());
cstr[text.size()] = '\0';
return cstr;
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.