question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove implicit deletion of model files from .load() method

See original GitHub issue

Issue 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.

  1. 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 .
  2. 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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
akshjain83commented, Dec 13, 2021

Yes! Please go ahead. We love contributions.

Sounds good, I am on it.

0reactions
ksaurcommented, Dec 14, 2021

Closed with #558 thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

error: use of deleted function - Stack Overflow
The error message clearly says that the default constructor has been deleted implicitly. It even says why: the class contains a non-static, const...
Read more >
File.Delete(String) Method (System.IO) | Microsoft Learn
To obtain the current working directory, see GetCurrentDirectory. If the file to be deleted does not exist, no exception is thrown. For a...
Read more >
3. Data model — Python 3.11.1 documentation
User-defined method objects may be created when getting an attribute of a class (perhaps via an instance of that class), if that attribute...
Read more >
LOAD command - Db2 - IBM
INSERT or INSERTIN and DELETE or DELETEIN privilege on the table when the load utility is invoked in REPLACE mode, TERMINATE mode (to...
Read more >
Models - Django documentation
Models ¶. A model is the single, definitive source of information about your data. It contains the essential fields and behaviors of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found