-
Notifications
You must be signed in to change notification settings - Fork 508
[SYSTEMDS-??] cujava: Custom java-cuda bindings for SystemDS #2311
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2311 +/- ##
============================================
- Coverage 72.54% 72.44% -0.11%
- Complexity 46621 46629 +8
============================================
Files 1492 1509 +17
Lines 176098 176368 +270
Branches 34587 34589 +2
============================================
+ Hits 127742 127761 +19
- Misses 38701 38959 +258
+ Partials 9655 9648 -7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
The errors resulted from a mistake in the javadoc. Apparently, one cant use |
|
The two failing tests are unrelated to my changes. The first failing check stems from the federated backend and the second is in the python layer of SystemDS. cujava touches neither of them and is in fact isolated from the rest of the codebase. I guess this is likely a CI/CD issue ? |
|
yes, there are some flaky tests as well as timeouts. I just kicked these failed jobs off again (which you can also do by going to the failed jobs and hit the button re-run failed jobs) |
This PR starts the implementation of custom Java–CUDA bindings for SystemDS, called cujava. The long-term goal is to replace JCuda altogether. The project is split into a Java layer and a C++/JNI layer.
Project structure
src/main/java/org.apache.sysds/cujava:cujava/
├─ cublas/
├─ cudnn/
├─ cusolver/
├─ cusparse/
├─ driver/
├─ interop/
└─ runtime/
CudaDataType
CudaException
CuJavaLibLoader
NativePointerObject
Pointer
Sizeof
Each directory contains the corresponding Java-side implementation.
src/main/cpp/jni:jni/
├─ common/
├─ cublas/
├─ cudnn/
├─ cusolver/
├─ cusparse/
├─ driver/
└─ runtime/
build_cujava_libs.sh
CMakeLists.txt
These directories hold the C++/JNI implementations that mirror the Java side. Each directory has its own CMakeLists.txt to produce a dedicated shared library. The libraries are emitted under
src/main/cpp/lib.I completed the runtime, driver, cusparse, and cublas packages (java + cpp). The cusolver and cudnn remain for future work.
Example usage
Writing code with cuJava is reminiscent of JCuda—only the imports change:
import org.apache.sysds.cujava.runtime.CuJava;CuJava.cudaMalloc(...);Notes
.sofiles). I don’t have a Windows machine, so Windows builds are omitted for now. It should be straightforward to adapt theCMakeListsandCuJavaLibLoader.javato support Windows and emit.dllfiles as well.@mboehm7