Remove implicit deletion of model files from .load() method
See original GitHub issueIssue
The load() method within PyTorchSklearnContainer container class implicitly deletes the original file location provided to the function class. This implicit deletion is unknown to the callers as well as it has side effects that leads to race condition and blocks concurrency setup for our inference servers in production.
- When running inside docker container, deletion of original model file by load method requires docker container restart in order to load model again. That means humming bird model can be loaded only once within docker container lifecycle .
- We can’t run more than one process for inference server, if we do then one process loads it first and deletes the original model file location thus causing race condition for the 2nd process and onwards.
Desired Behavior
The load() method inside PyTorchSklearnContainer class (as well as other as the issue is applicable for all classes) should not delete the original model file location that is supplied by the caller and thus allow multiple time loading as well as running more than one process for inference server.
Environment We are running the inference using a Gunicorn server in front of python app that loads the hummingbird model. The app is containerized as docker image and deployed in Kubernetes Cluster where each pod runs two Gunicorn worker processes to handle concurrency.
Installed Version
hummingbird-ml==0.4.1
torch==1.5.1
Please let me know if you need more information. Thanks.
Regards, Akshay Jain
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (4 by maintainers)

Top Related StackOverflow Question
Sounds good, I am on it.
Closed with #558 thank you!