Skip to content

fix(iluvatar): compile bindings without CMake CUDA language#613

Open
zhangyue207 wants to merge 1 commit into
masterfrom
fix/iluvatar-binding-build
Open

fix(iluvatar): compile bindings without CMake CUDA language#613
zhangyue207 wants to merge 1 commit into
masterfrom
fix/iluvatar-binding-build

Conversation

@zhangyue207
Copy link
Copy Markdown
Collaborator

Summary

  • Keep Iluvatar builds out of CMake's CUDA language path so CoreX clang++ is not invoked with CMake-added -x cuda for generated binding dispatch sources.
  • Compile only Iluvatar generated dispatch binding sources through explicit CoreX clang++ -x ivcore custom commands, while leaving NVIDIA and other backend paths unchanged.

Motivation

The generated .cc binding dispatch sources were forced onto CMake's CUDA source path for both NVIDIA and Iluvatar. On Iluvatar, CMake's CUDA language flow appends -x cuda, which can make CoreX clang++ segfault. This PR keeps Iluvatar on the working CoreX -x ivcore compile path without changing other hardware platforms.

Closes N/A

Type of Change

  • fix — bug fix
  • feat — new feature / new operator / new platform
  • 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

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

Test Results on Supported Platforms

Platform Built pytest Result Notes / Hardware
NVIDIA N/A N/A Not affected; NVIDIA CUDA source handling remains unchanged.
Iluvatar Yes Not run Verified compile and wheel install in infiniops-dev/iluvatar:latest with CoreX host mount.
MetaX N/A N/A Not affected.
Cambricon N/A N/A Not affected.
Moore N/A N/A Not affected.
Ascend N/A N/A Not affected.
Build output summary
cmake -S . -B /tmp/infiniops-iluvatar-bindings -G Ninja -DWITH_ILUVATAR=ON -DAUTO_DETECT_DEVICES=OFF -DAUTO_DETECT_BACKENDS=ON -DGENERATE_PYTHON_BINDINGS=ON
cmake --build /tmp/infiniops-iluvatar-bindings -j$(nproc)
# Completed: [198/198] Linking CXX shared module src/ops.cpython-310-x86_64-linux-gnu.so

python -m pip install . --no-build-isolation --no-deps
# Completed: built and installed infiniops-0.1.0-cp310-cp310-linux_x86_64.whl

Benchmark / Performance Impact

N/A. This is a build-path fix only.

Notes for Reviewers

The intended invariant is that NVIDIA still uses CMake LANGUAGE CUDA for generated binding sources, while Iluvatar uses explicit custom commands only for generated_dispatch*.cc. Ordinary generated pybind sources remain CXX for Iluvatar.


Checklist

Title, Branch, and Commits

  • PR title follows Conventional Commits.
  • Branch name follows <type>/xxx-yyyy-zzzz.
  • Each commit message follows Conventional Commits.
  • Small PR is a single squashable commit.
  • No stray merge commits from master; branch is based on origin/master.
  • No fixup! / squash! / wip commits remain.

Scope and Design

  • Changes are minimal and limited to CMakeLists.txt and src/CMakeLists.txt.
  • No dead code, commented-out blocks, debug prints, or ownerless TODOs were added.
  • No unrelated formatting churn was introduced.
  • Public API changes: N/A, no public API is changed.

General Code Hygiene

  • Comments were added only to explain the non-obvious Iluvatar compiler path.
  • Modified files end with a trailing newline.
  • git diff --check HEAD~1 HEAD passes.
  • Comments and error messages are in English.
  • Comments and error messages are complete sentences where applicable.

C++ Specific

N/A. No C++ source/header files were changed.

Python Specific

N/A. No Python files were changed.

Testing

  • Iluvatar build was run locally and recorded above.
  • Platforms not tested are marked N/A because their build paths are not changed.
  • N/A: No new operator functionality was added.
  • N/A: No new tests were added.
  • N/A: This is a build-system regression fix; the regression is covered by the Iluvatar binding build command above.

Build, CI, and Tooling

  • The project builds cleanly from a fresh CMake directory for Iluvatar with generated Python bindings.
  • pip install . --no-build-isolation --no-deps succeeds in the Iluvatar development image.
  • N/A: No new backend/device was added.
  • Existing CUDA-like backend mutual exclusion is unchanged.
  • N/A: clang-format.yml and ruff.yml do not apply to the modified CMake files.
  • No new runtime dependency was added.

Documentation

  • N/A: No user-visible API, operator, or public utility behavior changed.

Security and Safety

  • No secrets, access tokens, internal URLs, customer data, or personal hardware identifiers have been committed.
  • N/A: No third-party code was added.
  • No unsafe pointer arithmetic, uninitialized reads, or missing bounds checks were introduced.

@zhangyue207 zhangyue207 requested a review from a team May 19, 2026 05:48
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