This directory contains standalone C++ tests and benchmarks. Build artifacts are
produced under tests/cpp/build.
tests/cpp/
├── unit/ # GoogleTest sources
│ ├── cuda/ # CUDA/cuBLAS tests
│ ├── memory/ # Memory operation tests (sources only unless wired in CMake)
│ ├── network/ # Network/messaging tests (sources only unless wired in CMake)
│ ├── backend/ # Backend scheduling/dispatch tests
│ ├── worker/ # Worker/XtGemm tests
│ └── zerocopy/ # Zero-copy buffer tests
│
├── bench/ # Google Benchmark sources
│ ├── cuda/ # CUDA benchmarks
│ └── zerocopy/ # Zero-copy benchmarks
│
└── integration/ # Integration tests
Note: Only targets explicitly listed in
tests/cpp/CMakeLists.txtare built. The catalog below reflects the current executable targets.
Default CMake behavior:
ENABLE_CUDA_TESTS=ON(CUDA/cuBLAS tests)ENABLE_XTGEMM_TESTS=OFF(XtGemm worker tests + CUDA benchmarks)ENABLE_GREEN_CTX_TESTS=OFF(green context runtime tests)ENABLE_ZEROCOPY_TESTS=OFF(zerocopy tests + benchmarks)
The Docker image enables all suites:
cmake -S tests/cpp -B tests/cpp/build \
-DENABLE_CUDA_TESTS=ON \
-DENABLE_XTGEMM_TESTS=ON \
-DENABLE_GREEN_CTX_TESTS=ON \
-DENABLE_ZEROCOPY_TESTS=ON
cmake --build tests/cpp/build -j- CUDA tests: require CUDA toolkit + runtime.
- XtGemm/green-context tests and benchmarks: require CUDA driver API availability and compatible GPU support (CUDA driver 12.5+; green contexts use 2-SM granularity on CC 8.x and 8-SM granularity on CC 9.0+).
- Zerocopy tests/benchmarks: require protobuf generation, Torch, and CUDA for the pinned-pool test.
test_worker_base(unit/worker)test_green_trace_parser(unit/worker)
test_dispatch_gate(unit/backend)
test_gemm_args_layout(unit/intercept) — GemmArgs layout check (#48)
test_checkpoint_multifile(unit/checkpoint) — multi-fileReadCheckpointconsistency check (#49)
test_cublas_hostalloc_directtest_cublas_hostregister_posixtest_cublas_error15_repro
test_xtgemm_workertest_green_context_runtime(ENABLE_GREEN_CTX_TESTS=ON; requires CUDA driver 12.5+)
test_barrier_integration
test_aligned_buffer_pooltest_serialization_buffertest_scatter_gather_buffertest_matrix_partitiontest_device_profile_roundtriptest_profile_delta_logtest_device_measurement_servicetest_device_measurement_sessiontest_cuda_pinned_pool(requires CUDA runtime)
bench_xtgemm_workerbench_green_ctxbench_trace_switchbench_pool_dispatchbench_pool_allocationbench_serialization
Tests are automatically built in the Docker image. You can run them via the helper script or execute binaries directly.
# Run all test_* binaries (benchmarks are NOT included)
./tests/run_cpp_tests.sh
# Run subsets
./tests/run_cpp_tests.sh unit
./tests/run_cpp_tests.sh cuda
./tests/run_cpp_tests.sh workerThe script only runs
test_*executables. Benchmarks (bench_*) must be run directly.
cd tests/cpp/build
# Example tests
./test_worker_base
./test_xtgemm_worker
./test_aligned_buffer_pool
# Example benchmarks
./bench_xtgemm_worker
./bench_serialization# Option A: exec into existing container
docker exec -it <container_id> bash -lc "cd /app && ./tests/run_cpp_tests.sh"
# Option B: one-shot run
docker run --rm --gpus=all --ulimit memlock=-1 --cap-add IPC_LOCK \
-v "$(pwd)":/app -w /app device-emulator:latest \
bash -lc "./tests/run_cpp_tests.sh"Run individual binaries inside the container as needed:
docker run --rm --gpus=all --ulimit memlock=-1 device-emulator:latest \
/app/tests/cpp/build/test_xtgemm_worker--ulimit memlock=-1 is required by any binary that exercises the proxy
server's pinned-buffer pools (zerocopy tests, measurement-session tests,
xtgemm tests). See issue #59.