Skip to content

fix: support legacy CUDA graph instantiate#26

Closed
voltjia wants to merge 1 commit into
masterfrom
fix/cuda-graph-instantiate-compat
Closed

fix: support legacy CUDA graph instantiate#26
voltjia wants to merge 1 commit into
masterfrom
fix/cuda-graph-instantiate-compat

Conversation

@voltjia

@voltjia voltjia commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Keep the public GraphInstantiate(GraphExec*, Graph) runtime API while compiling against CUDA-compatible runtimes that expose either the newer two-argument cudaGraphInstantiate signature or the legacy five-argument signature.
  • Apply the compatibility wrapper to src/native/cuda/nvidia/runtime_.h and src/native/cuda/iluvatar/runtime_.h.

Motivation

InfiniTensor/InfiniOps#790 fails in the Iluvatar unit CI after InfiniRT PR #9 because the job installs InfiniRT from master and builds with CoreX 4.3 / CUDA 10.2-compatible headers. In that environment, cudaGraphInstantiate is declared as:

cudaGraphInstantiate(cudaGraphExec_t*, cudaGraph_t, cudaGraphNode_t*, char*, size_t)

The generated InfiniRT dispatch validates and calls GraphInstantiate(GraphExec*, Graph), so the previous direct forwarding lambda fails to compile against those headers.

Related: #25 fixes the same downstream CI failure by removing unverified Iluvatar graph support. This PR is the alternative path if maintainers want to keep the Iluvatar graph API exposed and fix the compile-time signature mismatch instead.

Type of Change

  • feat - new feature / new operator / new platform
  • fix - bug fix
  • perf - performance improvement (no behavioral change)
  • refactor - code restructuring without behavior change
  • test - adding or fixing tests only
  • docs - documentation only
  • build / ci - build system or CI configuration
  • chore - tooling, formatting, or other non-code changes
  • Breaking change (requires a ! in the Conventional Commits prefix or a BREAKING CHANGE: footer)

Platforms Affected

  • CPU (WITH_CPU)
  • NVIDIA (WITH_NVIDIA)
  • Iluvatar (WITH_ILUVATAR)
  • MetaX (WITH_METAX)
  • Cambricon (WITH_CAMBRICON)
  • Moore (WITH_MOORE)
  • Ascend (WITH_ASCEND)
  • PyTorch C++ bindings (WITH_TORCH)
  • Build system / CMake / CI
  • Python bindings / user-facing API

Smoke Test Result

git diff --check
# passed

C:\Users\huang\.cache\codex-runtimes\codex-primary-runtime\dependencies\python\python.exe -m py_compile scripts\generate_public_headers.py
# passed

C:\Users\huang\.cache\codex-runtimes\codex-primary-runtime\dependencies\python\python.exe scripts\generate_public_headers.py --output-dir C:\Users\huang\.codex\visualizations\2026\07\10\019f49e9-fdde-70f0-a3dc-1837693cfd9e\generated-check\include --source-output C:\Users\huang\.codex\visualizations\2026\07\10\019f49e9-fdde-70f0-a3dc-1837693cfd9e\generated-check\src\runtime_dispatch.cc --devices nvidia iluvatar
# passed

Test Results on Supported Platforms

Platform Affected Build / Smoke Result Full Result / Notes
NVIDIA Yes Not run locally; PR CI clang-format, ruff, and docs build passed. The wrapper keeps the two-argument CUDA path when that overload exists.
Iluvatar Yes Not run locally; this Windows workspace does not have cmake, a C++ compiler, CUDA, or the Iluvatar CoreX SDK in PATH. Needs Iluvatar/CoreX CI validation if this approach is preferred over #25.
MetaX No N/A - not affected N/A
Cambricon No N/A - not affected N/A
Moore No N/A - not affected N/A
Ascend No N/A - not affected N/A
Full `pytest` output (optional)
N/A - backend pytest was not run locally.

Benchmark / Performance Impact

N/A - this is a compile-time compatibility fix for graph runtime API forwarding.

Notes for Reviewers

@voltjia

voltjia commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator Author

Closing this for now because #25 provides the current conservative fix by removing the unverified Iluvatar graph runtime support. The compatibility-wrapper approach in this PR is not needed while #25 is the chosen path.

@voltjia voltjia closed this Jul 10, 2026
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