marqo-ai / marqo

Unified embedding generation and search engine. Also available on cloud - cloud.marqo.ai
https://www.marqo.ai/
Apache License 2.0
4.57k stars 188 forks source link

[ENHANCEMENT] Automatically use 'best' available device when none (or an invalid one) is specified #480

Closed OwenPendrighElliott closed 1 year ago

OwenPendrighElliott commented 1 year ago

Is your feature request related to a problem? Please describe. When switching Marqo between devices you currently have to be sure you update every piece of code that specifies a device. This is most problematic in the cloud where nodes can be swapped from CPU to GPU and vice versa easily.

Describe the solution you'd like Similar to how HuggingFace pipelines automatically use a GPU if one is available I'd like Marqo to automatically use the best available device if one is not specified. Additionally, if one is specified but is not available then it should give a warning saying it has defaulted to whichever device was available.

Example Scenarios:

Describe alternatives you've considered While I think both scenarios should be catered for, the first one is the most important.

Additional context If you never specify a device in your code then you should be able to swap between CPU and GPU Marqo setups without having to make any code changes while also getting to use the hardware acceleration when it is available.

vicilliar commented 1 year ago

Implemented. https://github.com/marqo-ai/marqo/pull/508