Skip to content

feat(mars): add WITH_MARS platform and htcc wrapper - #941

Closed
Ceng23333 wants to merge 2 commits into
InfiniTensor:masterfrom
Ceng23333:feat/mars-platform-htcc
Closed

feat(mars): add WITH_MARS platform and htcc wrapper#941
Ceng23333 wants to merge 2 commits into
InfiniTensor:masterfrom
Ceng23333:feat/mars-platform-htcc

Conversation

@Ceng23333

@Ceng23333Ceng23333 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Enable WITH_MARS / HPCC auto-detect in root CMakeLists.txt, set htcc via scripts/htcc_wrapper.sh, and link HPCC runtime/DNN/BLAS/OpenMP.
  • Wire Mars into src/CMakeLists.txt source glob + DEVICE_LIST (no Mars op tree in this PR).
  • Register Device::Type::kMars in src/device.h, "mars" in src/pybind11_utils.h, and Mars entries in scripts/generate_wrappers.py / examples/runtime_api.h.
  • Stacked follow-ups: kernels (feat(mars): add native Mars operator specializations #942) and torch/smoke (fix(mars): enable torch bindings and CONTRIBUTING smoke #943). This PR intentionally excludes src/native/cuda/mars/ and torch host-compile plumbing.

Motivation

Mars/HPCC needs a dedicated InfiniOps backend (MetaX X203). Landing platform/toolchain first keeps the kernel PR reviewable in isolation and matches the MetaX split of CMake vs native/cuda/<vendor>/.

Stacked replacement for closed#939.

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

Note: Mars / HPCC (WITH_MARS) is the affected GPU backend; it is not yet a checkbox in this template. This PR only enables the platform/toolchain (no Mars operator specializations).

Smoke Test Result

Host: MetaX X203 / HPCC. Branch feat/mars-platform-htcc.

# Library-only smoke configure/build (no Mars ops tree yet; shared native/cuda/*.cc may compile)
cmake -S . -B build-mars-smoke \
-DWITH_CPU=ON -DWITH_MARS=ON \
-DAUTO_DETECT_DEVICES=OFF -DAUTO_DETECT_BACKENDS=OFF \
-DGENERATE_PYTHON_BINDINGS=OFF \
-DINFINI_OPS_SMOKE_BUILD=ON \
-DINFINI_RT_ROOT=<mars-rt-prefix> \
-DCMAKE_BUILD_TYPE=Release
# Configuring / Generating done
cmake --build build-mars-smoke --target infiniops --parallel $(nproc)
# Built target infiniops

Full python -m pytest tests -m smoke -q is claimed on stack tip #943 (requires kernels + torch enablement).

Test Results on Supported Platforms

PlatformAffectedBuild / Smoke ResultFull Result / Notes
NVIDIAnoN/A - not affected
IluvatarnoN/A - not affected
MetaXnoN/A - not affected
CambriconnoN/A - not affected
MoorenoN/A - not affected
AscendnoN/A - not affected
Mars/HPCC (WITH_MARS)yeslibrary smoke build (infiniops, INFINI_OPS_SMOKE_BUILD=ON)No Mars Operator<…, kMars> yet — see #942. Pytest smoke on #943.
Full `pytest` output (optional)
N/A — pytest smoke is on stack tip #943.

Benchmark / Performance Impact

N/A

Notes for Reviewers

Ceng23333and others added 2 commits August 24, 2026 10:01
Enable HPCC/Mars CMake detection, htcc compile wrapper, and device
registration without Mars operator specializations.
Defer WITH_MARS torch host compilation to the smoke follow-up PR.
Co-authored-by: Cursor <cursoragent@cursor.com>
@Ceng23333

Copy link
Copy Markdown
ContributorAuthor

Closing as already landed.

This platform/htcc layer shipped as part of the stack tip merge:

Do not merge this PR — it would be redundant with master.

Related: InfiniRT HPCC Mars dtype fix also landed — InfiniTensor/InfiniRT#46

Sign up for freeto 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

@Ceng23333