-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
model cache not always keeping models loaded #227
Comments
With extra logging, including PID and thread ID, there is no indication that the code is removing items from the cache:
However, watching the startup sequence with PID/TID in the logs does indicate that the cache was created on the main thread, not the worker:
That does not fully explain the inner list reverting to 0 items, but suggests some multiprocessing bug. |
Creating a cache within the worker process does not seem to make a difference, but I was able to confirm that the cache itself is being replaced by including a few
|
Adding a
Adding a reference to the cache in the pre-job logs is not helping either:
|
This is fixed for now, by making the cache's internal storage global within each process. That's not elegant, but it prevents the cache from being garbage collected, since I was not able to find the cause of that collection. |
Something is causing models to be unloaded from the cache between requests, which kind of defeats the point of caching models in-memory in the first place. I've walked through the code in the debugger and added some logging to the cache
.set
and.drop
methods, with no luck so far.Caching models between jobs on the same device provides a pretty substantial speedup, since the models take 5-10 seconds to load and optimize.
The text was updated successfully, but these errors were encountered: