-
Notifications
You must be signed in to change notification settings - Fork 161
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
Store compiled plugins to disk #200
Comments
Storing precompiled extensions in a wheel is a rather complex topic, and would require modifications to the plugin loader of nvdiffrast itself. The code doesn't currently support this. A possible way to create a custom, small docker image would be by installing and compiling nvdiffrast directly in the Dockerfile. That is, base the image on the smaller However, it may be that PyTorch still requires the devel tools to be present even when the compiled plugin is in the cache. If so, you'd have to tweak its internals to bypass those parts. |
I'll try it out thanks, I thought that it built it every single time without a cache, but I might have missed that browsing through the code. I've used the "copy cache to runtime" trick before on Jetson nanos with some other project, compiling was adding a significant overhead and already having all binaries in place made starting everything much much quicker. |
Looking at the internals of PyTorch's |
I'm currently using nvdiffrast in
pytorch/pytorch:2.4.0-cuda12.1-cudnn9-devel
and everything works as expected. I've built a wheel and would like to use it inpytorch/pytorch:2.4.0-cuda12.1-cudnn9-runtime
as it's significantly smaller in image size. The installation of the wheel in the runtime image worked fine.However the _get_plugin() still requires the nvcc compiler and development environment to compile the plugin. Instead of storing it memory, can it be stored in a cache folder as well (or at least give me an option to compile it ahead of time)? Then I can copy the those to the runtime environment and have no need for compilation in my production environment, I really don't like using development environments in production.
The text was updated successfully, but these errors were encountered: