feat(cccl): integrate missing CCCL directories — python/, ci/, .agent/, docs/, test/
Sparse-checkout from NVIDIA/cccl main branch to complete cccl_upstream: Added: - python/cuda_cccl/ (226 files) — Python bindings for device-level algorithms Critical for muh toolchain: cuda.compute.reduce_into, scan, radix_sort, etc. Includes 204 .py files with full test coverage for all 27 algorithms - ci/ (163 files) — Build/test infrastructure build_cub.sh, test_cub.sh, build_and_test_targets.sh, matrix.yaml Directly maps to our [INFRA-CI] and [INFRA-BUILD] items - .agent/skills/ (7 files) — NVIDIA's own agent skills for CCCL cccl-style/SKILL.md, cccl-test/SKILL.md, sass-diff/SKILL.md - docs/ (491 files) — Official CCCL documentation CI references, CMake guides, Python compute docs, libcudacxx PTX docs - test/ (12 files) — Top-level integration tests (cuda_smoke, stdpar) - Root configs: .clang-format, .clang-tidy, CONTRIBUTING.md, pyproject.toml - CLAUDE.md symlink → AGENTS.md (NVIDIA's standard) cccl_upstream now mirrors full NVIDIA/cccl structure: Before: 42M (cub + thrust + libcudacxx + cudax + c + examples + benchmarks) After: 53M (+python +ci +docs +.agent +test +configs) This completes the CCCL base needed for: - [muh-bench] items: ci/util/build_and_test_targets.sh for targeted builds - [CCCL-verify] items: python/cuda_cccl/tests/ as reference implementations - [CCCL-test] items: ci/test_cub.sh, ci/test_thrust.sh - Agent workflow: .agent/skills/ for consistent style and test patterns
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,95 @@
|
||||
# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
from host_benchmark_cases import (
|
||||
CALL_CASES,
|
||||
CASES,
|
||||
HostBenchmarkCase,
|
||||
patch_wrapper_to_skip_native_compute,
|
||||
synchronize,
|
||||
)
|
||||
|
||||
import cuda.compute as cc
|
||||
|
||||
pytest.importorskip("pytest_benchmark")
|
||||
|
||||
BUILD_TIME_ROUNDS = 10
|
||||
ONESHOT_ROUNDS = 20
|
||||
ONESHOT_ITERATIONS = 100
|
||||
TWOSHOT_ROUNDS = 20
|
||||
TWOSHOT_ITERATIONS = 1000
|
||||
|
||||
|
||||
def _case_params(cases: list[HostBenchmarkCase]) -> list[pytest.ParameterSet]:
|
||||
params = []
|
||||
for case in cases:
|
||||
marks = []
|
||||
if case.skip_reason is not None:
|
||||
marks.append(pytest.mark.skip(reason=case.skip_reason))
|
||||
params.append(pytest.param(case, id=case.name, marks=marks))
|
||||
return params
|
||||
|
||||
|
||||
@pytest.mark.benchmark(group="cuda.compute.host.build_time")
|
||||
@pytest.mark.parametrize("case", _case_params(CASES))
|
||||
def test_build_time(benchmark, case: HostBenchmarkCase):
|
||||
state = case.setup()
|
||||
synchronize()
|
||||
|
||||
def setup() -> None:
|
||||
cc.clear_all_caches()
|
||||
|
||||
def build():
|
||||
return case.make_wrapper(state)
|
||||
|
||||
benchmark.pedantic(
|
||||
build,
|
||||
setup=setup,
|
||||
rounds=BUILD_TIME_ROUNDS,
|
||||
iterations=1,
|
||||
warmup_rounds=0,
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.benchmark(group="cuda.compute.host.oneshot_cached")
|
||||
@pytest.mark.parametrize("case", _case_params(CALL_CASES))
|
||||
def test_oneshot_cached_host_overhead(benchmark, case: HostBenchmarkCase):
|
||||
cc.clear_all_caches()
|
||||
state = case.setup()
|
||||
wrapper = case.make_wrapper(state)
|
||||
patch_wrapper_to_skip_native_compute(wrapper, case.noop_return_kind)
|
||||
synchronize()
|
||||
|
||||
def call() -> None:
|
||||
case.oneshot(state)
|
||||
|
||||
benchmark.pedantic(
|
||||
call,
|
||||
rounds=ONESHOT_ROUNDS,
|
||||
iterations=ONESHOT_ITERATIONS,
|
||||
warmup_rounds=0,
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.benchmark(group="cuda.compute.host.twoshot_call")
|
||||
@pytest.mark.parametrize("case", _case_params(CALL_CASES))
|
||||
def test_twoshot_call_host_overhead(benchmark, case: HostBenchmarkCase):
|
||||
cc.clear_all_caches()
|
||||
state = case.setup()
|
||||
wrapper = case.make_wrapper(state)
|
||||
patch_wrapper_to_skip_native_compute(wrapper, case.noop_return_kind)
|
||||
synchronize()
|
||||
|
||||
def call() -> None:
|
||||
case.twoshot(state, wrapper)
|
||||
|
||||
benchmark.pedantic(
|
||||
call,
|
||||
rounds=TWOSHOT_ROUNDS,
|
||||
iterations=TWOSHOT_ITERATIONS,
|
||||
warmup_rounds=0,
|
||||
)
|
||||
Reference in New Issue
Block a user