feat(ops): add vLLM-aligned reshape_and_cache_flash - #883
Merged
Conversation
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 free
to 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
ReshapeAndCacheFlashoperator and Python binding surface aligned with vLLM's publicreshape_and_cache_flashwrapper.PagedCachingInfinilm, without changing or removing the legacy public API.Motivation
PagedCachingInfinilmis an InfiniLM compatibility API. This PR adds a canonical serving-framework-aligned replacement so consumers can migrate without removing the deprecated interface.No issue is linked; this is part of the ongoing InfiniLM operator migration.
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 changes!in the Conventional Commits prefix or aBREAKING CHANGE:footer)Platforms Affected
WITH_CPU)WITH_NVIDIA)WITH_ILUVATAR)WITH_METAX)WITH_CAMBRICON)WITH_MOORE)WITH_ASCEND)WITH_TORCH)API Alignment
reshape_and_cache_flash(key, value, slot_mapping, k_scale, v_scale, kv_cache_dtype, key_cache, value_cache) -> voidreshape_and_cache_flash(key, value, key_cache, value_cache, slot_mapping, kv_cache_dtype, k_scale, v_scale) -> Nonekey_cache/value_cacheoutputs to the end, as required byCONTRIBUTING.md.All eight material upstream parameters are represented. This PR adds one canonical overload.
Smoke Test Result
Remote environment:
ssh nvidia, imageaccelerator-dev/nvidia:latest.Test Results on Supported Platforms
Focused test output
The 30 skips are the existing
PagedCachingInfinilmtests on CPU, where that operator has no implementation.Benchmark / Performance Impact
N/A. This PR adds an interface and reuses the existing cache-write kernel; it does not claim a performance change.
Notes for Reviewers
kv_cache_dtype == "auto". FP8/NVFP4 behavior can be added later without changing the public signature.PagedCachingInfinilmremains deprecated and source-compatible. Its launcher directly includes the canonicalreshape_and_cache_flash/kernel.cuh; no forwarding header or extra compatibility layer is introduced.clang-format==21.1.8andruff==0.15.22.