[FEA] Inclusion of `libcuvs.so` in `cuvs-java*jar`
Nobody has claimed this yet.
- Dominant language
- Cuda
- Stars
- 854
- Forks
- 236
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 62
Description
Requirement
We should evaluate the viability of including the libcuvs.so library as part of the cuvs-java*jar. My contention is that this will make released artifacts easier to deploy, thus improving the end-user experience.
Background
As things currently stand in the 25.06 release, the cuvs-java*jar includes a libcuvs_java.so, containing some legacy shim code to insulating the Java layer from API changes in libcuvs.so. There are currently discussion regarding the removal of this library, but that's another kettle of fish.
The current deployment model involves shipping the cuvs-java.jar via Maven, and resolving its native dependency on libcuvs via conda/mamba. The snag here is that if the user updates their Maven dependency (to say 25.08) and neglects to update conda/mamba in lockstep, they run the risk of incompatible binaries.
By packaging the native libs with the jar artifact, such botched deployments can be avoided.
This method is currently used in the https://github.com/NVIDIA/spark-rapids-jni/ project, for libcudf symbols.
Advantages
- Ease of deployment: The jar only need be dropped into the classpath of the user's program.
- Better foolproofing: With a self-contained jar, the risk of a botched update is reduced.
- Debuggability: The active
libcuvslibrary is deterministic, and need not be guessed at.
Risks
- Library size: Including
libcuvs.sowill increase the jar artifact size.
a. Building for compute-capability=75 yields a 200MB .so.
b. Maven Central likely has limits on artifact size.
c. Mitigation: Work is underway to reduce the library size already, with explicit template instantiations, etc. Also, the library will be compressed when included in the jar. - Possibility of flagging by antivirus tools:
a. Jar artifacts containing native code might be flagged by enterprise security tools.
b. Mitigation: TBD.
c. FWIW,spark-rapids-jnijars are yet to face being flagged. - Multi-platform releases:
a. If the jars do not contain native code, it might be viable to have a single jar for all platforms (x86-64, aarch64, etc.). Inclusion of native code will make that option unviable.
b. My contention is that we're likely to need separate Java artifacts for x86-64 and aarch64 anyway.
c. Mitigation: This isn't lost functionality yet. AFAICT, there hasn't been acuvs-javarelease that hasn't included native code.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing how the cuvs-java*jar currently packages libcuvs_java.so and resolves libcuvs through conda/mamba. Compare that deployment model with the spark-rapids-jni approach mentioned in the issue, then document whether bundling libcuvs.so is viable given artifact size, platform, and security concerns.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system, release
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100