Repository navigation
[cuda.compute] Enable building cuda-compute against CCCL C V2 - #9200
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Walkthroughimportant: This PR extends the CUDA CCCL Python bindings to support a v2 HostJIT backend, adds per-extra code-kind tracking in the C API, introduces a DeviceCode abstraction, routes compilation and JIT paths to produce kind-tagged code, updates bindings and iterators to carry DeviceCode, and updates CI and tests to exercise the v2 path. ChangesCCCL C Parallel v2 HostJIT Integration
Suggested reviewers
Comment |
There was a problem hiding this comment.
Actionable comments posted: 11
🧹 Nitpick comments (19)
c/parallel.v2/src/hostjit/codegen/bitcode.cpp (1)
78-81: 💤 Low valuesuggestion: Silent failure when
write_filefails. Consider logging a warning or returning a failure indicator so callers can detect the issue. Currently the bitcode is silently dropped.c/parallel.v2/src/hostjit/compiler.cpp (1)
274-289: ⚡ Quick winsuggestion: The PTX-version floor logic is duplicated verbatim in
compileDeviceToPTXandcompileToDeviceBitcode. Extract a smallptx_version_for_sm(int)helper so the floor/tier values can't drift between the two paths.diff
+ static int ptx_version_for_sm(int sm_version) + { + // PTX version floor is 7.8 — CUB's instruction selection assumes + // features added in PTX 7.6 (e.g. `bmsk`). + if (sm_version >= 120) return 87; + if (sm_version >= 100) return 85; + if (sm_version >= 90) return 80; + return 78; + }Also applies to: 730-745
python/cuda_cccl/cuda/compute/__init__.py (1)
14-43: 💤 Low valuesuggestion: Import-time environment modification couples module loading to runtime configuration.
The function mutates
os.environduring import, which can complicate test isolation and make behavior dependent on import order. Consider deferring configuration until the first JIT call (lazy init), or document that users should importcuda.computebefore setting custom env vars.Also, the file-presence probes (
is_file()) don't catch permission errors. If a bundled header exists but is unreadable, the env var will be set and the C library will encounter an I/O error later. Low-impact since bundled files are typically readable, but you could wrap in a try/except and skip setting the var onPermissionError.python/cuda_cccl/cuda/compute/_bindings_impl.pyx (2)
389-398: 💤 Low valuesuggestion: Clarify the v1/v2 compatibility guard in
_code_kind.Line 396 uses
_parse_code_type("llvm_ir")as the comparison target rather than a named constant. This works because v1's_parse_code_type(which doesn't know about LLVM_IR) will returnCCCL_OP_LTOIRfor unrecognized strings, but it's non-obvious. Add a comment:# v1 doesn't define CCCL_OP_LLVM_IR; _parse_code_type("llvm_ir") safely # returns CCCL_OP_LTOIR (the default), so this comparison never matches in v1. if t == _parse_code_type("llvm_ir"): return "llvm_ir"
1522-1555: ⚡ Quick winsuggestion:
max_segment_sizeparameter in v2 is silently ignored.Line 1533 accepts
max_segment_size=0for v1 compatibility, but v2's_call_segmented_reduce(pulled from the .pxi) ignores it entirely. A user switching from v1 to v2 who relies on this parameter will get no warning that it's inoperative.Consider adding a runtime check in v2 builds:
if max_segment_size != 0: import warnings warnings.warn( "max_segment_size is not supported in v2 backend and will be ignored", DeprecationWarning, stacklevel=2 )Or document in the docstring that the parameter is v1-only.
python/cuda_cccl/cuda/compute/iterators/_shuffle.py (1)
88-93: 💤 Low valuesuggestion: Parameter name
ltoir=is misleading when passing DeviceCode.Line 92 passes
ltoir=codewherecodeis a DeviceCode object returned bycompile_cpp_op_code. The Op constructor accepts this (duck-typed as DeviceCode-like), but the parameter nameltoirimplies LTO-IR bytes. This naming inconsistency could confuse maintainers.Consider renaming the Op constructor parameter to
code=ordevice_code=in a follow-up refactor, or at minimum document thatltoirnow accepts multiple code formats.python/cuda_cccl/cuda/compute/iterators/_transform.py (1)
133-140: 💤 Low valuesuggestion: Property/parameter naming mismatch creates confusion.
Lines 138-139 pass
ltoir=codeandextra_ltoirs=[child_op.code, *child_op.extra_code]. The Op properties are named.code/.extra_code(returning DeviceCode), but the constructor parameters areltoir=/extra_ltoirs=. This asymmetry makes the code harder to follow.Consider aligning names: either rename the constructor parameters to
code=/extra_code=, or rename the properties to.ltoir/.extra_ltoirs. The former is preferable since "code" is more general.python/cuda_cccl/cuda/compute/_bindings.pyi (1)
107-110: 💤 Low valuesuggestion: Add return type annotation to
codeproperty. Line 108 is missing-> ...while line 110 has-> list. For consistency and type-checker completeness, both should specify return types.python/cuda_cccl/cuda/compute/_jit.py (2)
102-108: 💤 Low valuesuggestion: The regex
r"(?m)^target datalayout =.*\n"assumes the datalayout directive is always a single line starting at column 0. If LLVM IR format evolves (e.g., multi-line directives, inline comments), this could silently fail to strip or over-strip. Consider logging when the substitution matches zero times, which might indicate a format change.
110-114: 💤 Low valuesuggestion:
llvm.parse_assembly(part)can raise parsing errors. Wrap in try/except to provide clearer diagnostic context (e.g., which module chunk failed, first 200 chars of the failing IR) to help debugging when LLVM IR format or codegen changes.python/cuda_cccl/cuda/compute/_cpp_compile.py (1)
100-102: 💤 Low valuesuggestion:
archis part of thelru_cachekey but is ignored on the v2 branch, so distinctarchvalues for identical source produce redundant (identical) cache entries. Harmless, but if you want v2 cache hits to be arch-independent you could droparchfrom the key on that path.c/parallel.v2/test/freestanding/test_cub_device_reduce_explicit_templates.cpp (1)
96-96: 💤 Low valuesuggestion: Hardcoded SM version restricts testing scope.
sm_version = 80forces Ampere architecture. The harness won't verify compilation behavior on sm_70, sm_75, sm_89, sm_90, etc. Consider deriving SM fromcudaGetDeviceProperties()or accepting it via argv/environment to test across architectures.ci/build_cuda_cccl_wheel.sh (1)
19-22: 💤 Low valuesuggestion: Suppress ccache diagnostic errors.
If
ccacheis not in PATH (unlikely but possible after dnf install), lines 20-21 will print errors to the console. Redirect stderr:ccache --version 2>&1 | head -1 || trueandccache --show-stats 2>&1 | head -5 || trueto avoid confusing output if ccache is misconfigured.ci/project_files_and_dependencies.yaml (1)
128-138: 💤 Low valuesuggestion:
python_v2lite-depends on the wholecccl_c_parallel_v2(no public/internal split), so this expensive wheel+GPU job reruns on anyc/parallel.v2/change including its own tests, plus transitively onc2h. The v1pythonproject only depends oncccl_c_parallel_public. Confirm the broader triggering is intended for the experimental path, or split v2 into public/internal to narrow it.c/parallel.v2/src/merge_sort.cu (1)
95-97: 💤 Low valuesuggestion: When
has_itemsis false,d_in_itemsis a null pointer iterator. Accessingd_in_items.value_typemay read uninitialized or garbage data. Consider only assigningitem_typewhenhas_itemsis true, or zero-initialize it otherwise.build_ptr->keys_only = has_items ? 0 : 1; build_ptr->key_type = d_in_keys.value_type; - build_ptr->item_type = d_in_items.value_type; + build_ptr->item_type = has_items ? d_in_items.value_type : cccl_type_info{};c/parallel.v2/src/radix_sort.cu (1)
100-106: suggestion: The original asymmetry concern doesn’t look correctness-critical for hostjit: theCCCL_POINTERcodegen path branches onit.typeand derives the element type fromit.value_type, so carrying overadvance/dereference/size/alignmentfrominput_keys_itwon’t affect emitted iterator code. Brace-initializingoutput_keys_itcan still be kept as a consistency/defensive style improvement.c/parallel.v2/src/three_way_partition.cu (1)
82-86: 💤 Low valuesuggestion: Error message says
_build()but this is_build_ex(). Minor debugging inconvenience.- fprintf(stderr, "\nEXCEPTION in cccl_device_three_way_partition_build(): %s\n", exc.what()); + fprintf(stderr, "\nEXCEPTION in cccl_device_three_way_partition_build_ex(): %s\n", exc.what());c/parallel.v2/src/transform.cu (1)
63-67: 💤 Low valuesuggestion: Error message says
_build()but this is_build_ex(). Same issue at line 109 for binary variant.- fprintf(stderr, "\nEXCEPTION in cccl_device_unary_transform_build(): %s\n", exc.what()); + fprintf(stderr, "\nEXCEPTION in cccl_device_unary_transform_build_ex(): %s\n", exc.what());c/parallel.v2/src/unique_by_key.cu (1)
77-81: 💤 Low valuesuggestion: Error message says
_build()but this is_build_ex().- fprintf(stderr, "\nEXCEPTION in cccl_device_unique_by_key_build(): %s\n", exc.what()); + fprintf(stderr, "\nEXCEPTION in cccl_device_unique_by_key_build_ex(): %s\n", exc.what());
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 4faab5d3-850a-4ab2-9b72-7fcd303494cd
📒 Files selected for processing (146)
.gitignoreCMakeLists.txtCMakePresets.jsonc/CMakeLists.txtc/parallel.v2/CMakeLists.txtc/parallel.v2/include/cccl/c/binary_search.hc/parallel.v2/include/cccl/c/extern_c.hc/parallel.v2/include/cccl/c/for.hc/parallel.v2/include/cccl/c/histogram.hc/parallel.v2/include/cccl/c/merge_sort.hc/parallel.v2/include/cccl/c/radix_sort.hc/parallel.v2/include/cccl/c/reduce.hc/parallel.v2/include/cccl/c/scan.hc/parallel.v2/include/cccl/c/segmented_reduce.hc/parallel.v2/include/cccl/c/segmented_sort.hc/parallel.v2/include/cccl/c/three_way_partition.hc/parallel.v2/include/cccl/c/transform.hc/parallel.v2/include/cccl/c/types.hc/parallel.v2/include/cccl/c/unique_by_key.hc/parallel.v2/src/binary_search.cuc/parallel.v2/src/for.cuc/parallel.v2/src/histogram.cuc/parallel.v2/src/hostjit/CMakeLists.txtc/parallel.v2/src/hostjit/codegen/bitcode.cppc/parallel.v2/src/hostjit/codegen/cub_call.cppc/parallel.v2/src/hostjit/codegen/iterators.cppc/parallel.v2/src/hostjit/codegen/operators.cppc/parallel.v2/src/hostjit/codegen/types.cppc/parallel.v2/src/hostjit/compiler.cppc/parallel.v2/src/hostjit/config.cppc/parallel.v2/src/hostjit/include/hostjit/codegen/bitcode.hppc/parallel.v2/src/hostjit/include/hostjit/codegen/cub_call.hppc/parallel.v2/src/hostjit/include/hostjit/codegen/iterators.hppc/parallel.v2/src/hostjit/include/hostjit/codegen/operators.hppc/parallel.v2/src/hostjit/include/hostjit/codegen/types.hppc/parallel.v2/src/hostjit/include/hostjit/compiler.hppc/parallel.v2/src/hostjit/include/hostjit/config.hppc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/__clang_cuda_device_functions.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/__clang_cuda_libdevice_declares.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/__clang_cuda_math.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/__clang_cuda_runtime_wrapper.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/assert.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/cassertc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/climitsc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/cmathc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/cstddefc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/cstdlibc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/ctype.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/cuda/std/__cstdlib/aligned_alloc.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/initializer_listc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/limitsc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/math.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/memory.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/newc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/stdlib.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/string.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/utilityc/parallel.v2/src/hostjit/include/hostjit/jit_compiler.hppc/parallel.v2/src/hostjit/include/hostjit/loader.hppc/parallel.v2/src/hostjit/jit_compiler.cppc/parallel.v2/src/hostjit/loader.cppc/parallel.v2/src/merge_sort.cuc/parallel.v2/src/radix_sort.cuc/parallel.v2/src/reduce.cuc/parallel.v2/src/scan.cuc/parallel.v2/src/segmented_reduce.cuc/parallel.v2/src/segmented_sort.cuc/parallel.v2/src/three_way_partition.cuc/parallel.v2/src/transform.cuc/parallel.v2/src/unique_by_key.cuc/parallel.v2/src/util/build_utils.hc/parallel.v2/test/CMakeLists.txtc/parallel.v2/test/freestanding/CMakeLists.txtc/parallel.v2/test/freestanding/test_basic_cccl_header.cppc/parallel.v2/test/freestanding/test_compiler.cppc/parallel.v2/test/freestanding/test_cub_device_adjacent_difference.cppc/parallel.v2/test/freestanding/test_cub_device_reduce_bitcode.cppc/parallel.v2/test/freestanding/test_cub_device_reduce_custom_op.cppc/parallel.v2/test/freestanding/test_cub_device_reduce_deterministic.cppc/parallel.v2/test/freestanding/test_cub_device_reduce_explicit_templates.cppc/parallel.v2/test/freestanding/test_required_host_headers.cppc/parallel.v2/test/freestanding/test_util.hc/parallel/CMakeLists.txtc/parallel/include/cccl/c/types.hc/parallel/src/hostjit/include/hostjit/cuda_minimal/stubs/cstdlibc/parallel/test/CMakeLists.txtc/parallel/test/test_binary_search.cppc/parallel/test/test_for.cppc/parallel/test/test_merge_sort.cppc/parallel/test/test_reduce.cppc/parallel/test/test_scan.cppc/parallel/test/test_segmented_reduce.cppc/parallel/test/test_three_way_partition.cppc/parallel/test/test_transform.cppc/parallel/test/test_unique_by_key.cppc/parallel/test/test_util.hci/build_cuda_cccl_python.shci/build_cuda_cccl_python_v2.shci/build_cuda_cccl_wheel.shci/matrix.yamlci/project_files_and_dependencies.yamlci/test/inspect_changes/c2h_dependency.outputci/test/inspect_changes/core_dirty.outputci/test/inspect_changes/libcudacxx_both.outputci/test/inspect_changes/libcudacxx_public_only.outputci/test/inspect_changes/libcudacxx_thrust.outputci/test/inspect_changes/multiple_projects.outputci/test_cccl_c_parallel_hostjit.shci/test_cccl_c_parallel_v2.shci/test_cuda_compute_python.shci/test_cuda_compute_python_v2.shci/util/workflow/get_wheel_artifact_name.shci/windows/build_cccl_c_parallel_hostjit.ps1ci/windows/test_cccl_c_parallel_v2.ps1python/cuda_cccl/CMakeLists.txtpython/cuda_cccl/cuda/compute/__init__.pypython/cuda_cccl/cuda/compute/_bindings.pyipython/cuda_cccl/cuda/compute/_bindings_binary_search_backend_v1.pxipython/cuda_cccl/cuda/compute/_bindings_binary_search_backend_v2.pxipython/cuda_cccl/cuda/compute/_bindings_impl.pyxpython/cuda_cccl/cuda/compute/_bindings_op_code_type_v1.pxipython/cuda_cccl/cuda/compute/_bindings_op_code_type_v2.pxipython/cuda_cccl/cuda/compute/_bindings_segmented_reduce_backend_v1.pxipython/cuda_cccl/cuda/compute/_bindings_segmented_reduce_backend_v2.pxipython/cuda_cccl/cuda/compute/_cpp_compile.pypython/cuda_cccl/cuda/compute/_device_code.pypython/cuda_cccl/cuda/compute/_jit.pypython/cuda_cccl/cuda/compute/algorithms/_select.pypython/cuda_cccl/cuda/compute/iterators/_cache_modified.pypython/cuda_cccl/cuda/compute/iterators/_constant.pypython/cuda_cccl/cuda/compute/iterators/_counting.pypython/cuda_cccl/cuda/compute/iterators/_discard.pypython/cuda_cccl/cuda/compute/iterators/_permutation.pypython/cuda_cccl/cuda/compute/iterators/_pointer.pypython/cuda_cccl/cuda/compute/iterators/_reverse.pypython/cuda_cccl/cuda/compute/iterators/_shuffle.pypython/cuda_cccl/cuda/compute/iterators/_transform.pypython/cuda_cccl/cuda/compute/iterators/_zip.pypython/cuda_cccl/cuda/compute/op.pypython/cuda_cccl/pyproject.tomlpython/cuda_cccl/tests/compute/conftest.pypython/cuda_cccl/tests/compute/examples/raw_op/llvm_stateless.pypython/cuda_cccl/tests/compute/test_permutation_iterator.pypython/cuda_cccl/tests/compute/test_raw_op.pypython/cuda_cccl/tests/compute/test_zip_iterator.pypython/cuda_cccl/tests/test_examples.py
💤 Files with no reviewable changes (5)
- ci/windows/build_cccl_c_parallel_hostjit.ps1
- ci/test_cccl_c_parallel_hostjit.sh
- c/parallel/CMakeLists.txt
- c/parallel/src/hostjit/include/hostjit/cuda_minimal/stubs/cstdlib
- c/parallel/test/CMakeLists.txt
| import os | ||
| import re | ||
|
|
||
| import llvmlite.binding as llvm | ||
| from numba.cuda.compiler import _compile_pyfunc_with_fixup | ||
|
|
||
| target_name = wrapped_op.__name__ | ||
| lib, _ = _compile_pyfunc_with_fixup( | ||
| wrapped_op, | ||
| wrapper_sig, | ||
| device=True, | ||
| abi="c", | ||
| abi_info={"abi_name": target_name}, | ||
| lto=False, | ||
| ) |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check if numba version is pinned in pyproject.toml or requirements
rg -n "numba" python/cuda_cccl/pyproject.toml python/cuda_cccl/requirements*.txt 2>/dev/null || echo "No explicit numba version constraint found"Repository: NVIDIA/cccl
Length of output: 865
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Search for explicit pins/locks anywhere in repo (beyond just requirements*.txt)
rg -n --hidden --glob '!.git/*' \
'numba\s*([=]{1,2})' \
. || true
rg -n --hidden --glob '!.git/*' \
'numba-cuda\s*([=]{1,2})' \
. || true
# Look for typical lock/constraints files that might pin versions
fd -t f -e toml -e lock -e txt -e in -e sh -e yml -e yaml -e cfg -e md \
-a . | rg -i '(lock|constraints|requirements|pip|poetry|uv|tox|nox|ci|workflow|dependabot|package-lock|pnpm-lock|yarn-lock)' || trueRepository: NVIDIA/cccl
Length of output: 5036
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Targeted exact-pin searches
rg -n --hidden --glob '!.git/*' \
'(^|[[:space:]])numba==|numba-cuda==|(^|[[:space:]])numba-cuda==|(^|[[:space:]])numba==[0-9]' \
. || true
rg -n --hidden --glob '!.git/*' \
'numba(\s*[<>=]{1,2}\s*[^,;\s]+)?' \
python/cuda_cccl . || true
# Look for common lock/constraint files and search inside them
fd -t f -a . -e lock -e txt -e toml -e yml -e yaml -e json -e cfg -e sh -e md -e csv \
| rg -i '(poetry\.lock|uv\.lock|constraints|requirements.*lock|pip\.conf|tox\.ini|nox\.ini)' || true
for f in $(fd -t f -a . -e lock -e txt -e toml -e yml -e yaml -e json -e cfg -e sh -e ini -e md | rg -i '(poetry\.lock|uv\.lock|constraints|requirements.*lock|pip\.conf|tox\.ini|nox\.ini)'); do
rg -n --hidden 'numba(-cuda)?==|numba(-cuda)?\s*[<>=]{1,2}\s*' "$f" || true
doneRepository: NVIDIA/cccl
Length of output: 50368
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Exact-pin presence checks (count + limited listing)
echo "numba== matches:"; rg -n --hidden --glob '!.git/*' '(^|[^A-Za-z0-9_.-])numba==[0-9]' . || true
echo "numba-cuda== matches:"; rg -n --hidden --glob '!.git/*' '(^|[^A-Za-z0-9_.-])numba-cuda==[0-9]' . || true
# Also check for any caret/tilde pins (tight ranges) specifically
echo "numba>= pinned upper-bounds (numba<...):"
rg -n --hidden --glob '!.git/*' '(^|[^A-Za-z0-9_.-])numba<=[0-9]|(^|[^A-Za-z0-9_.-])numba<[0-9]' python/cuda_cccl . || trueRepository: NVIDIA/cccl
Length of output: 135
important: _compile_pyfunc_with_fixup in python/cuda_cccl/cuda/compute/_jit.py is a private Numba API, and the project does not pin Numba to an exact version (numba== / numba-cuda== not found repo-wide; pyproject.toml only specifies lower bounds like numba>=0.60.0 and numba-cuda[cu12|cu13]>=0.23.0 with exclusions). Add an exact/strict version constraint (or upper bounds + CI matrix) so minor Numba/llvmlite changes don’t break the LLVM IR/linking and datalayout-stripping logic.
| # Individual tests known to crash on the v2 backend. Match is on `item.name` | ||
| # (parametrized id, e.g. "test_foo[int32]") OR on the bare function name. Add | ||
| # a one-line reason for each so it's clear why it's deferred rather than fixed. | ||
| _V2_BROKEN_TESTS = { | ||
| "test_segmented_sort_op_kind": "cudaErrorMisalignedAddress at runtime; v2 segmented_sort path", | ||
| } |
There was a problem hiding this comment.
important: test_segmented_sort_op_kind is skipped due to cudaErrorMisalignedAddress runtime error in v2. This indicates a memory alignment bug, not a missing feature. Skipping hides a correctness issue. Add a GitHub issue reference to the skip reason and ensure there's a plan to fix this before v2 is released or document it as a known limitation in release notes.
There was a problem hiding this comment.
Actionable comments posted: 10
🧹 Nitpick comments (5)
benchmarks/scripts/sol.py (1)
63-82: 💤 Low valuesuggestion: Line 68
print(df)dumps an empty dataframe right after the warning and adds no diagnostic value beyond the already-printedfused_algname. Drop it.if df.empty: print( f"WARNING: Skipped {fused_algname} because no data is present" ) - print(df) continuec/experimental/stf/include/cccl/c/experimental/stf/stf.h (1)
406-436: 💤 Low valuesuggestion: The return type
intforstf_ctx_waitlacks documentation on what non-zero error codes mean. Consider documenting specific error values or adding anstf_errorenum, consistent with other CCCL C APIs.c/experimental/stf/src/stf.cu (1)
477-480: 💤 Low valuesuggestion: Silent exception swallowing differs from the pattern in
stf_try_allocatewhich logs to stderr. Consider logging the exception message here too for debuggability, or at minimum documenting that errors are silently swallowed.ci/test_thrust.sh (1)
55-63: 💤 Low valuesuggestion: consider preset name validation
Preset names
thrust-cpuandthrust-gpuare hardcoded. If these change inCMakePresets.json, the script will silently fail. Consider adding a verification step or documenting the preset name dependency.cub/test/catch2_test_device_transform_if.cu (1)
18-21: 💤 Low valuesuggestion: Hardcoding
offset_t = int64_tdrops the previous coverage of narrower/signed offset types forTransformIf. If that was intentional (e.g. unifying with the v2 suite), ignore; otherwise consider retaining a small offset-type list to keep offset-width regressions covered.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: c0bae808-eb18-4205-b112-9acc683c35c5
📒 Files selected for processing (262)
.devcontainer/launch.sh.gitignoreCMakeLists.txtCMakePresets.jsonbenchmarks/scripts/sol.pyc/CMakeLists.txtc/experimental/stf/include/cccl/c/experimental/stf/stf.hc/experimental/stf/src/stf.cuc/experimental/stf/test/test_ctx.cppc/experimental/stf/test/test_places.cppc/parallel.v2/CMakeLists.txtc/parallel.v2/include/cccl/c/binary_search.hc/parallel.v2/include/cccl/c/extern_c.hc/parallel.v2/include/cccl/c/for.hc/parallel.v2/include/cccl/c/histogram.hc/parallel.v2/include/cccl/c/merge_sort.hc/parallel.v2/include/cccl/c/radix_sort.hc/parallel.v2/include/cccl/c/reduce.hc/parallel.v2/include/cccl/c/scan.hc/parallel.v2/include/cccl/c/segmented_reduce.hc/parallel.v2/include/cccl/c/segmented_sort.hc/parallel.v2/include/cccl/c/three_way_partition.hc/parallel.v2/include/cccl/c/transform.hc/parallel.v2/include/cccl/c/types.hc/parallel.v2/include/cccl/c/unique_by_key.hc/parallel.v2/src/binary_search.cuc/parallel.v2/src/for.cuc/parallel.v2/src/histogram.cuc/parallel.v2/src/hostjit/CMakeLists.txtc/parallel.v2/src/hostjit/codegen/bitcode.cppc/parallel.v2/src/hostjit/codegen/cub_call.cppc/parallel.v2/src/hostjit/codegen/iterators.cppc/parallel.v2/src/hostjit/codegen/operators.cppc/parallel.v2/src/hostjit/codegen/types.cppc/parallel.v2/src/hostjit/compiler.cppc/parallel.v2/src/hostjit/config.cppc/parallel.v2/src/hostjit/include/hostjit/codegen/bitcode.hppc/parallel.v2/src/hostjit/include/hostjit/codegen/cub_call.hppc/parallel.v2/src/hostjit/include/hostjit/codegen/iterators.hppc/parallel.v2/src/hostjit/include/hostjit/codegen/operators.hppc/parallel.v2/src/hostjit/include/hostjit/codegen/types.hppc/parallel.v2/src/hostjit/include/hostjit/compiler.hppc/parallel.v2/src/hostjit/include/hostjit/config.hppc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/__clang_cuda_device_functions.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/__clang_cuda_libdevice_declares.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/__clang_cuda_math.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/__clang_cuda_runtime_wrapper.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/assert.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/cassertc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/climitsc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/cmathc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/cstddefc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/cstdlibc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/ctype.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/cuda/std/__cstdlib/aligned_alloc.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/initializer_listc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/limitsc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/math.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/memory.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/newc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/stdlib.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/string.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/utilityc/parallel.v2/src/hostjit/include/hostjit/jit_compiler.hppc/parallel.v2/src/hostjit/include/hostjit/loader.hppc/parallel.v2/src/hostjit/jit_compiler.cppc/parallel.v2/src/hostjit/loader.cppc/parallel.v2/src/merge_sort.cuc/parallel.v2/src/radix_sort.cuc/parallel.v2/src/reduce.cuc/parallel.v2/src/scan.cuc/parallel.v2/src/segmented_reduce.cuc/parallel.v2/src/segmented_sort.cuc/parallel.v2/src/three_way_partition.cuc/parallel.v2/src/transform.cuc/parallel.v2/src/unique_by_key.cuc/parallel.v2/src/util/build_utils.hc/parallel.v2/test/CMakeLists.txtc/parallel.v2/test/freestanding/CMakeLists.txtc/parallel.v2/test/freestanding/test_basic_cccl_header.cppc/parallel.v2/test/freestanding/test_compiler.cppc/parallel.v2/test/freestanding/test_cub_device_adjacent_difference.cppc/parallel.v2/test/freestanding/test_cub_device_reduce_bitcode.cppc/parallel.v2/test/freestanding/test_cub_device_reduce_custom_op.cppc/parallel.v2/test/freestanding/test_cub_device_reduce_deterministic.cppc/parallel.v2/test/freestanding/test_cub_device_reduce_explicit_templates.cppc/parallel.v2/test/freestanding/test_required_host_headers.cppc/parallel.v2/test/freestanding/test_util.hc/parallel/CMakeLists.txtc/parallel/include/cccl/c/types.hc/parallel/src/hostjit/include/hostjit/cuda_minimal/stubs/cstdlibc/parallel/test/CMakeLists.txtc/parallel/test/test_binary_search.cppc/parallel/test/test_for.cppc/parallel/test/test_merge_sort.cppc/parallel/test/test_reduce.cppc/parallel/test/test_scan.cppc/parallel/test/test_segmented_reduce.cppc/parallel/test/test_three_way_partition.cppc/parallel/test/test_transform.cppc/parallel/test/test_unique_by_key.cppc/parallel/test/test_util.hci/build_common.shci/build_cuda_cccl_python.shci/build_cuda_cccl_python_v2.shci/build_cuda_cccl_wheel.shci/matrix.yamlci/project_files_and_dependencies.yamlci/test/inspect_changes/c2h_dependency.outputci/test/inspect_changes/core_dirty.outputci/test/inspect_changes/libcudacxx_both.outputci/test/inspect_changes/libcudacxx_public_only.outputci/test/inspect_changes/libcudacxx_thrust.outputci/test/inspect_changes/multiple_projects.outputci/test_cccl_c_parallel_hostjit.shci/test_cccl_c_parallel_v2.shci/test_cuda_compute_python.shci/test_cuda_compute_python_v2.shci/test_thrust.shci/upload_cub_test_artifacts.shci/upload_thrust_test_artifacts.shci/util/workflow/get_wheel_artifact_name.shci/windows/build_cccl_c_parallel_hostjit.ps1ci/windows/test_cccl_c_parallel_v2.ps1ci/windows/test_thrust.ps1cub/benchmarks/bench/scan/exclusive/sum.warpspeed.cucub/benchmarks/bench/scan/policy_selector.hcub/benchmarks/bench/segmented_topk/fixed/keys.cucub/benchmarks/bench/segmented_topk/variable/keys.cucub/benchmarks/bench/transform/babelstream.cucub/benchmarks/bench/transform/common.hcub/benchmarks/bench/transform/complex_cmp.cucub/benchmarks/bench/transform/fib.cucub/benchmarks/bench/transform/fill.cucub/benchmarks/bench/transform/grayscale.cucub/benchmarks/bench/transform/heavy.cucub/benchmarks/bench/transform/pytorch.cucub/benchmarks/bench/transform_reduce/sum.cucub/cub/detail/launcher/cuda_driver.cuhcub/cub/detail/launcher/cuda_runtime.cuhcub/cub/detail/warpspeed/resource/smem_resource.cuhcub/cub/detail/warpspeed/squad/squad.cuhcub/cub/detail/warpspeed/squad/squad_desc.cuhcub/cub/device/device_reduce.cuhcub/cub/device/device_transform.cuhcub/cub/device/dispatch/dispatch_batched_topk.cuhcub/cub/device/dispatch/dispatch_find.cuhcub/cub/device/dispatch/dispatch_histogram.cuhcub/cub/device/dispatch/dispatch_merge_sort.cuhcub/cub/device/dispatch/dispatch_scan.cuhcub/cub/device/dispatch/dispatch_transform.cuhcub/cub/device/dispatch/kernels/kernel_scan_warpspeed.cuhcub/cub/device/dispatch/kernels/kernel_transform.cuhcub/cub/device/dispatch/tuning/tuning_scan.cuhcub/cub/warp/warp_reduce.cuhcub/test/catch2_test_device_reduce_env.cucub/test/catch2_test_device_transform.cucub/test/catch2_test_device_transform_if.cucudax/cmake/cudaxBuildCompilerTargets.cmakecudax/include/cuda/experimental/__places/data_place_interface.cuhcudax/include/cuda/experimental/__places/exec/cuda_stream.cuhcudax/include/cuda/experimental/__places/localized_array.cuhcudax/include/cuda/experimental/__places/partitions/blocked_partition.cuhcudax/include/cuda/experimental/__places/partitions/cyclic_shape.cuhcudax/include/cuda/experimental/__places/partitions/tiled_partition.cuhcudax/include/cuda/experimental/__places/places.cuhcudax/include/cuda/experimental/__places/stream_pool.cuhcudax/include/cuda/experimental/__stf/internal/async_resources_handle.cuhcudax/include/cuda/experimental/__stf/internal/backend_ctx.cuhcudax/include/cuda/experimental/__stf/internal/parallel_for_scope.cuhcudax/include/cuda/experimental/__stf/internal/stf_places_extended_exports.cuhcudax/include/cuda/experimental/__stf/internal/stf_places_into_stf_core.cuhcudax/include/cuda/experimental/__stf/stream/interfaces/slice.cuhcudax/include/cuda/experimental/__stf/stream/internal/event_types.cuhcudax/include/cuda/experimental/__stf/stream/stream_ctx.cuhcudax/include/cuda/experimental/__stf/stream/stream_task.cuhcudax/test/CMakeLists.txtcudax/test/cuco/utility/test_hashers.cucudax/test/stf/CMakeLists.txtcudax/test/stf/cpp/test_pick_stream.cucudax/test/stf/cpp/test_pick_stream_green_context.cucudax/test/stf/local_stf/stream_ctx_lifetime_btb.cudocs/cudax/places.rstlibcudacxx/include/cuda/__hierarchy/hierarchy_level_base.hlibcudacxx/include/cuda/__hierarchy/native_hierarchy_level_base.hlibcudacxx/include/cuda/std/__cccl/dialect.hlibcudacxx/include/cuda/std/__cccl/ptx_isa.hlibcudacxx/include/cuda/std/__ranges/subrange.hlibcudacxx/include/cuda/std/__simd/abi.hlibcudacxx/include/cuda/std/__simd/basic_mask.hlibcudacxx/include/cuda/std/__simd/basic_vec.hlibcudacxx/include/cuda/std/__simd/permute.hlibcudacxx/include/cuda/std/__simd/utility.hlibcudacxx/include/cuda/std/__simd_libcudacxx/include/cuda/std/__tuple_dir/tuple_like.hlibcudacxx/include/cuda/std/__utility/constant_wrapper.hlibcudacxx/include/cuda/std/inplace_vectorlibcudacxx/include/cuda/std/utilitylibcudacxx/include/cuda/std/versionlibcudacxx/test/libcudacxx/std/containers/sequences/inplace_vector/emplace.pass.cpplibcudacxx/test/libcudacxx/std/numerics/simd/simd.permute/permute.dynamic.pass.cpplibcudacxx/test/libcudacxx/std/numerics/simd/simd.permute/permute.mask.pass.cpplibcudacxx/test/libcudacxx/std/numerics/simd/simd.permute/permute.static.pass.cpplibcudacxx/test/libcudacxx/std/numerics/simd/simd_test_utils.hlibcudacxx/test/libcudacxx/std/ranges/range.utility/range.subrange/ctor.pair_like_conv.pass.cpplibcudacxx/test/libcudacxx/std/ranges/range.utility/range.subrange/get.pass.cpplibcudacxx/test/libcudacxx/std/ranges/range.utility/range.subrange/structured_bindings.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/adl.compile.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/assign.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/binary_ops.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/call.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/comma.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/comp.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/convert.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/ctad.compile.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/cw.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/cw_fixed.array.ctor.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/cw_fixed.ctor.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/general.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/helpers.hlibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/kernel_parameter.array.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/kernel_parameter.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/mem_ptr.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/pseudo_mutators.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/subscript.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/types.compile.pass.cpplibcudacxx/test/libcudacxx/std/utilities/const.wrap.class/unary_ops.pass.cpppython/cuda_cccl/CMakeLists.txtpython/cuda_cccl/cuda/compute/__init__.pypython/cuda_cccl/cuda/compute/_bindings.pyipython/cuda_cccl/cuda/compute/_bindings_binary_search_backend_v1.pxipython/cuda_cccl/cuda/compute/_bindings_binary_search_backend_v2.pxipython/cuda_cccl/cuda/compute/_bindings_impl.pyxpython/cuda_cccl/cuda/compute/_bindings_op_code_type_v1.pxipython/cuda_cccl/cuda/compute/_bindings_op_code_type_v2.pxipython/cuda_cccl/cuda/compute/_bindings_segmented_reduce_backend_v1.pxipython/cuda_cccl/cuda/compute/_bindings_segmented_reduce_backend_v2.pxipython/cuda_cccl/cuda/compute/_cpp_compile.pypython/cuda_cccl/cuda/compute/_device_code.pypython/cuda_cccl/cuda/compute/_jit.pypython/cuda_cccl/cuda/compute/algorithms/_select.pypython/cuda_cccl/cuda/compute/iterators/_cache_modified.pypython/cuda_cccl/cuda/compute/iterators/_constant.pypython/cuda_cccl/cuda/compute/iterators/_counting.pypython/cuda_cccl/cuda/compute/iterators/_discard.pypython/cuda_cccl/cuda/compute/iterators/_permutation.pypython/cuda_cccl/cuda/compute/iterators/_pointer.pypython/cuda_cccl/cuda/compute/iterators/_reverse.pypython/cuda_cccl/cuda/compute/iterators/_shuffle.pypython/cuda_cccl/cuda/compute/iterators/_transform.pypython/cuda_cccl/cuda/compute/iterators/_zip.pypython/cuda_cccl/cuda/compute/op.pypython/cuda_cccl/pyproject.tomlpython/cuda_cccl/tests/compute/conftest.pypython/cuda_cccl/tests/compute/examples/raw_op/llvm_stateless.pypython/cuda_cccl/tests/compute/test_permutation_iterator.pypython/cuda_cccl/tests/compute/test_raw_op.pypython/cuda_cccl/tests/compute/test_zip_iterator.pypython/cuda_cccl/tests/test_examples.pytest/cuda_smoke/CMakeLists.txttest/cuda_smoke/cuda_runtime_smoke.cuthrust/thrust/system/cuda/detail/transform.h
💤 Files with no reviewable changes (6)
- libcudacxx/test/libcudacxx/std/ranges/range.utility/range.subrange/ctor.pair_like_conv.pass.cpp
- c/parallel/test/CMakeLists.txt
- c/parallel/CMakeLists.txt
- ci/windows/build_cccl_c_parallel_hostjit.ps1
- c/parallel/src/hostjit/include/hostjit/cuda_minimal/stubs/cstdlib
- ci/test_cccl_c_parallel_hostjit.sh
✅ Files skipped from review due to trivial changes (15)
- ci/test/inspect_changes/multiple_projects.output
- cub/benchmarks/bench/scan/policy_selector.h
- libcudacxx/include/cuda/std/_simd
- cudax/test/stf/CMakeLists.txt
- cub/cub/detail/warpspeed/squad/squad.cuh
- cudax/cmake/cudaxBuildCompilerTargets.cmake
- ci/test/inspect_changes/libcudacxx_both.output
- ci/test/inspect_changes/libcudacxx_thrust.output
- ci/test/inspect_changes/c2h_dependency.output
- .gitignore
- libcudacxx/include/cuda/std/version
- cudax/include/cuda/experimental/__stf/stream/interfaces/slice.cuh
- c/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/cstddef
- ci/test/inspect_changes/core_dirty.output
- libcudacxx/include/cuda/std/utility
🚧 Files skipped from review as they are similar to previous changes (59)
- c/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/assert.h
- c/parallel/include/cccl/c/types.h
- c/parallel/test/test_transform.cpp
- ci/test_cccl_c_parallel_v2.sh
- c/parallel.v2/src/hostjit/include/hostjit/codegen/types.hpp
- ci/test_cuda_compute_python.sh
- c/parallel.v2/src/hostjit/codegen/types.cpp
- c/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/cstdlib
- ci/build_cuda_cccl_python_v2.sh
- ci/build_cuda_cccl_python.sh
- c/parallel.v2/src/hostjit/config.cpp
- c/parallel.v2/src/hostjit/include/hostjit/codegen/bitcode.hpp
- c/CMakeLists.txt
- c/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/cassert
- c/parallel/test/test_for.cpp
- c/parallel/test/test_scan.cpp
- ci/test/inspect_changes/libcudacxx_public_only.output
- c/parallel/test/test_reduce.cpp
- c/parallel.v2/test/freestanding/CMakeLists.txt
- c/parallel/test/test_binary_search.cpp
- c/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/__clang_cuda_runtime_wrapper.h
- c/parallel.v2/include/cccl/c/extern_c.h
- ci/windows/test_cccl_c_parallel_v2.ps1
- c/parallel.v2/src/for.cu
- ci/project_files_and_dependencies.yaml
- c/parallel/test/test_three_way_partition.cpp
- c/parallel/test/test_merge_sort.cpp
- python/cuda_cccl/cuda/compute/_bindings_op_code_type_v1.pxi
- c/parallel.v2/test/CMakeLists.txt
- python/cuda_cccl/cuda/compute/_bindings_op_code_type_v2.pxi
- python/cuda_cccl/cuda/compute/_bindings_binary_search_backend_v1.pxi
- c/parallel/test/test_segmented_reduce.cpp
- c/parallel.v2/test/freestanding/test_cub_device_reduce_explicit_templates.cpp
- c/parallel.v2/src/hostjit/include/hostjit/codegen/operators.hpp
- ci/build_cuda_cccl_wheel.sh
- c/parallel.v2/src/hostjit/include/hostjit/config.hpp
- c/parallel.v2/src/radix_sort.cu
- c/parallel.v2/src/histogram.cu
- c/parallel.v2/CMakeLists.txt
- python/cuda_cccl/cuda/compute/init.py
- c/parallel.v2/src/three_way_partition.cu
- c/parallel.v2/src/merge_sort.cu
- c/parallel.v2/src/hostjit/codegen/iterators.cpp
- c/parallel.v2/src/hostjit/CMakeLists.txt
- python/cuda_cccl/CMakeLists.txt
- c/parallel.v2/src/unique_by_key.cu
- c/parallel/test/test_util.h
- c/parallel.v2/src/hostjit/codegen/bitcode.cpp
- c/parallel.v2/src/segmented_reduce.cu
- c/parallel.v2/src/reduce.cu
- c/parallel.v2/src/util/build_utils.h
- c/parallel.v2/src/binary_search.cu
- c/parallel.v2/src/segmented_sort.cu
- python/cuda_cccl/cuda/compute/_bindings_impl.pyx
- c/parallel/test/test_unique_by_key.cpp
- c/parallel.v2/src/hostjit/include/hostjit/codegen/cub_call.hpp
- c/parallel.v2/src/hostjit/codegen/cub_call.cpp
- c/parallel.v2/src/hostjit/codegen/operators.cpp
- c/parallel.v2/src/hostjit/compiler.cpp
74124e0 to
9d88081
Compare
There was a problem hiding this comment.
Actionable comments posted: 10
🧹 Nitpick comments (1)
c/parallel.v2/src/hostjit/codegen/iterators.cpp (1)
118-118: 💤 Low valuesuggestion:
operator-always returns 0 (lines 118, 255). This breaks algorithms that compute iterator distance. If intentional for lazy-evaluation iterators, consider adding a comment explaining the limitation.Also applies to: 255-255
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 1c63c6f9-7a64-4cef-abae-fee03f6ebfec
📒 Files selected for processing (114)
.gitignoreCMakeLists.txtCMakePresets.jsonc/CMakeLists.txtc/parallel.v2/CMakeLists.txtc/parallel.v2/include/cccl/c/binary_search.hc/parallel.v2/include/cccl/c/extern_c.hc/parallel.v2/include/cccl/c/for.hc/parallel.v2/include/cccl/c/histogram.hc/parallel.v2/include/cccl/c/merge_sort.hc/parallel.v2/include/cccl/c/radix_sort.hc/parallel.v2/include/cccl/c/reduce.hc/parallel.v2/include/cccl/c/scan.hc/parallel.v2/include/cccl/c/segmented_reduce.hc/parallel.v2/include/cccl/c/segmented_sort.hc/parallel.v2/include/cccl/c/three_way_partition.hc/parallel.v2/include/cccl/c/transform.hc/parallel.v2/include/cccl/c/types.hc/parallel.v2/include/cccl/c/unique_by_key.hc/parallel.v2/src/binary_search.cuc/parallel.v2/src/for.cuc/parallel.v2/src/histogram.cuc/parallel.v2/src/hostjit/CMakeLists.txtc/parallel.v2/src/hostjit/codegen/bitcode.cppc/parallel.v2/src/hostjit/codegen/cub_call.cppc/parallel.v2/src/hostjit/codegen/iterators.cppc/parallel.v2/src/hostjit/codegen/operators.cppc/parallel.v2/src/hostjit/codegen/types.cppc/parallel.v2/src/hostjit/compiler.cppc/parallel.v2/src/hostjit/config.cppc/parallel.v2/src/hostjit/include/hostjit/codegen/bitcode.hppc/parallel.v2/src/hostjit/include/hostjit/codegen/cub_call.hppc/parallel.v2/src/hostjit/include/hostjit/codegen/iterators.hppc/parallel.v2/src/hostjit/include/hostjit/codegen/operators.hppc/parallel.v2/src/hostjit/include/hostjit/codegen/types.hppc/parallel.v2/src/hostjit/include/hostjit/compiler.hppc/parallel.v2/src/hostjit/include/hostjit/config.hppc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/__clang_cuda_device_functions.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/__clang_cuda_libdevice_declares.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/__clang_cuda_math.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/__clang_cuda_runtime_wrapper.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/assert.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/cassertc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/climitsc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/cmathc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/cstddefc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/cstdlibc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/ctype.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/cuda/std/__cstdlib/aligned_alloc.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/initializer_listc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/limitsc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/math.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/memory.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/newc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/stdlib.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/string.hc/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/utilityc/parallel.v2/src/hostjit/include/hostjit/jit_compiler.hppc/parallel.v2/src/hostjit/include/hostjit/loader.hppc/parallel.v2/src/hostjit/jit_compiler.cppc/parallel.v2/src/hostjit/loader.cppc/parallel.v2/src/merge_sort.cuc/parallel.v2/src/radix_sort.cuc/parallel.v2/src/reduce.cuc/parallel.v2/src/scan.cuc/parallel.v2/src/segmented_reduce.cuc/parallel.v2/src/segmented_sort.cuc/parallel.v2/src/three_way_partition.cuc/parallel.v2/src/transform.cuc/parallel.v2/src/unique_by_key.cuc/parallel.v2/src/util/build_utils.hc/parallel.v2/test/CMakeLists.txtc/parallel.v2/test/freestanding/CMakeLists.txtc/parallel.v2/test/freestanding/test_basic_cccl_header.cppc/parallel.v2/test/freestanding/test_compiler.cppc/parallel.v2/test/freestanding/test_cub_device_adjacent_difference.cppc/parallel.v2/test/freestanding/test_cub_device_reduce_bitcode.cppc/parallel.v2/test/freestanding/test_cub_device_reduce_custom_op.cppc/parallel.v2/test/freestanding/test_cub_device_reduce_deterministic.cppc/parallel.v2/test/freestanding/test_cub_device_reduce_explicit_templates.cppc/parallel.v2/test/freestanding/test_required_host_headers.cppc/parallel.v2/test/freestanding/test_util.hc/parallel/CMakeLists.txtc/parallel/include/cccl/c/types.hc/parallel/src/hostjit/include/hostjit/cuda_minimal/stubs/cstdlibc/parallel/test/CMakeLists.txtc/parallel/test/test_binary_search.cppc/parallel/test/test_for.cppc/parallel/test/test_merge_sort.cppc/parallel/test/test_reduce.cppc/parallel/test/test_scan.cppc/parallel/test/test_segmented_reduce.cppc/parallel/test/test_three_way_partition.cppc/parallel/test/test_transform.cppc/parallel/test/test_unique_by_key.cppc/parallel/test/test_util.hci/build_cuda_cccl_python.shci/build_cuda_cccl_python_v2.shci/build_cuda_cccl_wheel.shci/matrix.yamlci/project_files_and_dependencies.yamlci/test/inspect_changes/c2h_dependency.outputci/test/inspect_changes/core_dirty.outputci/test/inspect_changes/libcudacxx_both.outputci/test/inspect_changes/libcudacxx_public_only.outputci/test/inspect_changes/libcudacxx_thrust.outputci/test/inspect_changes/multiple_projects.outputci/test_cccl_c_parallel_hostjit.shci/test_cccl_c_parallel_v2.shci/test_cuda_compute_python.shci/test_cuda_compute_python_v2.shci/util/workflow/get_wheel_artifact_name.shci/windows/build_cccl_c_parallel_hostjit.ps1ci/windows/test_cccl_c_parallel_v2.ps1
💤 Files with no reviewable changes (5)
- c/parallel/CMakeLists.txt
- c/parallel/src/hostjit/include/hostjit/cuda_minimal/stubs/cstdlib
- c/parallel/test/CMakeLists.txt
- ci/windows/build_cccl_c_parallel_hostjit.ps1
- ci/test_cccl_c_parallel_hostjit.sh
✅ Files skipped from review due to trivial changes (6)
- ci/test/inspect_changes/core_dirty.output
- .gitignore
- c/parallel.v2/include/cccl/c/extern_c.h
- ci/test/inspect_changes/libcudacxx_thrust.output
- c/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/cstddef
- ci/util/workflow/get_wheel_artifact_name.sh
🚧 Files skipped from review as they are similar to previous changes (57)
- ci/test_cuda_compute_python_v2.sh
- c/parallel/include/cccl/c/types.h
- ci/build_cuda_cccl_python_v2.sh
- ci/test/inspect_changes/libcudacxx_public_only.output
- ci/test_cuda_compute_python.sh
- c/parallel/test/test_reduce.cpp
- c/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/cassert
- c/parallel.v2/src/hostjit/config.cpp
- c/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/string.h
- c/parallel.v2/src/hostjit/include/hostjit/codegen/types.hpp
- ci/test_cccl_c_parallel_v2.sh
- c/parallel/test/test_scan.cpp
- c/parallel/test/test_binary_search.cpp
- c/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/cstdlib
- c/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/stubs/assert.h
- c/parallel/test/test_transform.cpp
- c/CMakeLists.txt
- c/parallel/test/test_merge_sort.cpp
- c/parallel/test/test_for.cpp
- c/parallel.v2/src/hostjit/include/hostjit/codegen/iterators.hpp
- c/parallel.v2/src/hostjit/include/hostjit/codegen/operators.hpp
- ci/test/inspect_changes/c2h_dependency.output
- c/parallel.v2/src/hostjit/codegen/types.cpp
- c/parallel.v2/test/CMakeLists.txt
- c/parallel/test/test_three_way_partition.cpp
- ci/windows/test_cccl_c_parallel_v2.ps1
- c/parallel/test/test_unique_by_key.cpp
- c/parallel.v2/test/freestanding/test_cub_device_reduce_explicit_templates.cpp
- ci/project_files_and_dependencies.yaml
- c/parallel.v2/src/unique_by_key.cu
- c/parallel.v2/src/for.cu
- ci/build_cuda_cccl_wheel.sh
- c/parallel.v2/src/hostjit/include/hostjit/codegen/bitcode.hpp
- c/parallel/test/test_segmented_reduce.cpp
- c/parallel.v2/src/reduce.cu
- c/parallel/test/test_util.h
- c/parallel.v2/CMakeLists.txt
- c/parallel.v2/src/segmented_reduce.cu
- c/parallel.v2/src/hostjit/include/hostjit/cuda_minimal/__clang_cuda_runtime_wrapper.h
- c/parallel.v2/src/merge_sort.cu
- c/parallel.v2/src/histogram.cu
- c/parallel.v2/src/hostjit/include/hostjit/codegen/cub_call.hpp
- c/parallel.v2/src/hostjit/codegen/bitcode.cpp
- c/parallel.v2/src/radix_sort.cu
- c/parallel.v2/src/three_way_partition.cu
- ci/matrix.yaml
- c/parallel.v2/src/hostjit/CMakeLists.txt
- c/parallel.v2/src/binary_search.cu
- CMakePresets.json
- ci/build_cuda_cccl_python.sh
- c/parallel.v2/src/util/build_utils.h
- c/parallel.v2/src/hostjit/compiler.cpp
- c/parallel.v2/src/transform.cu
- c/parallel.v2/src/scan.cu
- c/parallel.v2/src/segmented_sort.cu
- c/parallel.v2/src/hostjit/codegen/cub_call.cpp
- c/parallel.v2/src/hostjit/codegen/operators.cpp
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 976ce69a-371c-4078-a5ef-f5f43f77fe4b
📒 Files selected for processing (48)
c/parallel/include/cccl/c/types.hc/parallel/test/test_util.hci/build_cuda_cccl_python.shci/build_cuda_cccl_python_v2.shci/build_cuda_cccl_wheel.shci/matrix.yamlci/project_files_and_dependencies.yamlci/test/inspect_changes/c2h_dependency.outputci/test/inspect_changes/core_dirty.outputci/test/inspect_changes/libcudacxx_both.outputci/test/inspect_changes/libcudacxx_public_only.outputci/test/inspect_changes/libcudacxx_thrust.outputci/test/inspect_changes/multiple_projects.outputci/test_cuda_compute_python.shci/test_cuda_compute_python_v2.shci/util/workflow/get_wheel_artifact_name.shpython/cuda_cccl/CMakeLists.txtpython/cuda_cccl/cuda/compute/__init__.pypython/cuda_cccl/cuda/compute/_bindings.pyipython/cuda_cccl/cuda/compute/_bindings_binary_search_backend_v1.pxipython/cuda_cccl/cuda/compute/_bindings_binary_search_backend_v2.pxipython/cuda_cccl/cuda/compute/_bindings_impl.pyxpython/cuda_cccl/cuda/compute/_bindings_op_code_type_v1.pxipython/cuda_cccl/cuda/compute/_bindings_op_code_type_v2.pxipython/cuda_cccl/cuda/compute/_bindings_segmented_reduce_backend_v1.pxipython/cuda_cccl/cuda/compute/_bindings_segmented_reduce_backend_v2.pxipython/cuda_cccl/cuda/compute/_cpp_compile.pypython/cuda_cccl/cuda/compute/_device_code.pypython/cuda_cccl/cuda/compute/_jit.pypython/cuda_cccl/cuda/compute/algorithms/_select.pypython/cuda_cccl/cuda/compute/iterators/_cache_modified.pypython/cuda_cccl/cuda/compute/iterators/_constant.pypython/cuda_cccl/cuda/compute/iterators/_counting.pypython/cuda_cccl/cuda/compute/iterators/_discard.pypython/cuda_cccl/cuda/compute/iterators/_permutation.pypython/cuda_cccl/cuda/compute/iterators/_pointer.pypython/cuda_cccl/cuda/compute/iterators/_reverse.pypython/cuda_cccl/cuda/compute/iterators/_shuffle.pypython/cuda_cccl/cuda/compute/iterators/_transform.pypython/cuda_cccl/cuda/compute/iterators/_zip.pypython/cuda_cccl/cuda/compute/op.pypython/cuda_cccl/pyproject.tomlpython/cuda_cccl/tests/compute/conftest.pypython/cuda_cccl/tests/compute/examples/raw_op/llvm_stateless.pypython/cuda_cccl/tests/compute/test_permutation_iterator.pypython/cuda_cccl/tests/compute/test_raw_op.pypython/cuda_cccl/tests/compute/test_zip_iterator.pypython/cuda_cccl/tests/test_examples.py
✅ Files skipped from review due to trivial changes (5)
- ci/test/inspect_changes/multiple_projects.output
- ci/test_cuda_compute_python_v2.sh
- python/cuda_cccl/tests/compute/test_raw_op.py
- ci/test/inspect_changes/libcudacxx_public_only.output
- python/cuda_cccl/pyproject.toml
🚧 Files skipped from review as they are similar to previous changes (34)
- ci/util/workflow/get_wheel_artifact_name.sh
- python/cuda_cccl/tests/test_examples.py
- ci/test/inspect_changes/libcudacxx_thrust.output
- python/cuda_cccl/cuda/compute/algorithms/_select.py
- ci/test_cuda_compute_python.sh
- python/cuda_cccl/cuda/compute/_bindings_op_code_type_v1.pxi
- ci/build_cuda_cccl_python.sh
- c/parallel/include/cccl/c/types.h
- python/cuda_cccl/cuda/compute/_bindings_segmented_reduce_backend_v2.pxi
- python/cuda_cccl/cuda/compute/init.py
- python/cuda_cccl/cuda/compute/_device_code.py
- python/cuda_cccl/cuda/compute/iterators/_counting.py
- python/cuda_cccl/cuda/compute/iterators/_constant.py
- ci/build_cuda_cccl_python_v2.sh
- python/cuda_cccl/tests/compute/test_permutation_iterator.py
- python/cuda_cccl/cuda/compute/_bindings_binary_search_backend_v2.pxi
- python/cuda_cccl/cuda/compute/iterators/_cache_modified.py
- python/cuda_cccl/cuda/compute/_bindings.pyi
- ci/build_cuda_cccl_wheel.sh
- python/cuda_cccl/cuda/compute/iterators/_discard.py
- python/cuda_cccl/cuda/compute/iterators/_reverse.py
- python/cuda_cccl/cuda/compute/iterators/_pointer.py
- python/cuda_cccl/cuda/compute/iterators/_transform.py
- python/cuda_cccl/CMakeLists.txt
- python/cuda_cccl/cuda/compute/iterators/_zip.py
- python/cuda_cccl/cuda/compute/op.py
- python/cuda_cccl/cuda/compute/iterators/_permutation.py
- python/cuda_cccl/cuda/compute/_bindings_binary_search_backend_v1.pxi
- python/cuda_cccl/cuda/compute/_bindings_op_code_type_v2.pxi
- python/cuda_cccl/tests/compute/test_zip_iterator.py
- python/cuda_cccl/cuda/compute/iterators/_shuffle.py
- python/cuda_cccl/cuda/compute/_jit.py
- python/cuda_cccl/tests/compute/examples/raw_op/llvm_stateless.py
- python/cuda_cccl/cuda/compute/_bindings_impl.pyx
This comment has been minimized.
This comment has been minimized.
|
I dismissed cudax, libcudacxx, and thrust review requests. Those were introduced by a bad rebase. |
|
/ok to test 157f75e |
- conftest.py: match v2-broken tests on the parametrized id (item.name) as well as the bare function name, as the surrounding comment already claimed (it only checked the bare name before). - _bindings_impl.pyx: validate that DeviceCode.bytes_ is bytes and .kind is str (for the main op and each extra) so a malformed object raises a clear TypeError instead of crashing later during unpacking. - ci/matrix.yaml: add test_py_examples to the python_v2 job so the new v2-specific raw_op example and the test_examples.py changes are exercised on the HostJIT backend (previously only test_py_par ran there). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Rebased onto main after the CCCL C v2 backend landed via NVIDIA#8985. Drops this branch's redundant copy of the v2 C backend (main now provides it) and keeps its unique contribution: - c/parallel.v2: the LLVM-IR operator support that NVIDIA#8985 predates — a CCCL_OP_LLVM_IR op-code type and a per-extra `extra_code_types` field on cccl_op_t, plus BitcodeCollector dispatch (LLVM bitcode -> IR-level inlining; C++ source -> compile; LTO-IR -> nvJitLink). 4 files; the rest of c/parallel.v2 is identical to main. - python/cuda_cccl: build cuda.compute against c.parallel.v2 via the CCCL_PYTHON_USE_V2 CMake option; v1/v2 backend-conditional Cython .pxi shims; user operators lowered to LLVM IR (bitcode) on v2. - ci: build_cuda_cccl_python_v2.sh / test_cuda_compute_python_v2.sh, a python_v2 matrix project + dependency wiring, and inspect_changes fixtures regenerated to include python_v2. - c/parallel: minor v1 test-util/types additions used by the unified test tree. Squashed from the prior 50-commit branch (backup: backup/cccl-python-v2-prerebase). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- conftest.py: match v2-broken tests on the parametrized id (item.name) as well as the bare function name, as the surrounding comment already claimed (it only checked the bare name before). - _bindings_impl.pyx: validate that DeviceCode.bytes_ is bytes and .kind is str (for the main op and each extra) so a malformed object raises a clear TypeError instead of crashing later during unpacking. - ci/matrix.yaml: add test_py_examples to the python_v2 job so the new v2-specific raw_op example and the test_examples.py changes are exercised on the HostJIT backend (previously only test_py_par ran there). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
v2 (HostJIT) is experimental and shouldn't surface in user-facing docs. - RawOp: document the stable LTO-IR contract only; drop the "LLVM bitcode is preferred / routed through nvJitLink / inlined into the CUB module" paragraph, the llvm_stateless example reference, and the "recommended for v2" notes on the ltoir/extra_ltoirs args. - DeviceCode (internal): make the `kind` description backend-neutral; drop the "v2 backend dispatches" wording and the c/parallel.v2 source-tree path. - compile_cpp_op_code (internal): drop the v1/v2 backend-dispatch paragraph. No behavior change; the code still accepts DeviceCode/llvm_ir as before. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adding test_py_examples to the python_v2 job_map (CodeRabbit review) makes the workflow dispatch resolve ci/test_cuda_cccl_examples_python_v2.sh, which didn't exist — runs failed with "No such file or directory". Add the wrapper, mirroring test_cuda_compute_python_v2.sh: export CCCL_PYTHON_USE_V2=1 and delegate to test_cuda_cccl_examples_python.sh. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| # - { jobs: ['run_gpu'], project: 'target', ctk: ['12.X', '13.X'], cxx: ['gcc', 'clang'], gpu: 'rtx2080', | ||
| # args: '--preset libcudacxx --lit-tests "cuda/utility/basic_any.pass.cpp"' } | ||
| # | ||
| override: |
There was a problem hiding this comment.
We should add a comment here to stop agents from stripping this out xD
There was a problem hiding this comment.
I promise I'll follow up with a PR doing that :) sorry about that
alliepiper
left a comment
There was a problem hiding this comment.
CMake/infra lgtm, a nit about the override matrix stub.
🥳 CI Workflow Results🟩 Finished in 2h 33m: Pass: 100%/503 | Total: 17d 10h | Max: 2h 22m | Hits: 39%/1755687See results here. |
Description
Overview
After #8985, we have two implementations of CCCL C (v1 and v2). The latter uses host JIT and we will eventually replace v1 with v2.
This PR introduces the ability to build
cuda.computeuponv2(in addition tov1), as well as (very limited) CI testing for the resulting build.Whether v1 or v2 is used is controlled by the
-DCCCL_PYTHON_USE_V2cmake switch:Lowering Python operators to LLVM-IR
In v1, which is based on nvrtc/nvJitLink, we compile Python-side ops to LTO-IR, and link it together with the JIT compiled CUB kernel (also LTO-IR), and nvJitLink can nicely inline the op in the final SASS.
In v2, the CUB kernel is compiled into LLVM-IR (bitcode). Correspondingly, we also must lower Python ops to LLVM-IR, so that LLVM can inline it. If we stay with LTO-IR, nvJitlink will see PTX (lowered kernel LLVM-IR) + LTO-IR (lowered Python op) which it cannot inline.
Thus, for efficiency reasons, Python ops in v2 are lowered to LLVM-IR rather than LTO-IR. This constitutes the majority of the changes introduced in this PR.
Note, despite its inefficiency, this PR still uses the second pathway
nvJitlink(PTX, LTO-IR)to supportRawOp.Checklist