-
Notifications
You must be signed in to change notification settings - Fork 500
[WIP] 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) |
okay, all tests pass now. After this PR is merged, I will make a follow-up PR, where I complete the cujava runtime package. I will (hopefully) complete that PR either tomorrow or on Saturday. |
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. In this PR I’ve focused on the runtime and laid the foundation for the remaining modules.
Project structure
src/main/java/org.apache.sysds/cujava:
cujava/
├─ cublas/
├─ cudnn/
├─ cusolver/
├─ cusparse/
├─ driver/
├─ interop/
└─ runtime/
----├─ CudaDeviceProp
----├─ CudaError
----├─ CudaMemcpyKind
----└─ CuJava
CudaDataType
CudaException
CuJavaLibLoader
NativePointerObject
Pointer
Sizeof
Each directory contains the corresponding Java-side implementation. So far, I have focused on the runtime package.
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
. In this PR I implemented the initial parts of runtime and common; the rest will follow in the next PRs.Example usage
Writing code with cuJava is reminiscent of JCuda—only the imports change:
import org.apache.sysds.cujava.runtime.CuJava;
CuJava.cudaMalloc(...);
Notes
@mboehm7