-
Notifications
You must be signed in to change notification settings - Fork 653
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
Cache the PyTorch "files.txt". #1982
Conversation
The cached "files.txt" ensures DJL will still run when the machine is offline, and the native torch jar is not added to the classpath.
I don't think this is necessary. If the cache folder already exist, DJL won't access network to retrieve
Then DJL will directly load cpu version from cache folder. |
The files.txt is also accessed when only the CUDA minor version is "mismatched, for example on a particular machine I have the "detected" flavor = "cu117", which gets matched to "cu116" from the files.txt and I can still run DJL on GPU even in offline mode. |
Ensure the cache directory is present before creating the tempfiles.txt. Close the stream before moving it to files.txt, needed in Windos.
When you create PR, would you please check "Allow edits and access to secrets by maintainers", so that I can push changes to your branch. |
engines/pytorch/pytorch-engine/src/main/java/ai/djl/pytorch/jni/LibUtils.java
Outdated
Show resolved
Hide resolved
engines/pytorch/pytorch-engine/src/main/java/ai/djl/pytorch/jni/LibUtils.java
Outdated
Show resolved
Hide resolved
engines/pytorch/pytorch-engine/src/main/java/ai/djl/pytorch/jni/LibUtils.java
Outdated
Show resolved
Hide resolved
engines/pytorch/pytorch-engine/src/main/java/ai/djl/pytorch/jni/LibUtils.java
Outdated
Show resolved
Hide resolved
engines/pytorch/pytorch-engine/src/main/java/ai/djl/pytorch/jni/LibUtils.java
Outdated
Show resolved
Hide resolved
engines/pytorch/pytorch-engine/src/main/java/ai/djl/pytorch/jni/LibUtils.java
Outdated
Show resolved
Hide resolved
…i/LibUtils.java Co-authored-by: Frank Liu <[email protected]>
…i/LibUtils.java Co-authored-by: Frank Liu <[email protected]>
…i/LibUtils.java Co-authored-by: Frank Liu <[email protected]>
…i/LibUtils.java Co-authored-by: Frank Liu <[email protected]>
…i/LibUtils.java Co-authored-by: Frank Liu <[email protected]>
Change-Id: I6ff0db5a61438300a434dd5bf3aa70c52ebda572
The cached "files.txt" ensures DJL will still run when the machine is offline, and the native torch jar is not added to the classpath.
Description
Projects that run DJL pytorch models might not work if the machine cannot access "https://publish.djl.ai/pytorch/files.txt" when the "detected" platform is a placeholder (for example the native torch jar is not added to the project).