Skip to content

Conversation

@destefy
Copy link
Contributor

@destefy destefy commented Jun 27, 2024

Within the runner class, self.module is kept as a weakref. We do this to be able to delete the uncompiled model form the GPU when we have the compiled model.

However something interesting can happen if a user's compilation script finishes before compilation is completed. The user script will wait until compilation is done. However, if it's been a while since a non-compiled inference call was made, python's garbage collector will see that there are no strong references to self.module, and it will thus delete the object.

So, when compilation does finish and it calls del self.module to delete the uncompiled module, it tries to access something that doesn't exist and throws an error. This PR will prevent this bad access

NOTE: The behaviour of not exiting an inference script because compilation is done is something we want to avoid: see this issue

@destefy destefy self-assigned this Jun 27, 2024
@destefy destefy merged commit cc9b307 into main Jun 27, 2024
@destefy destefy deleted the stefan/deletion-bug-fix branch June 27, 2024 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants