Skip to content

Commit 42e1943

Browse files
committed
[Merge] Merge latest main into libcudf-reuse-prebuilt
Sync the branch with `origin/main` so PR #4885 merges cleanly without a force-push on the open PR. Resolve the `build/buildcpp.sh` conflict: keep the `cudf.reuse.prebuilt` skip-guard around the `libcudfjni` cmake and add the `CMAKE_NETRC` and `CMAKE_NETRC_FILE` flags from main. The merge also adopts the `thirdparty/cudf` pin from main. --------- Signed-off-by: Nghia Truong <nghiat@nvidia.com>
2 parents 873c5fe + 781d7d4 commit 42e1943

19 files changed

Lines changed: 628 additions & 69 deletions

build/buildcpp.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ fi
7373

7474
source "$PROJECT_BUILD_DIR/buildcpp-env.sh"
7575

76+
CMAKE_NETRC=${CMAKE_NETRC:-IGNORED}
77+
CMAKE_NETRC_FILE=${CMAKE_NETRC_FILE:-$HOME/.netrc}
78+
7679
if [[ "$GPU_ARCHS" != "DEPRECATED" ]]; then
7780
CMAKE_CUDA_ARCHITECTURES="$GPU_ARCHS"
7881
echo "==========================================================================================
@@ -288,6 +291,8 @@ else
288291
-DCUDF_JNI_LIBCUDF_STATIC=ON \
289292
-DCUDF_USE_PER_THREAD_DEFAULT_STREAM="$CUDF_USE_PER_THREAD_DEFAULT_STREAM" \
290293
-DCMAKE_CUDA_ARCHITECTURES="$CMAKE_CUDA_ARCHITECTURES" \
294+
-DCMAKE_NETRC="$CMAKE_NETRC" \
295+
-DCMAKE_NETRC_FILE="$CMAKE_NETRC_FILE" \
291296
-DRMM_LOGGING_LEVEL="$RMM_LOGGING_LEVEL" \
292297
-DUSE_GDS="$USE_GDS" \
293298
-C="$CUDF_PIN_PATH/setup.cmake"

ci/Jenkinsfile.premerge

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ git --no-pager diff --name-only HEAD \$BASE -- ${PREMERGE_DOCKERFILE} || true"""
228228
def jniVer = readMavenPom(file: 'pom.xml').version
229229
common.restoreJniCcache(this, jniVer, 'cuda12', 'ART_CREDS')
230230
try {
231-
sh 'source build/env.sh && ${sclCMD} "ci/premerge-build.sh"'
231+
runPremergeBuild()
232232
sh 'bash ci/fuzz-test.sh'
233233
} catch (e) {
234234
common.printJVMCoreDumps(this)
@@ -266,7 +266,7 @@ git --no-pager diff --name-only HEAD \$BASE -- ${PREMERGE_DOCKERFILE} || true"""
266266
def jniVer = readMavenPom(file: 'pom.xml').version
267267
common.restoreJniCcache(this, jniVer, 'cuda13', 'ART_CREDS')
268268
try {
269-
sh 'source build/env.sh && ${sclCMD} "ci/premerge-build.sh"'
269+
runPremergeBuild()
270270
sh 'bash ci/fuzz-test.sh'
271271
} catch (e) {
272272
common.printJVMCoreDumps(this)
@@ -312,6 +312,16 @@ git --no-pager diff --name-only HEAD \$BASE -- ${PREMERGE_DOCKERFILE} || true"""
312312
}
313313
} // end of pipeline
314314

315+
void runPremergeBuild() {
316+
common.prepareArtNetrc(this)
317+
withEnv([
318+
"ARROW_THRIFT_MIRROR_URL=https://${env.ARTIFACTORY_NAME}/artifactory/sw-spark-maven/apache-remote",
319+
"CMAKE_NETRC=OPTIONAL",
320+
]) {
321+
sh 'source build/env.sh && ${sclCMD} "ci/premerge-build.sh"'
322+
}
323+
}
324+
315325
void uploadDocker(String IMAGE_NAME) {
316326
def DOCKER_CMD = "docker --config $WORKSPACE/.docker"
317327
retry(3) {
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/java/src/main/java/ai/rapids/cudf/NativeDepsLoader.java b/java/src/main/java/ai/rapids/cudf/NativeDepsLoader.java
2+
index 0ab9ec79d1..3d42449128 100755
3+
--- a/java/src/main/java/ai/rapids/cudf/NativeDepsLoader.java
4+
+++ b/java/src/main/java/ai/rapids/cudf/NativeDepsLoader.java
5+
@@ -69,9 +69,6 @@ public class NativeDepsLoader {
6+
* subsequent stages are loaded.
7+
*/
8+
private static final String[][] loadOrder = new String[][]{
9+
- new String[]{
10+
- "nvcomp"
11+
- },
12+
new String[]{
13+
"cudf"
14+
},

patches/noop.patch

Whitespace-only changes.

pom.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -578,14 +578,6 @@
578578
<include>libprofilerjni.so</include>
579579
</includes>
580580
</resource>
581-
<resource>
582-
<directory>${libcudfjni.build.path}</directory>
583-
<includes>
584-
<include>libnvcomp.so</include>
585-
<include>libnvcomp_gdeflate.so</include>
586-
<include>libnvcomp_bitcomp.so</include>
587-
</includes>
588-
</resource>
589581
</resources>
590582
</configuration>
591583
</execution>

src/main/cpp/CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ option(BUILD_TESTS "Configure CMake to build tests" OFF)
6262
option(BUILD_BENCHMARKS "Configure CMake to build (google) benchmarks" OFF)
6363
option(BUILD_FAULTINJ "Configure CMake to build fault injection" ON)
6464
option(BUILD_PROFILER "Configure CMake to build profiler" ON)
65+
option(HIDE_PRIVATE_CUDA_SYMBOLS "Hide private symbols from static CUDA compiler libraries" ON)
6566

6667
message(
6768
VERBOSE "SPARK_RAPIDS_JNI: Build with per-thread default stream:
@@ -70,6 +71,9 @@ message(
7071
message(VERBOSE "SPARK_RAPIDS_JNI: Configure CMake to build tests: ${BUILD_TESTS}")
7172
message(VERBOSE "SPARK_RAPIDS_JNI: Configure CMake to build (nvbench) benchmarks: ${BUILD_BENCHMARKS}")
7273
message(VERBOSE "SPARK_RAPIDS_JNI: Configure CMake to build fault injection: ${BUILD_FAULTINJ}")
74+
message(VERBOSE
75+
"SPARK_RAPIDS_JNI: Hide private static CUDA compiler symbols: ${HIDE_PRIVATE_CUDA_SYMBOLS}"
76+
)
7377

7478
set(SPARK_RAPIDS_JNI_BUILD_TESTS ${BUILD_TESTS})
7579
set(SPARK_RAPIDS_JNI_BUILD_BENCHMARKS ${BUILD_BENCHMARKS})
@@ -349,6 +353,18 @@ target_link_libraries(
349353
${PARQUET_LIB}
350354
${THRIFT_LIB}
351355
)
356+
if(HIDE_PRIVATE_CUDA_SYMBOLS)
357+
# These toolkit implementation symbols are not part of the cuDF or JNI ABI. Localizing them keeps
358+
# the regular ELF symbol table for diagnostics while removing them from the dynamic export table.
359+
target_link_options(
360+
spark_rapids_jni
361+
PRIVATE "LINKER:--exclude-libs,libnvrtc_static.a"
362+
"LINKER:--exclude-libs,libnvrtc-builtins_static.a"
363+
"LINKER:--exclude-libs,libnvptxcompiler_static.a"
364+
"LINKER:--exclude-libs,libnvJitLink_static.a"
365+
"LINKER:--exclude-libs,libnvcomp_static.a"
366+
)
367+
endif()
352368
rapids_cuda_set_runtime(spark_rapids_jni USE_STATIC ON)
353369
set_target_properties(spark_rapids_jni PROPERTIES LINK_LANGUAGE "CXX")
354370
# For backwards-compatibility with the cudf Java bindings and RAPIDS accelerated UDFs,

src/main/cpp/profiler/spark_rapids_profile_converter.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -686,8 +686,12 @@ void convert_to_nvtxt(std::ifstream& in, std::ostream& out, program_options cons
686686
color = it->second->color();
687687
category = it->second->category();
688688
}
689-
marker_start ms{
690-
m->timestamp(), process_id, thread_id, color, category, m->name()->str()};
689+
marker_start ms{m->timestamp(),
690+
process_id,
691+
thread_id,
692+
color,
693+
category,
694+
m->name() ? m->name()->str() : ""};
691695
auto [ignored, inserted] = marker_start_map.insert({m->id(), ms});
692696
if (not inserted) {
693697
std::ostringstream oss;
@@ -970,8 +974,8 @@ int convert_to_nvtxw(std::ifstream& in,
970974
thread_id,
971975
color,
972976
category,
973-
m->name()->str(),
974-
m->domain()->str()};
977+
m->name() ? m->name()->str() : "",
978+
m->domain() ? m->domain()->str() : ""};
975979
auto [ignored, inserted] = marker_start_map.insert({m->id(), ms});
976980
if (not inserted) {
977981
std::ostringstream oss;

src/main/cpp/src/GpuTimeZoneDBJni.cpp

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ JNIEXPORT jlong JNICALL Java_com_nvidia_spark_rapids_jni_GpuTimeZoneDB_convertOr
140140
jlong reader_tz_info_table,
141141
jint reader_tz_initial_offset,
142142
jint reader_tz_raw_offset,
143-
jintArray reader_dst_rule)
143+
jintArray reader_dst_rule,
144+
jboolean writer_reader_rules_differ)
144145
{
145146
JNI_NULL_CHECK(env, input_handle, "input column is null", 0);
146147

@@ -160,7 +161,38 @@ JNIEXPORT jlong JNICALL Java_com_nvidia_spark_rapids_jni_GpuTimeZoneDB_convertOr
160161
auto const reader = spark_rapids_jni::orc_tz_side{
161162
reader_tz_info_tab, reader_tz_initial_offset, reader_tz_raw_offset, reader_dst};
162163
return cudf::jni::release_as_jlong(spark_rapids_jni::convert_orc_writer_reader_timezones(
163-
*input, static_cast<int64_t>(writer_tz_offset_at_orc_2015_base_us), writer, reader));
164+
*input,
165+
static_cast<int64_t>(writer_tz_offset_at_orc_2015_base_us),
166+
writer,
167+
reader,
168+
cudf::get_default_stream(),
169+
cudf::get_current_device_resource_ref(),
170+
writer_reader_rules_differ));
171+
}
172+
JNI_CATCH(env, 0);
173+
}
174+
175+
JNIEXPORT jlong JNICALL Java_com_nvidia_spark_rapids_jni_GpuTimeZoneDB_convertOrcFromUtcWithRules(
176+
JNIEnv* env,
177+
jclass,
178+
jlong input_handle,
179+
jlong reader_tz_info_table,
180+
jint reader_tz_initial_offset,
181+
jint reader_tz_raw_offset,
182+
jintArray reader_dst_rule)
183+
{
184+
JNI_NULL_CHECK(env, input_handle, "input column is null", 0);
185+
186+
JNI_TRY
187+
{
188+
cudf::jni::auto_set_device(env);
189+
auto const input = reinterpret_cast<cudf::column_view const*>(input_handle);
190+
auto const reader_tz_info_tab = reinterpret_cast<cudf::table_view const*>(reader_tz_info_table);
191+
auto const reader_dst = parse_dst_rule(env, reader_dst_rule);
192+
cudf::jni::check_java_exception(env);
193+
auto const reader = spark_rapids_jni::orc_tz_side{
194+
reader_tz_info_tab, reader_tz_initial_offset, reader_tz_raw_offset, reader_dst};
195+
return cudf::jni::release_as_jlong(spark_rapids_jni::convert_orc_from_utc(*input, reader));
164196
}
165197
JNI_CATCH(env, 0);
166198
}

0 commit comments

Comments
 (0)