Skip to content

fix: pass vendor includes to torch object builds#788

Open
voltjia wants to merge 1 commit into
masterfrom
fix/moore-torch-musa-include
Open

fix: pass vendor includes to torch object builds#788
voltjia wants to merge 1 commit into
masterfrom
fix/moore-torch-musa-include

Conversation

@voltjia

@voltjia voltjia commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Pass vendor SDK include paths to generated torch object builds in src/CMakeLists.txt when they are compiled with the system C++ compiler.
  • Add MetaX ${MACA_PATH}/include and Moore ${MUSA_ROOT}/include to the custom torch compile command so InfiniRT vendor runtime headers can resolve their SDK headers.

Motivation

Fixes the Moore CI failure observed on PR #785 after #787 updated InfiniRT runtime API usage. The failing compile command for generated torch wrappers included InfiniRT headers but not /usr/local/musa/include, so infini/rt/detail/native/cuda/moore/runtime_.h failed to include musa_runtime.h.

No GitHub issue is linked; this addresses CI failure https://github.com/InfiniTensor/InfiniOps/actions/runs/28645999081/job/84952627941?pr=785.

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 locally.

Moore and MetaX smoke builds require vendor runners/SDKs and were not runnable in this Windows Codex environment. The Moore PR CI is expected to validate the real wheel build path that previously failed.

Test Results on Supported Platforms

Platform Affected Build / Smoke Result Full Result / Notes
NVIDIA No N/A - not affected N/A
Iluvatar No N/A - not affected N/A
MetaX Yes Not run locally - requires vendor SDK/runner Include path only; CI/shadow CI should validate
Cambricon No N/A - not affected N/A
Moore Yes Not run locally - requires Moore SDK/runner Target fix for musa_runtime.h CI failure
Ascend No N/A - not affected N/A
Full `pytest` output (optional)
N/A - no local pytest run. `cmake` is not on PATH in this Windows Codex environment, and the bundled Python does not include `pytest`.

Benchmark / Performance Impact

N/A. This only changes include flags for generated torch object compilation.

Notes for Reviewers

Please focus on the custom system-compiler path under WITH_METAX OR WITH_MOORE. Normal target include directories do not automatically apply to these custom commands, so vendor SDK include paths need to be passed explicitly alongside InfiniRT and Torch includes.

@voltjia voltjia marked this pull request as ready for review July 3, 2026 08:53
@voltjia voltjia requested a review from a team July 3, 2026 08:53
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