Skip to content

refactor(cuda): adapt ConvInfinilm to Convolution - #898

Merged
voltjia merged 2 commits into
masterfrom
refactor/adapt-conv-infinilm-to-convolution
Aug 7, 2026
Merged

refactor(cuda): adapt ConvInfinilm to Convolution#898
voltjia merged 2 commits into
masterfrom
refactor/adapt-conv-infinilm-to-convolution

Conversation

@voltjia

Copy link
Copy Markdown
Collaborator

Summary

  • Implement the deprecated CUDA-family ConvInfinilm provider as a thin adapter over canonical Convolution.
  • Remove duplicate convolution metadata allocation and kernel dispatch while preserving the legacy base interface and tests.

Motivation

ConvInfinilm represents the non-transposed, zero-output-padding subset of the PyTorch-aligned Convolution operator added in #882. This PR makes the canonical provider the single implementation while retaining the deprecated InfiniLM compatibility entry point.

This is a stacked PR based on #887 because canonical Convolution must copy current InfiniRT metadata views into owning metadata before it can be constructed.

No issue is closed by this PR.

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

NVIDIA validation used accelerator-dev/nvidia:latest on an A100 host. The tested stack was #887 followed by this PR:

cmake -S /workspace/InfiniOps -B /workspace/InfiniOps/build-adapters \
-G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CUDA_ARCHITECTURES=80 \
-DWITH_NVIDIA=ON -DGENERATE_PYTHON_BINDINGS=ON \
-DINFINI_RT_ROOT=/opt/infinirt \
-DINFINI_OPS_OPS=convolution,conv_infinilm \
-DFETCHCONTENT_SOURCE_DIR_CUTLASS=/tmp/cutlass-src
cmake --build /workspace/InfiniOps/build-adapters --target ops --parallel 8
python3 -m pytest tests/test_convolution.py tests/test_conv_infinilm.py \
--devices nvidia -q
36 passed in 2.18s

Repository checks:

clang-format 21.1.8 --dry-run --Werror: passed
ruff 0.15.22 check: passed
ruff 0.15.22 format --check: 148 files already formatted
python -X utf8 scripts/generate_wrappers.py \
--devices nvidia iluvatar metax moore \
--ops convolution conv_infinilm --strict-ops
passed

Test Results on Supported Platforms

PlatformAffectedBuild / Smoke ResultFull Result / Notes
NVIDIAYesfocused stacked ops build passed36 focused tests passed on A100
IluvatarYesstrict wrapper generation passedNative hardware not available; platform CI/owner validation required
MetaXYesstrict wrapper generation passedNative hardware not available; platform CI/owner validation required
CambriconNoN/A - not affectedN/A - not affected
MooreYesstrict wrapper generation passedNative hardware not available; platform CI/owner validation required
AscendNoN/A - not affectedN/A - not affected
Full focused `pytest` output
Running 36 items in this shard
.................................... [100%]
36 passed in 2.18s

Benchmark / Performance Impact

N/A. The adapter calls the same canonical convolution kernel and this PR makes no performance claim.

Notes for Reviewers

Alignment table

Legacy interfaceCanonical interfaceOpen-source target
ConvInfinilm(input, weight, bias, padding, stride, dilation, groups, out)Convolution(input, weight, bias, stride, padding, dilation, transposed=false, output_padding=zeros, groups, out)PyTorch ATen convolution schema
  • The adapter only reorders existing attributes and supplies the subset constants transposed=false and zero output_padding.
  • The legacy class, public signature, backend registrations, and tests remain in place and remain deprecated.
  • The adapter forwards the selected stream to the cached CudaConv<Backend, Convolution> provider before every call.
  • Review fix(ops): copy convolution tensor metadata views #887 first; this PR intentionally contains no copy of its metadata-view fix.

Base automatically changed from fix/conv-metadata-view-copy to masterAugust 7, 2026 07:24
@voltjia
voltjia marked this pull request as ready for review August 7, 2026 07:25
@voltjia
voltjia requested a review from a teamAugust 7, 2026 07:25
@voltjiavoltjia changed the title refactor(cuda): adapt conv infinilm to convolutionrefactor(cuda): adapt ConvInfinilm to ConvolutionAug 7, 2026
@voltjia
voltjia merged commit 26ad741 into masterAug 7, 2026
6 checks passed
@voltjia
voltjia deleted the refactor/adapt-conv-infinilm-to-convolution branch August 7, 2026 07:25
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