-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix unicode normalization sizes_to_offsets calls #23955
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
Changes from all commits
6de29d8
a11dc27
6024e27
4c1db1c
f32af55
518cf4f
f66e19c
dfbaf88
514be6e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- workflow ---'
cat -n .github/workflows/cudf-spark-jni.yaml | sed -n '1,120p'
printf '%s\n' '--- convention files ---'
find /tmp/coderabbit-repo-knowledge/nvidia-cudf-5d380a13 -maxdepth 2 -type f -name '*.md' -print
printf '%s\n' '--- scoped convention headers ---'
for f in /tmp/coderabbit-repo-knowledge/nvidia-cudf-5d380a13/*/*.md; do
printf '%s: ' "$f"
head -1 "$f"
doneRepository: NVIDIA/cudf Length of output: 14208 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- CI conventions ---'
cat /tmp/coderabbit-repo-knowledge/nvidia-cudf-5d380a13/conventions/ci.md
printf '%s\n' '--- repository-wide conventions ---'
cat /tmp/coderabbit-repo-knowledge/nvidia-cudf-5d380a13/conventions/repo-wide.md
printf '%s\n' '--- repository-wide learnings ---'
cat /tmp/coderabbit-repo-knowledge/nvidia-cudf-5d380a13/learnings/repo-wide.mdRepository: NVIDIA/cudf Length of output: 2351 Security Misconfiguration (CWE-829): Inclusion of Functionality from Untrusted Control Sphere Reachability: Internal · Exploitability: Difficult Pin executable workflow dependencies to immutable identities. The container image, 📍 Affects 1 file
🤖 Prompt for AI Agents |
||
| 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 | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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}); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Add tests for both memory-resource paths. The existing normalization stream test exercises the code path but does not verify allocator routing. Add unit tests for As per coding guidelines, add unit tests and unit benchmarks. Also applies to: 820-825 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
|
|
||
| // Fill decomp_table | ||
| auto decomp_table = rmm::device_uvector<uint32_t>(total_decomp_size, stream, mr); | ||
|
|
@@ -817,8 +817,12 @@ std::unique_ptr<cudf::column> 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 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: NVIDIA/cudf
Length of output: 8521
🏁 Script executed:
Repository: NVIDIA/cudf
Length of output: 21172
Register the custom runner label with actionlint.
Add
linux-amd64-cpu8toactionlint.yamlunderrunner-label, or use an accepted label. Otherwise, actionlint fails on.github/workflows/cudf-spark-jni.yaml:33.🧰 Tools
🪛 actionlint (1.7.12)
[error] 33-33: label "linux-amd64-cpu8" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2025-vs2026", "windows-2022", "windows-11-arm", "ubuntu-slim", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "macos-latest", "macos-latest-xlarge", "macos-latest-large", "macos-26-intel", "macos-26-xlarge", "macos-26-large", "macos-26", "macos-15-intel", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xlarge", "macos-14-large", "macos-14", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file
(runner-label)
🤖 Prompt for AI Agents
Sources: Coding guidelines, Linters/SAST tools