Skip to content

feat: add CUDA Samples compatibility testing - #51

Open
baominghelly wants to merge 7 commits into
masterfrom
compatibility_adapter_only
Open

feat: add CUDA Samples compatibility testing#51
baominghelly wants to merge 7 commits into
masterfrom
compatibility_adapter_only

Conversation

@baominghelly

@baominghelly baominghelly commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add a compatibility adapter that builds and runs selected CUDA Samples
  • add submodules/cuda-samples from spike-zhu/cuda-samples, pinned at 7b601789, so compatibility tests no longer depend on an InfiniPerf checkout
  • reuse the shared hardware platform layer for platform aliases, compiler discovery, and device visibility
  • support CUDA, MetaX, and CoreX build configuration without adding framework-specific Megatron, vLLM, or InfiniLM paths
  • keep compatibility-specific architecture and Make arguments in infinibench.common.constants
  • leave Hygon and Moore Threads unconfigured for follow-up support instead of classifying them as unsupported

Review fixes

  • run samples from the executable directory so companion kernels and data files resolve correctly
  • resolve sample binaries to absolute paths so relative cuda_samples_dir configurations run correctly with the binary working directory
  • enforce the requested architecture at the generated CMake target level
  • exclude CMake aggregation manifests and parent-dependent libNVVM children from standalone sample counts
  • reject empty sample filters before metric calculation
  • preserve the DTK/Hygon-specific marker requirement when detecting hipcc
  • keep Ascend and Cambricon platform detection when sharing the hardware detection table
  • let cmake_maca own MetaX CUDA toolchain detection, unset CUDACXX for the wrapper process, and isolate each wrapper workspace with WCUDA_HOME

CoreX architecture fix

  • target BI-V150/TG150 with ivcore11
  • use ivcore11 consistently in CUDA Samples compile/link arguments and the hardware benchmark CMake build
  • add a regression test that locks the CoreX default and compile/link flags to ivcore11
  • document how to override sms and make_args together for other Iluvatar architectures

The previous invalid device function failures were caused by compiling TG150 kernels for ivcore20. Rebuilding the same workloads for ivcore11 resolves the runtime failures.

Setup

git submodule update --init --depth 1 submodules/cuda-samples

The adapter uses this submodule by default. cuda_samples_dir remains available for explicitly testing another CUDA Samples checkout.

Validation

  • compatibility adapter tests reduced from 437 to 308 lines by consolidating duplicate cases while retaining regression coverage
  • latest validated commit: d852fc7b
  • python -m pytest -q: 100 passed
  • black --check . with Black 23.9.1: passed
  • flake8 .: passed
  • python -m compileall -q infinibench tests: passed
  • git diff --check: passed
  • bash -n infinibench/hardware/cuda-memory-benchmark/build.sh: passed
  • clean clone plus shallow submodule initialization: passed
  • pinned CUDA Samples 7b601789: 193 standalone projects discovered; no Tegra aggregate or parent-dependent libNVVM children included

Hardware results

  • MetaX C550 GPU 0, default submodule with auto -> cmake_maca: clock, matrixMul, and vectorAdd compiled and ran successfully (3/3 compile, 3/3 run); no compute process before or after validation
  • Iluvatar BI-V150/TG150 GPU 0 with ivcore11, default submodule with auto -> cmake:
    • clock, matrixMul, and vectorAdd compiled successfully (3/3)
    • all three samples ran successfully (3/3)
    • hardware STREAM passed: Copy 540.94 GB/s, Scale 480.91 GB/s, Add 302.73 GB/s, Triad 295.57 GB/s
    • no compute process before or after validation

A100 retesting was not run because all 8 GPUs had active compute processes during the idle-GPU safety check.

@baominghelly
baominghelly force-pushed the compatibility_adapter_only branch 2 times, most recently from c197b8b to 60cc809 Compare August 8, 2026 14:12
@baominghelly
baominghelly marked this pull request as ready for review August 10, 2026 03:24
@baominghelly
baominghelly force-pushed the compatibility_adapter_only branch from a0ecaa5 to 21dd43a Compare August 10, 2026 06:33
@baominghelly
baominghelly force-pushed the compatibility_adapter_only branch from c744055 to 3f592e3 Compare August 10, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant