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
Add batch matrix-matrix product operation #2349
Comments
Thanks for pointing out these good enhancement including the previous one issue #2331 . Currently we don't have dynamic creations of jni yet; all functions need to be added statically. But it is straightforward. If you want, you can try to add these enhancement in a similar way as in #2332 . Basically it composes of:
./gradlew cleanJNI; \
./gradlew :engines:pytorch:pytorch-jni:clean; \
./gradlew :engines:pytorch:pytorch-native:clean; \
./gradlew :engines:pytorch:pytorch-native:compileJNI; \
\
./gradlew :engines:pytorch:pytorch-jni:clean :engines:pytorch:pytorch-jni:build; \
./gradlew :engines:pytorch:pytorch-engine:clean :engines:pytorch:pytorch-engine:build; (This may be a little slow. Consider the Update2 below instead. ) Update: the above commands have been tested in Linux and MacOS. Also Update2: ./gradlew cleanJNI; \
./gradlew :engines:pytorch:pytorch-jni:clean; \
./gradlew :engines:pytorch:pytorch-native:clean; \
./gradlew :engines:pytorch:pytorch-native:compileJNI; \
\
./gradlew :engines:pytorch:pytorch-jni:clean :engines:pytorch:pytorch-jni:jar; \
./gradlew :engines:pytorch:pytorch-engine:clean :engines:pytorch:pytorch-engine:jar; And then, the next necessary step is to "Rebuild Module Update3: ./gradlew cleanJNI; \
./gradlew :engines:pytorch:pytorch-jni:clean; \
./gradlew :engines:pytorch:pytorch-native:clean; \
./gradlew :engines:pytorch:pytorch-native:compileJNI; \
\
./gradlew :engines:pytorch:pytorch-jni:clean :engines:pytorch:pytorch-jni:build; \
./gradlew :engines:pytorch:pytorch-engine:clean :engines:pytorch:pytorch-engine:build; Here you don't have to finish java docs. Then switch back to the original git branch, where the updates in JNI is still effective. Appendix: ./gradlew :engines:pytorch:pytorch-native:cleanJNI ;\
./gradlew :engines:pytorch:pytorch-native:compileJNI -Pcu11
./gradlew fJ fC checkstyleMain checkstyleTest pmdMain pmdTest ;\
./gradlew verifyJava ;\
./gradlew test You can maybe try this out first and we will assist. |
Hello, i'm trying to test new added function for pytorch. I successfuly compiled native binaries (dlls for windows), but i can't find out how to package them to jar and publish to local maven repo. |
Found cache dir with binaries in user home. |
|
@tipame Sorry I forgot to mention that the |
Description
Hello, there are a lot of functions from torch package not implemented (wrapped) in DJL.
For example batch matrix-matrix product operation: TORCH.BMM
It's looks like it should be wrapped in to NDArrays class.
May be there is some way i can dynamically create jni mapping for required function?
References
https://pytorch.org/docs/stable/generated/torch.bmm.html#torch.bmm
The text was updated successfully, but these errors were encountered: