Skip to content

feat(cuda): add canonical softmax providers - #890

Merged
voltjia merged 2 commits into
masterfrom
feat/add-canonical-softmax-provider
Aug 7, 2026
Merged

feat(cuda): add canonical softmax providers#890
voltjia merged 2 commits into
masterfrom
feat/add-canonical-softmax-provider

Conversation

@voltjia

Copy link
Copy Markdown
Collaborator

Summary

  • Add canonical Softmax CUDA providers for NVIDIA, Iluvatar, MetaX, and Moore.
  • Reuse one generic CUDA implementation and add focused coverage across dimensions, dtypes, and non-contiguous layouts.

Motivation

InfiniCore still uses the deprecated SoftmaxInfinilm compatibility operator. Canonical provider coverage is required before that adapter can migrate to the PyTorch-aligned Softmax API.

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

Smoke Test Result

Validated on ssh nvidia in accelerator-dev/nvidia:latest as part of the canonical-provider integration stack:

$ scripts/dev/build.sh nvidia --jobs 16
Build succeeded
$ python -m pytest tests/test_softmax.py --devices nvidia -q
24 passed

Test Results on Supported Platforms

PlatformAffectedBuild / Smoke ResultFull Result / Notes
NVIDIAYesbuild passed24 focused tests passed
IluvatarYesnot runplatform hardware unavailable; platform CI required
MetaXYesnot runplatform hardware unavailable; platform CI required
CambriconNoN/AN/A - not affected
MooreYesnot runplatform hardware unavailable; platform CI required
AscendNoN/AN/A - not affected

Benchmark / Performance Impact

N/A. The canonical providers reuse one generic implementation.

Notes for Reviewers

The public schema already existed; this PR adds native provider coverage and the metadata needed by the generic implementation.

InfiniOps APIAlignment targetEvidence
Softmax(input, dim, dtype, out)PyTorch torch.nn.functional.softmax(input, dim=None, _stacklevel=3, dtype=None)PyTorch softmax documentation

InfiniOps omits Python's internal _stacklevel argument and uses an explicit trailing output tensor for its C++ API. This PR does not add overloads or remove SoftmaxInfinilm. The vendor backend headers are thin wrappers around src/native/cuda/ops/softmax/kernel.h.

The NVIDIA result validates the NVIDIA provider and shared kernel. Iluvatar, MetaX, and Moore platform CI remain required.

@voltjia
voltjiaforce-pushed the feat/add-canonical-softmax-provider branch from eec65a1 to d153ad1CompareAugust 7, 2026 09:39
@voltjia
voltjia merged commit 978b457 into masterAug 7, 2026
19 checks passed
@voltjia
voltjia deleted the feat/add-canonical-softmax-provider branch August 7, 2026 11:18
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

@voltjia