Add parallel native library extraction - #23409
Conversation
Signed-off-by: Gera Shegalov <gshegalov@nvidia.com>
📝 WalkthroughWalkthrough
ChangesNative dependency extraction
Estimated code review effort: 4 (Complex) | ~45 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
"trade a small amount of archive compression for substantially faster startup" can you quantify this? Are you saying the jar is slightly larger? |
In the matched benchmark NVIDIA/cudf-spark#15356 , the conventional archive was 952,504,790 bytes and the chunked archive was 952,587,551 bytes: an increase of 82,761 bytes, or 0.0087%. The corresponding focused JAR creation median improved from 55.07 seconds to 5.47 seconds. |
Signed-off-by: Gera Shegalov <gshegalov@nvidia.com>
|
Is there any potential race issue with this parallel execution model? If so, we may need to pay more attention to the relevant functions that run in parallel. |
I am trying to pay attention, the input chunks and the output ranges within a file do not overlap. "File channels are safe for use by multiple concurrent threads." |
|
/ok to test 2cb0c29 |
|
@gerashegalov: It appears your change has survived this round of Russian roulette. :] CI has passed. |
|
/merge |
Description
Add an internal chunk-manifest resource format for large native libraries and extract those chunks concurrently. The loader:
ai.rapids.cudf.lib-native-dirFileChannelwritesRelated issue: NVIDIA/cudf-spark#15145 identifies synchronous, single-threaded native JAR extraction as a major executor startup cost.
This allows distribution JARs containing 900+ MiB CUDA native libraries to trade a measured 0.0087% increase in archive size for substantially faster startup and JAR creation. NVIDIA/cudf-spark#15356 is the companion producer PR.
Performance
Native extraction
Measured the exact pre-change and PR paths on the same host with JDK 17 and the same 1,504,051,352-byte CUDA12
libcudf.so. Each case ran six extractions in one JVM; the first invocation was treated as warm-up and the remaining five were used for the median.The post-warm-up median improves by 5.72x, reducing extraction latency by 82.5%. The first measured invocation improves by 5.51x. Both paths produced exactly 1,504,051,352 bytes.
Archive size and creation time
Using matched resource trees and forcing the existing
jar:jar@create-parallel-worlds-jarexecution:libcudf.soentryChunking increased the archive by 82,761 bytes (0.0087%) while making focused JAR creation 10.07x faster, a 90.1% wall-time reduction. The full benchmark methodology and measured ranges are in NVIDIA/cudf-spark#15356.
Validation
mvn compiler:compile compiler:testCompilemvn surefire:test -Dtest=NativeDepsLoaderExtractionTest(10 tests)mvn surefire:test@native-deps-loader-test(5 tests)The full native Maven lifecycle was not run locally because the installed CMake is 3.28 and this branch requires CMake 4.0; the Java sources and focused tests were compiled and run directly.
Checklist