diff --git a/.github/workflows/cudf-spark-jni.yaml b/.github/workflows/cudf-spark-jni.yaml new file mode 100644 index 000000000000..58fd55ec23b2 --- /dev/null +++ b/.github/workflows/cudf-spark-jni.yaml @@ -0,0 +1,93 @@ +name: cudf-spark-jni + +on: + workflow_dispatch: + inputs: + cudf_repository: &cudf_repository + description: 'cuDF repository' + type: string + required: false + default: 'NVIDIA/cudf' + cudf_commit: &cudf_commit + description: 'cuDF commit SHA or branch' + type: string + required: false + cudf_spark_jni_repository: &cudf_spark_jni_repository + description: 'cudf-spark-jni repository' + type: string + required: false + default: 'NVIDIA/cudf-spark-jni' + cudf_spark_jni_commit: &cudf_spark_jni_commit + description: 'cudf-spark-jni commit SHA or branch; defaults to cuDF RAPIDS_BRANCH' + type: string + required: false + workflow_call: + inputs: + cudf_repository: *cudf_repository + cudf_commit: *cudf_commit + cudf_spark_jni_repository: *cudf_spark_jni_repository + cudf_spark_jni_commit: *cudf_spark_jni_commit + +jobs: + cudf-spark-jni-build: + runs-on: linux-amd64-cpu8 + container: + image: rapidsai/ci-spark-rapids-jni:rockylinux8-cuda12.9.1 + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false + repository: ${{ inputs.cudf_repository }} + ref: ${{ inputs.cudf_commit }} + path: cudf-local + - id: rapids-branch + if: inputs.cudf_spark_jni_commit == '' + run: echo "branch=$(cat cudf-local/RAPIDS_BRANCH)" >> "$GITHUB_OUTPUT" + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false + repository: ${{ inputs.cudf_spark_jni_repository }} + submodules: recursive + ref: ${{ inputs.cudf_spark_jni_commit || steps.rapids-branch.outputs.branch }} + path: cudf-spark-jni + - name: Use selected cuDF checkout + run: | + rm -rf cudf-spark-jni/thirdparty/cudf + mv cudf-local cudf-spark-jni/thirdparty/cudf + - name: Install gha-tools + run: | + dnf -y install jq + wget https://github.com/rapidsai/gha-tools/releases/latest/download/tools.tar.gz -O - | tar -xz -C /usr/local/bin + - uses: aws-actions/configure-aws-credentials@517a711dbcd0e402f90c77e7e2f81e849156e31d # v6.2.2 + with: + role-to-assume: ${{ vars.AWS_ROLE_ARN }} + aws-region: ${{ vars.AWS_REGION }} + role-duration-seconds: 43200 # 12h + - name: Setup sccache-dist + uses: rapidsai/shared-actions/setup-sccache-dist@main + env: + AWS_REGION: "${{ env.AWS_REGION }}" + AWS_ACCESS_KEY_ID: "${{ env.AWS_ACCESS_KEY_ID }}" + AWS_SECRET_ACCESS_KEY: "${{ env.AWS_SECRET_ACCESS_KEY }}" + - name: "Build cudf-spark-jni" + env: + SCCACHE_S3_KEY_PREFIX: cudf-spark-jni + SCCACHE_S3_PREPROCESSOR_CACHE_KEY_PREFIX: cudf-spark-jni/preprocessor + SCCACHE_S3_USE_PREPROCESSOR_CACHE_MODE: true + working-directory: cudf-spark-jni + run: | + set -euo pipefail + + rapids-install-sccache + rapids-configure-sccache + + # Don't use the build cluster for CMake's compiler tests + echo -e '\nset(ENV{SCCACHE_NO_DIST_COMPILE} "1")' >> thirdparty/cudf-pins/add_dependency_pins.cmake + + mkdir target + source build/env.sh && CMAKE_CUDA_ARCHITECTURES=75 LIBCUDF_DEPENDENCY_MODE=latest USE_GDS=on ${sclCMD} build/buildcpp.sh + + sccache --show-stats diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 4a04a2395836..02277a786cd3 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -319,7 +319,7 @@ jobs: uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@main with: enable_check_generated_files: false - ignored_pr_jobs: "telemetry-summarize spark-rapids-jni cuml-compat-tests" + ignored_pr_jobs: "telemetry-summarize cudf-spark-jni cuml-compat-tests" conda-cpp-build: needs: [build-details, checks] permissions: @@ -949,7 +949,7 @@ jobs: node_type: "gpu-rtxpro6000-latest-1" container_image: "rapidsai/ci-conda:26.10-latest" script: ci/test_narwhals.sh - spark-rapids-jni: + cudf-spark-jni: needs: changed-files permissions: actions: read @@ -957,8 +957,10 @@ jobs: id-token: write packages: read pull-requests: read - uses: ./.github/workflows/spark-rapids-jni.yaml + uses: ./.github/workflows/cudf-spark-jni.yaml if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_java + with: + cudf_commit: ${{ github.sha }} telemetry-summarize: # This job must use a self-hosted runner to record telemetry traces. runs-on: linux-amd64-cpu4 diff --git a/.github/workflows/spark-rapids-jni.yaml b/.github/workflows/spark-rapids-jni.yaml deleted file mode 100644 index 7841ab299b8f..000000000000 --- a/.github/workflows/spark-rapids-jni.yaml +++ /dev/null @@ -1,94 +0,0 @@ -name: spark-rapids-jni - -on: - workflow_call: - -jobs: - spark-rapids-jni-build: - runs-on: linux-amd64-cpu8 - container: - image: rapidsai/ci-spark-rapids-jni:rockylinux8-cuda12.9.1 - permissions: - id-token: write - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - with: - persist-credentials: false - repository: NVIDIA/spark-rapids-jni - submodules: recursive - ref: ${{ github.event.pull_request.base.ref }} - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - with: - persist-credentials: false - path: thirdparty/cudf - - uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0 - with: - role-to-assume: ${{ vars.AWS_ROLE_ARN }} - aws-region: ${{ vars.AWS_REGION }} - role-duration-seconds: 43200 # 12h - - name: "Build spark-rapids-jni" - env: - SCCACHE_S3_KEY_PREFIX: spark-rapids-jni - SCCACHE_S3_PREPROCESSOR_CACHE_KEY_PREFIX: spark-rapids-jni/preprocessor - SCCACHE_S3_USE_PREPROCESSOR_CACHE_MODE: true - run: | - set -euo pipefail - - ### - # Setup sccache client - ### - - # Install jq - dnf -y install jq - - # Download gha-tools - wget https://github.com/rapidsai/gha-tools/releases/latest/download/tools.tar.gz -O - | tar -xz -C /usr/local/bin - - # Build cluster endpoint - export SCCACHE_DIST_SCHEDULER_URL="https://$(uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/').linux.sccache.rapids.nvidia.com" - - export SCCACHE_DIST_AUTH_TOKEN="$( - curl -fsSL -H "Authorization: Bearer $( - curl -fsSL -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \ - "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=token.rapids.nvidia.com" \ - | jq -r '.value' - )" https://token.rapids.nvidia.com/gh/token/exchange \ - | jq -r '.token')" - - # Install sccache client - . rapids-install-sccache - - # Configure sccache - . rapids-configure-sccache - - export CPP_PARALLEL_LEVEL="$PARALLEL_LEVEL" - - # Don't use the build cluster for CMake's compiler tests - echo -e '\nset(ENV{SCCACHE_NO_DIST_COMPILE} "1")' >> thirdparty/cudf-pins/add_dependency_pins.cmake - - echo "------------------------" - env | sort - echo "------------------------" - - # Increase the nofile ulimit to build with as much parallelism as possible - ulimit -n $(ulimit -Hn) - - # Start the sccache daemon - sccache --start-server - - # Verify sccache version and distributed compilation - sccache --show-stats - - if sccache --dist-status 2>/dev/null | jq -er '.SchedulerStatus? != null' >/dev/null 2>&1; then - echo "Distributed compilation is available:" - sccache --dist-status | jq -r '["scheduler URL: " + .SchedulerStatus[0], "server count: " + (.SchedulerStatus[1].servers | length | tostring)][]'; - else - echo "Error: Distributed compilation not available, check connectivity" - cat "$SCCACHE_ERROR_LOG"; - exit 1 - fi - - mkdir target - source build/env.sh && CMAKE_CUDA_ARCHITECTURES=90 LIBCUDF_DEPENDENCY_MODE=latest USE_GDS=on ${sclCMD} build/buildcpp.sh - - sccache --show-stats diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4d0b435571fa..314c671e3366 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -328,3 +328,10 @@ jobs: node_type: "gpu-rtxpro6000-latest-1" container_image: "rapidsai/ci-conda:26.10-latest" script: ci/test_narwhals.sh + cudf-spark-jni: + permissions: + contents: read + id-token: write + uses: ./.github/workflows/cudf-spark-jni.yaml + with: + cudf_commit: ${{ inputs.sha }} diff --git a/cpp/src/text/unicode_normalize.cu b/cpp/src/text/unicode_normalize.cu index 7357edc4fdb2..4201e1810313 100644 --- a/cpp/src/text/unicode_normalize.cu +++ b/cpp/src/text/unicode_normalize.cu @@ -384,7 +384,7 @@ unicode_normalizer::unicode_normalizer(cudf::table_view const& unicode_data, // its start offset in the flat decomp_table. The extra sentinel slot at // MAX_CODEPOINT+1 accumulates the total via the scan. auto const total_decomp_size = cudf::detail::sizes_to_offsets( - decomp_offsets.begin(), decomp_offsets.end(), decomp_offsets.begin(), 0, stream); + decomp_offsets.begin(), decomp_offsets.end(), decomp_offsets.begin(), 0, stream, {mr, temp_mr}); // Fill decomp_table auto decomp_table = rmm::device_uvector(total_decomp_size, stream, mr); @@ -817,8 +817,12 @@ std::unique_ptr normalize_unicode(cudf::strings_column_view const& // In-place exclusive scan: out_positions[i] becomes the CP start offset for input byte i. // sizes_to_offsets diverts the last scan value to a device scalar (requiring a sync to // read); write it back to out_positions[chars_size] for the per-string boundary lookup. - auto const total_cps = cudf::detail::sizes_to_offsets( - out_positions.begin(), out_positions.end(), out_positions.begin(), int64_t{0}, stream); + auto const total_cps = cudf::detail::sizes_to_offsets(out_positions.begin(), + out_positions.end(), + out_positions.begin(), + int64_t{0}, + stream, + {mr, temp_mr}); thrust::fill_n(policy, out_positions.begin() + chars_size, 1, total_cps); // Fill packed (cp|ccc) slots at pre-scanned positions