feat(mars): add native Mars kernels and htcc wrapper - #939
Closed
Ceng23333 wants to merge 2 commits into
Closed
Conversation
Port MetaX CUDA kernels to native/cuda/mars, compile .cc via htcc_wrapper, and link HPCC libhtomp so InfiniOps can build WITH_MARS.
1 task
…vice Compile Mars torch sources with system g++ (USE_HPCC) like MetaX/Moore, map TorchDeviceName to cuda, instantiate Mars torch backends, and keep htcc .cu rewrites beside sources so bindings includes resolve correctly. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
|
Superseded by a stacked PR split that isolates Mars kernels from platform/torch: Upstream (InfiniTensor/InfiniOps) — merge order
Fork base-branch stack (isolated diffs)
After #941 merges, retarget #942 → Closing this monolithic PR (#939) in favor of the stack. |
This was referenced 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
src/native/cuda/mars/(mirrorssrc/native/cuda/metax/layout).Operator<…, Device::Type::kMars>specializations reuse sharedsrc/native/cuda/ops/*/kernel.h(same pattern as metax — not#includeof metax headers).hcblas,scripts/htcc_wrapper.sh, CMakeWITH_MARS, htcc compile path.Motivation
Enable InfiniOps on MetaX X203 / HPCC Mars (
--device mars/ InfiniLM--refactor-dev) without going through the MetaX/MACA stack. Layout policy: Mars impl stays undersrc/native/cuda/mars/, sharing generic CUDA ops like metax.Closes # (none)
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) is the affected GPU backend; it is not yet a checkbox in this template.Smoke Test Result
Host: MetaX X203 / HPCC, container
infinilm-dev-refactor-dev(/opt/condatorch2.8.0+mars, HPCC).Branch
feat/mars-native-kernels-htcc@9805393.INFINI_RT_ROOT=/workspace/InfiniLM/build/integration/mars/prefix.Follow-up on this branch for smoke enablement:
g+++-DUSE_HPCC=1(MetaX/Moore pattern);TorchDeviceName<kMars>→"cuda";C10helper + generated/hand-written torch instantiations;htcc_wrapper.shplaces.cusymlinks beside sources (not/tmp).Test Results on Supported Platforms
WITH_MARS)pytest -m smokepassed (92 passed, 35 skipped)infinilm-dev-refactor-dev;--devices cuda(Mars torch).Full `pytest` output (optional)
Benchmark / Performance Impact
N/A
Notes for Reviewers
src/native/cuda/mars/and reusesrc/native/cuda/opslike metax; do not rewrite to#includemetax headers (Device::Type::kMarsvskMetax).masteras a Mars-only change (does not include the older linked/ops.json commits from the Cengrefactor-devline).pip install+pytest -m smoke) is green on this PR tip (9805393).