fix(mars): enable torch bindings and CONTRIBUTING smoke - #943
Merged
Conversation
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>
Compile Mars torch sources with system g++ (USE_HPCC), map TorchDeviceName to cuda, and instantiate Mars torch backends. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Aug 24, 2026
voltjia
approved these changes
Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
g+++-DUSE_HPCC=1/ HPCC includes (same MetaX/Moore pattern for vendor-forked torch headers).TorchDeviceName<Device::Type::kMars>→"cuda"insrc/torch/device_.handsrc/torch/mars/c10.hstream helpers.scripts/generate_torch_ops.py(kMarsin_DEVICE_TYPES/_C10_DEVICE_TYPES) and hand-written torch instantiations undersrc/torch/ops/*/.*.cc.cu) in.gitignore.Motivation
CONTRIBUTING smoke (
pip install .[dev]+pytest -m smoke) needs Python bindings and Mars torch device mapping. Keep that plumbing out of the kernel PR (#942).Depends on #942 (kernels) and #941 (platform).
Type of Change
feat— new feature / new operator / new platformfix— bug fixperf— performance improvement (no behavioral change)refactor— code restructuring without behavior changetest— adding or fixing tests onlydocs— documentation onlybuild/ci— build system or CI configurationchore— tooling, formatting, or other non-code changes!in the Conventional Commits prefix or aBREAKING CHANGE:footer)Platforms Affected
WITH_CPU)WITH_NVIDIA)WITH_ILUVATAR)WITH_METAX)WITH_CAMBRICON)WITH_MOORE)WITH_ASCEND)WITH_TORCH)Note: Mars / HPCC (
WITH_MARS) — torch bindings / CONTRIBUTING smoke enablement.Smoke Test Result
Host: MetaX X203 / HPCC, container
infinilm-dev-refactor-dev(/opt/condatorch2.8.0+mars, HPCC).Branch
feat/mars-torch-smoke(stack tip).INFINI_RT_ROOT= InfiniLM Mars integration prefix.Test Results on Supported Platforms
WITH_MARS)pytest -m smokepassed (92 passed, 35 skipped)--devices cuda(Mars torch). Skips are N/A/env/other-backend or missing Mars ports (cast/cat/linear/matmul), not regressions.Full `pytest` output (optional)
Benchmark / Performance Impact
N/A
Notes for Reviewers
master.