Uh oh!
There was an error while loading. Please reload this page.
feat(cambricon): link Apex silu_and_mul - #876
Merged
voltjia merged 3 commits intoAug 7, 2026
Merged
Conversation
voltjiaforce-pushed
the
feat/linked-cambricon-silu-and-mul
branch
from
August 4, 2026 04:16
8bc996f to
dd31ddbComparevoltjiaforce-pushed
the
feat/linked-cambricon-silu-and-mul
branch
from
August 6, 2026 01:30
dd31ddb to
2e781a5Comparevoltjiaforce-pushed
the
feat/linked-cambricon-silu-and-mul
branch
from
August 6, 2026 08:44
2e781a5 to
518e385Comparevoltjiaforce-pushed
the
feat/linked-cambricon-silu-and-mul
branch
from
August 6, 2026 08:49
518e385 to
b9ca02cComparesilu_and_mulvoltjiaforce-pushed
the
feat/linked-cambricon-silu-and-mul
branch
from
August 6, 2026 09:18
b9ca02c to
c2bbc2dComparevoltjia
marked this pull request as ready for review
August 6, 2026 09:20
19 tasks
Ziminli
approved these changes
Aug 6, 2026
whjthu
approved these changes
Aug 7, 2026
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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
silu_and_mulas implementation slot16.TorchSiluAndMul<Backend>for tensor wrapping, contiguous staging, and output copy-back.C10<Device::Type::kCambricon>to bind the caller's CNRT queue to a C10 stream guard.ApexSiluAndMul::Call.Motivation
The Cambricon Apex package exports packed SiLU-and-multiply semantics through:
Linking that exported ABI avoids copying the vendor kernel into InfiniOps while preserving the existing
silu_and_mul(input, out)public interface.Depends on #875. N/A - no linked issue.
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 changesPlatforms Affected
WITH_CPU)WITH_NVIDIA)WITH_ILUVATAR)WITH_METAX)WITH_CAMBRICON)WITH_MOORE)WITH_ASCEND)WITH_HYGON)WITH_TORCH)Smoke Test Result
Vendor environment:
ssh cambriconcambricon/pytorch:v1.25.3-torch2.1-anolisos8.8-py310sha256:d3544201bc7039f328abf137d154b24a89a17fdd48a487dc0ae0bdd6d14a5cf6apex==0.1+mlu0.8.0Runtime evidence collected at
2e781a5b:At
b9ca02c6, both Cambricon main CI and Cambricon shadow CI passed. Current headd0eac65donly renames the logical mapping fromapextoapex_glu_activationand updates its binding. Build, formatting, Ruff, and the main Cambricon/Ascend/Moore/MetaX jobs pass; the remaining self-hosted jobs are pending.Test Results on Supported Platforms
Focused host-independent validation at
c2bbc2df:Benchmark / Performance Impact
N/A - this PR validates correctness and linkage; it makes no performance claim.
Notes for Reviewers
ApexSiluAndMulinheritsC10<Device::Type::kCambricon>and supplies only the external ABI call.apex_glu_activationidentifies the concreteglu_activation*.soDSO; other Apex DSOs use separate mappings, such asapex_fused_layer_norm.C10<Device::Type::kCambricon>usestorch_mlu::getStreamFromExternalandc10::StreamGuard, so execution stays on the caller-provided stream.ApexSiluAndMul::Callmaps those details to the shared output-oriented adapter.WITH_TORCH=OFFdisables the generated ATen backend. The linked implementation still uses the installed Torch/torch-mlu C++ ABI required by the external library.readelfwithout demangling #875 because its GNUreadelfdoes not provide--demangle.