Skip to content

refactor(ops): name Infinilm replacements - #915

Closed
voltjia wants to merge 1 commit into
masterfrom
refactor/name-infinilm-replacements
Closed

refactor(ops): name Infinilm replacements#915
voltjia wants to merge 1 commit into
masterfrom
refactor/name-infinilm-replacements

Conversation

@voltjia

@voltjia voltjia commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Replace generic deprecation diagnostics on seven Infinilm compatibility operators with their concrete canonical replacements.
  • Keep the legacy classes, signatures, providers, and tests unchanged.
  • Leave the four interfaces without a complete single-operator replacement on the generic migration diagnostic.

Motivation

The canonical destinations for convolution, paged cache writes, decode/prefill attention, copies, batched top-k/top-p sampling, and zero filling are now present on master. Their deprecated compatibility APIs should name those destinations directly so compiler diagnostics provide actionable migration guidance.

No issue is linked. PR #893 was closed separately after the post-#911 audit because it targeted the retired vLLM v0.6.3 paged_attention_v1 wrapper and duplicated the maintained FlashAttention replacement path.

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

Only compile-time deprecation text changes. Runtime behavior is unchanged on every platform.

Smoke Test Result

Remote environment: ssh nvidia, image accelerator-dev/nvidia:latest, with the existing InfiniRT prefix and /tmp CUTLASS source.

$ CMAKE_BUILD_PARALLEL_LEVEL=8 python3 -m pip install . \
    --no-build-isolation --no-deps \
    -C cmake.define.INFINI_RT_ROOT=/opt/infinirt \
    -C cmake.define.AUTO_DETECT_DEVICES=OFF \
    -C cmake.define.AUTO_DETECT_BACKENDS=OFF \
    -C cmake.define.WITH_CPU=ON \
    -C cmake.define.WITH_NVIDIA=ON \
    -C cmake.define.WITH_LINKED=OFF \
    -C cmake.define.WITH_TORCH=OFF \
    -C cmake.define.FETCHCONTENT_SOURCE_DIR_CUTLASS=/opt/cutlass \
    -C cmake.define.INFINI_OPS_OPS=conv_infinilm,paged_attention_infinilm,paged_attention_prefill_infinilm,paged_caching_infinilm,rearrange_infinilm,top_k_top_p_sample_infinilm,zeros_infinilm
Successfully built InfiniOps

$ python3 -m pytest \
    tests/test_conv_infinilm.py \
    tests/test_paged_attention_infinilm.py \
    tests/test_paged_attention_prefill_infinilm.py \
    tests/test_paged_caching_infinilm.py \
    tests/test_rearrange_infinilm.py \
    tests/test_top_k_top_p_sample_infinilm.py \
    tests/test_zeros_infinilm.py \
    --devices cpu cuda -q
236 passed, 192 skipped in 16.68s

The skips are the existing unsupported device/operator combinations in the legacy test matrix.

Test Results on Supported Platforms

Platform Affected Build / Smoke Result Full Result / Notes
NVIDIA Yes focused build and tests passed Included in 236 passed; no runtime change
Iluvatar Yes strict wrapper generation passed Header-only diagnostic change; hardware not run
MetaX Yes strict wrapper generation passed Header-only diagnostic change; hardware not run
Cambricon No N/A - not affected N/A - no provider for these compatibility APIs
Moore Yes strict wrapper generation passed Header-only diagnostic change; hardware not run
Ascend Yes strict wrapper generation passed Header-only diagnostic change; hardware not run

Additional checks:

clang-format 21.1.8 --dry-run --Werror <seven changed headers>
passed

python3 scripts/generate_wrappers.py \
  --devices nvidia iluvatar metax moore \
  --ops conv_infinilm paged_attention_infinilm \
        paged_attention_prefill_infinilm paged_caching_infinilm \
        rearrange_infinilm zeros_infinilm \
  --strict-ops
passed

python3 scripts/generate_wrappers.py \
  --devices cpu ascend \
  --ops top_k_top_p_sample_infinilm \
  --strict-ops
passed

python3 -m pytest tests/test_generate_wrappers.py -q
25 passed in 1.08s

Benchmark / Performance Impact

N/A. No executable implementation changes.

Notes for Reviewers

Replacement alignment

Deprecated API Canonical replacement Open-source alignment evidence Migration note
ConvInfinilm Convolution PyTorch torch.convolution and fixed ATen schema Existing adapter supplies transposed=false, zero output_padding, and reorders stride/padding.
PagedCachingInfinilm ReshapeAndCacheFlash vLLM reshape_and_cache_flash Consumers must adopt the canonical FlashAttention cache layout.
PagedAttentionInfinilm FlashAttnWithKvcache FlashAttention flash_attn_with_kvcache Consumers use the matching canonical cache layout; the NVIDIA provider is linked from the installed DSO.
PagedAttentionPrefillInfinilm FlashAttnVarlenFunc FlashAttention flash_attn_varlen_func Paged KV, block tables, and ALiBi are supported by the linked provider merged in #911.
RearrangeInfinilm Copy PyTorch Tensor.copy_ The old contract is the non_blocking=false subset.
TopKTopPSampleInfinilm TopKTopPSamplingFromLogits FlashInfer top_k_top_p_sampling_from_logits Callers materialize per-batch top_k / top_p tensors and pass the canonical explicit attributes.
ZerosInfinilm Fill with value 0 PyTorch Tensor.fill_ InfiniOps retains the caller-provided trailing output convention.

CausalSoftmaxInfinilm, ScaledSoftmaxInfinilm, KvCachingInfinilm, and RandomSampleInfinilm retain the generic diagnostic because no single stable public operator completely represents their existing contracts. This PR does not invent an approximate replacement or add an overload.

@voltjia
voltjia requested a review from a team August 9, 2026 01:03
@voltjia

voltjia commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

Closing per scope prioritization: this PR only improves deprecation diagnostics and is not required for the functional InfiniLM migration. Continuing with the remaining executable migration work first.

@voltjia voltjia closed this Aug 9, 2026
Sign up for free to 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