Refactor KV Cache Manager with a new torch exportable KVCache backend#400
Refactor KV Cache Manager with a new torch exportable KVCache backend#400geoffreyQiu wants to merge 28 commits into
Conversation
e4cdaf1 to
d070ab3
Compare
Greptile SummaryThis PR refactors the KV cache manager with a new pluggable
Confidence Score: 5/5The core backend abstraction, torch op schemas, and AOTI export path are logically correct; previously-flagged gaps have been addressed and the new findings are minor quality issues that do not affect correctness under normal usage. All three new findings are style or low-impact: a missing sleep in offload_flush that could cause CPU spinning on async backends, a duplicate dead-code guard, and an int64/int32 type mismatch in a from_blob call that is only exercised in the valid_len==0 branch where the value is zero regardless of interpretation. default_kvcache_backend.py (offload_flush busy-loop) and export_kvcache_runtime.cpp (type mismatch and dead-code guard) Important Files Changed
Reviews (19): Last reviewed commit: "Update the readme and doc" | Re-trigger Greptile |
418c283 to
799c55f
Compare
|
|
about the fbgemm update, i think main branch has some update. make sure it does not reverse the changes on main. |
Introduce KVCacheBackend, split the default Python backend from the public KVCacheManager facade, and add the initial export lookup path.
* Support PyTorch export and AOTI compile/package with test coverage. * Support C++ Torch runtime validation for AOTI-compiled KV-cache graphs. * Support Triton Inference Server validation using the PyTorch AOTI backend. * Add required KV-cache/runtime/custom-op plumbing and export fake-op shims.
* extract and simplify HSTU KV-cache export wrapper * remove stale debug instrumentation and export bring-up prints * standardize macro-gated logging in KV-cache runtime/binding/client code * rename AOTI ordering placeholder tensors consistently * clean C++ replay demo logging and CUDA check behavior * document end-to-end HSTU KV-cache AOTI C++ and Triton Server workflows
8469b9d to
c656a19
Compare
|
/build fbgemm devel |
|
❔ Pipeline #58380880 -- canceling
|
|
Final CI: pipeline
|
Description
Checklist