CogStack / MedCATservice

Running MedCAT as a RESTful web service
17 stars 14 forks source link

support for round robin allocation of cuda cards to workers #36

Closed richardbeare closed 1 year ago

richardbeare commented 1 year ago

A gunicorn post_fork hook has been added to set CUDA_VISIBLE_DEVICES, which sets the device torch will use.

A app level config variable "APP_CUDA_DEVICE_COUNT" is required to indicate how many devices are to be used.

The devices are allocated to the docker in the docker compose configuration.