Skip to content

refactor(cuda): adapt InfiniLM GELU and sigmoid providers - #901

Merged
voltjia merged 1 commit into
feat/add-canonical-activation-providersfrom
refactor/adapt-infinilm-gelu-sigmoid-providers
Aug 7, 2026
Merged

refactor(cuda): adapt InfiniLM GELU and sigmoid providers#901
voltjia merged 1 commit into
feat/add-canonical-activation-providersfrom
refactor/adapt-infinilm-gelu-sigmoid-providers

Conversation

@voltjia

Copy link
Copy Markdown
Collaborator

Summary

  • Replace the standalone CUDA implementations behind GeluInfinilm, GelutanhInfinilm, and SigmoidInfinilm with thin adapters to the canonical providers introduced by feat(cuda): add canonical GELU and sigmoid providers #889.
  • Preserve the deprecated InfiniLM schemas and their existing tests; this PR changes provider ownership only.

Motivation

The deprecated compatibility operators should not retain separate CUDA kernels after canonical, open-source-aligned operators exist. Sharing the providers keeps legacy callers working while removing duplicate implementation paths.

Depends on #889.

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

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

cmake -S . -B build-adapters -DINFINI_OPS_OPS=gelu,gelu_infinilm,gelutanh_infinilm,sigmoid,sigmoid_infinilm
cmake --build build-adapters --parallel 8
# NVIDIA build passed

Test Results on Supported Platforms

PlatformAffectedBuild / Smoke ResultFull Result / Notes
NVIDIAYesfocused build passed247 passed, 173 skipped
IluvatarNoN/A - not affectedN/A
MetaXNoN/A - not affectedN/A
CambriconNoN/A - not affectedN/A
MooreNoN/A - not affectedN/A
AscendNoN/A - not affectedN/A
Focused pytest output
python3 -m pytest tests/test_gelu.py tests/test_gelu_infinilm.py tests/test_gelutanh_infinilm.py tests/test_sigmoid.py tests/test_sigmoid_infinilm.py -q
247 passed, 173 skipped in 1.71s

Benchmark / Performance Impact

N/A. This is provider reuse with no intended behavior or performance change.

Notes for Reviewers

Deprecated compatibility APICanonical targetAlignment basis
GeluInfinilm(input, approximate, out)Gelu(input, approximate, out)PyTorch torch.nn.functional.gelu(input, approximate='none')
GelutanhInfinilm(input, out)Gelu(input, tanh, out)PyTorch torch.nn.functional.gelu(..., approximate='tanh')
SigmoidInfinilm(input, out)Sigmoid(input, out)PyTorch torch.sigmoid(input, *, out=None)

InfiniOps keeps explicit output tensors per CONTRIBUTING.md. The legacy empty GELU approximation string is normalized to PyTorch's canonical none value before delegation.

@voltjia
voltjia merged commit 5600d68 into feat/add-canonical-activation-providersAug 7, 2026
6 checks passed
@voltjia
voltjia deleted the refactor/adapt-infinilm-gelu-sigmoid-providers branch August 7, 2026 11:11
voltjia added a commit that referenced this pull request Aug 7, 2026
* feat(ops): add canonical activation providers
* refactor(cuda): adapt InfiniLM GELU and sigmoid providers (#901)
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