[MP] Enable layout desc in MP lookup and prefetch#2662
Conversation
Signed-off-by: ApostaC <yihua98@uchicago.edu>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the caching mechanism by integrating memory layout descriptions into prefetch operations. It achieves this by introducing model-specific metadata tracking for registered GPU instances, allowing for dynamic derivation of memory layouts. The changes also involve updating communication protocols to carry this new metadata and streamlining lookup requests, ensuring a more robust and efficient distributed caching system. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively enables the use of layout_desc in multiprocess lookup and prefetch operations. It achieves this by incorporating model_name and world_size metadata during GPU context registration, which is then used to derive the memory layout description. The simplification of the LOOKUP protocol to handle a single key is a good cleanup, and all related components, including tests, have been updated accordingly. The changes are logical and well-executed. I have a couple of suggestions to enhance performance and reduce code duplication.
Signed-off-by: ApostaC <yihua98@uchicago.edu>
Signed-off-by: ApostaC <yihua98@uchicago.edu>
| kv_caches: KVCache, | ||
| model_name: str, | ||
| world_size: int, | ||
| ) -> None: |
There was a problem hiding this comment.
Any rationales behind adding model_name and world_size?
There was a problem hiding this comment.
Other part (changing key to single instead of multiple) LGTM
There was a problem hiding this comment.
It needs this to figure out how to determine the "layout spec" when allocating the prefetch buffer in L1.
* Enable layout desc in prefetch Signed-off-by: ApostaC <yihua98@uchicago.edu> * fix unit tests Signed-off-by: ApostaC <yihua98@uchicago.edu> * remove unused worker id in schedulr adapter Signed-off-by: ApostaC <yihua98@uchicago.edu> --------- Signed-off-by: ApostaC <yihua98@uchicago.edu> Co-authored-by: Jiayi Yao <82156730+YaoJiayi@users.noreply.github.com>
* Enable layout desc in prefetch Signed-off-by: ApostaC <yihua98@uchicago.edu> * fix unit tests Signed-off-by: ApostaC <yihua98@uchicago.edu> * remove unused worker id in schedulr adapter Signed-off-by: ApostaC <yihua98@uchicago.edu> --------- Signed-off-by: ApostaC <yihua98@uchicago.edu> Co-authored-by: Jiayi Yao <82156730+YaoJiayi@users.noreply.github.com> Signed-off-by: Ofer Kiselov Nahman <ofer.kiselovnahman@weka.io>
* Enable layout desc in prefetch Signed-off-by: ApostaC <yihua98@uchicago.edu> * fix unit tests Signed-off-by: ApostaC <yihua98@uchicago.edu> * remove unused worker id in schedulr adapter Signed-off-by: ApostaC <yihua98@uchicago.edu> --------- Signed-off-by: ApostaC <yihua98@uchicago.edu> Co-authored-by: Jiayi Yao <82156730+YaoJiayi@users.noreply.github.com>
* Enable layout desc in prefetch Signed-off-by: ApostaC <yihua98@uchicago.edu> * fix unit tests Signed-off-by: ApostaC <yihua98@uchicago.edu> * remove unused worker id in schedulr adapter Signed-off-by: ApostaC <yihua98@uchicago.edu> --------- Signed-off-by: ApostaC <yihua98@uchicago.edu> Co-authored-by: Jiayi Yao <82156730+YaoJiayi@users.noreply.github.com>
* Enable layout desc in prefetch Signed-off-by: ApostaC <yihua98@uchicago.edu> * fix unit tests Signed-off-by: ApostaC <yihua98@uchicago.edu> * remove unused worker id in schedulr adapter Signed-off-by: ApostaC <yihua98@uchicago.edu> --------- Signed-off-by: ApostaC <yihua98@uchicago.edu> Co-authored-by: Jiayi Yao <82156730+YaoJiayi@users.noreply.github.com> Signed-off-by: shaoxiawjc <wjc2800@163.com>
* Enable layout desc in prefetch Signed-off-by: ApostaC <yihua98@uchicago.edu> * fix unit tests Signed-off-by: ApostaC <yihua98@uchicago.edu> * remove unused worker id in schedulr adapter Signed-off-by: ApostaC <yihua98@uchicago.edu> --------- Signed-off-by: ApostaC <yihua98@uchicago.edu> Co-authored-by: Jiayi Yao <82156730+YaoJiayi@users.noreply.github.com> Signed-off-by: Aaron Wu <aaron.wu@dell.com>
* Enable layout desc in prefetch Signed-off-by: ApostaC <yihua98@uchicago.edu> * fix unit tests Signed-off-by: ApostaC <yihua98@uchicago.edu> * remove unused worker id in schedulr adapter Signed-off-by: ApostaC <yihua98@uchicago.edu> --------- Signed-off-by: ApostaC <yihua98@uchicago.edu> Co-authored-by: Jiayi Yao <82156730+YaoJiayi@users.noreply.github.com>
* Enable layout desc in prefetch Signed-off-by: ApostaC <yihua98@uchicago.edu> * fix unit tests Signed-off-by: ApostaC <yihua98@uchicago.edu> * remove unused worker id in schedulr adapter Signed-off-by: ApostaC <yihua98@uchicago.edu> --------- Signed-off-by: ApostaC <yihua98@uchicago.edu> Co-authored-by: Jiayi Yao <82156730+YaoJiayi@users.noreply.github.com>
Summary
layout_desctostorage_manager.submit_prefetch_task()in bothMPCacheEngine.lookupandBlendEngine.cb_lookup_pre_computed, preparing for future PrefetchController implementationgpu_context_metadict toMPCacheEngineand_cb_gpu_context_metatoBlendEngineto track(model_name, world_size)per registered GPU instance, enabling layout desc derivation during lookup/prefetchREGISTER_KV_CACHEandCB_REGISTER_KV_CACHEprotocols to carrymodel_nameandworld_sizeLOOKUPprotocol fromlist[KeyType]to singleKeyTypepayloadget_layout_desc()helper to replace inline layout construction instore()vllm_multi_process_adapter.pyto passmodel_name/world_sizeduring registration and use single-key LOOKUPTest plan
pytest tests/v1/multiprocess/test_mq.py— 10/10 passedpytest tests/v1/multiprocess/test_cache_server.py— 8/8 passedpytest tests/v1/multiprocess/test_blend_server.py— 21/21 passed