You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have multiple engines on your classpath, DJL will evaluate them in order given by classloader's listing of "native/lib/" + engine + ".properties" resources. The first acceptable engine is selected. The ClassLoader's resource listing is documented as "the ordering is not specified and may be very unpredictable"
This would be OK-ish, except the evaluation accepts a CPU engine even if the current system is CUDA capable. So if you have both, and the system is CUDA capable, you might or might not get CUDA from run to run.
Expected Behavior
If current platform is CUDA, find CUDA engine. Only if it's missing, use CPU engine.
In general, perhaps forcing the order to anything consistent might be a good idea.
I realise most systems will not have a random combination of engines, but in our case we distribute with CPU engine and drop CUDA engine as a plugin, and that's what we end up with.
The text was updated successfully, but these errors were encountered:
syskin345
changed the title
When there are multiple engines on the classpath, DJL will randomly select the wrong one
When there are multiple engines on the classpath, DJL might randomly select a non-optimal one
Jul 3, 2024
frankfliu
added a commit
to frankfliu/djl
that referenced
this issue
Jul 4, 2024
Description
See
Platform::detectPlatform()
method.If you have multiple engines on your classpath, DJL will evaluate them in order given by classloader's listing of
"native/lib/" + engine + ".properties"
resources. The first acceptable engine is selected. The ClassLoader's resource listing is documented as "the ordering is not specified and may be very unpredictable"This would be OK-ish, except the evaluation accepts a CPU engine even if the current system is CUDA capable. So if you have both, and the system is CUDA capable, you might or might not get CUDA from run to run.
Expected Behavior
If current platform is CUDA, find CUDA engine. Only if it's missing, use CPU engine.
In general, perhaps forcing the order to anything consistent might be a good idea.
I realise most systems will not have a random combination of engines, but in our case we distribute with CPU engine and drop CUDA engine as a plugin, and that's what we end up with.
The text was updated successfully, but these errors were encountered: