Skip to content

feat(mars): add native Mars operator specializations - #942

Closed
Ceng23333 wants to merge 3 commits into
InfiniTensor:masterfrom
Ceng23333:feat/mars-native-kernels
Closed

feat(mars): add native Mars operator specializations#942
Ceng23333 wants to merge 3 commits into
InfiniTensor:masterfrom
Ceng23333:feat/mars-native-kernels

Conversation

@Ceng23333

@Ceng23333 Ceng23333 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Motivation

Isolate Mars kernel / operator review from platform toolchain and torch bindings. Layout policy matches MetaX: vendor tree under src/native/cuda/mars/, shared CUDA ops under src/native/cuda/ops.

Depends on #941 (feat/mars-platform-htcc).

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) — native operator specializations only. Template has no Mars checkbox yet.

Smoke Test Result

Requires #941 merged or stacked head. Host: MetaX X203 / HPCC.

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
cmake --build build-mars-smoke --target infiniops --parallel $(nproc)
# Built target infiniops (Mars Operator<…, kMars> specializations linked)

Full pytest -m smoke is on #943.

Test Results on Supported Platforms

Platform Affected Build / Smoke Result Full Result / Notes
NVIDIA no N/A - not affected
Iluvatar no N/A - not affected
MetaX no N/A - not affected
Cambricon no N/A - not affected
Moore no N/A - not affected
Ascend no N/A - not affected
Mars/HPCC (WITH_MARS) yes library smoke build passed (infiniops, INFINI_OPS_SMOKE_BUILD=ON) Pytest smoke on #943. Smoke allowlist ops without Mars ports (e.g. cast/cat/linear/matmul) remain skip-until-ported.
Full `pytest` output (optional)
N/A — pytest smoke is on stack tip #943.

Benchmark / Performance Impact

N/A

Notes for Reviewers

Ceng23333 and others added 3 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>
Thin Operator<…, kMars> wrappers under src/native/cuda/mars/ mirroring
metax, reusing shared native/cuda/ops kernels plus HCBLAS gemm glue.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Ceng23333

Copy link
Copy Markdown
Contributor Author

Closing as already landed.

This native-kernels 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

@Ceng23333 Ceng23333 closed this Aug 24, 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