[CCCL] 瘦身 + 补全: 移除 cudax/python/libcudacxx-tests 冗余文件, 新增 c2h 测试助手 + cmake 构建系统 + 8 个 CUDA thrust examples

变更摘要:
- 删除: cudax/ (783 files, 7.2M) — 实验性组件,竞赛不需要
- 删除: python/ (226 files, 2.0M) — Python 绑定,竞赛不需要
- 删除: libcudacxx/{test,benchmarks,codegen,cmake,share} (4432 files, 31M)
  保留: libcudacxx/include/ (1463 headers, cuda::std 编译依赖)
- 新增: c2h/ (27 files) — CUB Catch2 测试辅助头文件,编译 243 个测试必需
- 新增: cmake/ (29 files) — CCCL 原生 CMake 构建系统
- 新增: thrust/examples/cuda/ (7 files) + cpp_integration/ (1 file)
  async_reduce, custom_temporary_allocation, explicit_cuda_stream,
  global_device_vector, range_view, unwrap_pointer, wrap_pointer, device

结果: cccl_upstream 从 74M→35M (瘦身 53%), 核心内容 100% 保留:
  27/27 tuning headers, 78 benchmarks, 243 tests,
  60 thrust examples, 18 CUB examples, 全部编译头文件
This commit is contained in:
muh-bot
2026-08-03 12:39:26 +00:00
parent a2a5dd8f00
commit 24ef6a91b5
5439 changed files with 0 additions and 719516 deletions

View File

@@ -1,147 +0,0 @@
# cuda.compute Benchmarks
Compare Python `cuda.compute` performance against C++ CUB implementations.
## Setup
This project uses [pixi](https://pixi.sh) to manage environments and dependencies.
Two environments are available:
- **`wheel`** - Uses the released `cuda-cccl` package
- **`source`** - Builds `cuda-cccl` from the local repository
### Build C++ Benchmarks
Build CUB benchmarks using the CI script (one-time, ~13 minutes):
```bash
cd /path/to/cccl
./ci/build_cub.sh -arch 89 # Use your GPU arch (89=RTX 4090, 80=A100, 90=H100)
```
Binaries are built to: `build/cub/bin/`
## Run Benchmarks
### Using pixi tasks
```bash
# Run Python benchmarks (released cuda-cccl)
pixi run -e wheel bench
# Run Python benchmarks (local source build)
pixi run -e source bench
# Run Python benchmarks with reduced parameter set
pixi run -e wheel bench-quick
# Run just one benchmark
pixi run -e wheel bench -b transform/fill
# Run C++ benchmarks
pixi run -e wheel bench-cpp
# Run both Python and C++ benchmarks
pixi run -e wheel bench-all
```
### Using run_benchmarks.py directly
```bash
# Run both C++ and Python (default)
pixi run -e wheel python run_benchmarks.py -b transform/fill -d 0
# Run only C++
pixi run -e wheel python run_benchmarks.py -b transform/fill --cpp
# Run only Python
pixi run -e wheel python run_benchmarks.py -b transform/fill --py
# Show help
pixi run -e wheel python run_benchmarks.py --help
```
To run the benchmarks using the "quick" configuration:
```bash
pixi run -e wheel python run_benchmarks.py --quick
```
## Compare Results
```bash
pixi run -e wheel python analysis/python_vs_cpp_summary.py -b transform/fill
```
## Web Report
A simple page used to visualize a set of results.
- Requires `results/` to be populated with benchmark results.
First generate a manifest:
```bash
pixi run -e wheel python analysis/generate_web_report_manifest.py \
--results-dir results \
--output results/manifest.json
```
Build the web report single file app:
```bash
cd analysis/web-report
npm install
npm run build
```
This will output a single file app to `analysis/web-report/dist/` copy it to the `results/` directory and:
```bash
cd results/
python3 -m http.server
```
Now its possible to share the results directory as a zip/tar file.
## Manual Usage
### List benchmark configurations
```bash
# Python
pixi run -e wheel python transform/fill.py --list
# C++
/path/to/cccl/build/cub/bin/cub.bench.transform.fill.base --list
```
### Run with custom options
```bash
# Python - specific type and size
pixi run -e wheel python transform/fill.py --axis "T=I32" --axis "Elements[pow2]=20" --devices 0
# C++ - save JSON
/path/to/cccl/build/cub/bin/cub.bench.transform.fill.base \
--json results/transform/fill_cpp.json \
--devices 0
```
### Compare manually
```bash
pixi run -e wheel python analysis/python_vs_cpp_summary.py \
results/transform/fill_py.json \
results/transform/fill_cpp.json \
--device 0
```
## AI commands
These are using the .opencode folder but can be moved to other Agents.
### /migration-status
Generates a report of the migration status for each benchmark in CUB.