Support non-contiguous alloc in MemoryAllocator#2767
Conversation
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 enhances the memory allocation system by introducing a new configuration option, 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
The pull request introduces a new contiguous_alloc configuration option, defaulting to True, which controls whether batched memory allocations are performed contiguously or as individual allocations. This involved updating configuration files, argument parsing, memory manager constructors, and the AddressManager's batched_allocate method to conditionally handle non-contiguous allocation by iterating through individual allocations. Review feedback suggests improving the docstring for contiguous_alloc in L1MemoryManagerConfig for better consistency with CLI documentation and raises a potential performance concern regarding the current iterative approach for non-contiguous batched allocations, recommending exploration of more optimized individual allocation strategies.
maobaolong
left a comment
There was a problem hiding this comment.
LGTM, Thanks for the fix.
|
@ApostaC could you help take a look? |
ApostaC
left a comment
There was a problem hiding this comment.
I like the implementation in the AddressManager. My proposal is to have it become the default and completely discard the previous "contiguous" mode. In this case, we don't need to change the config and CLI, and don't need to pass down the new arguments all the way down to the address manager.
Additionally, please add UTs for the AddressManager.batched_allocate.
Signed-off-by: idellzheng <idellzheng@tencent.com>
Signed-off-by: idellzheng <idellzheng@tencent.com>
Signed-off-by: idellzheng <idellzheng@tencent.com>
Signed-off-by: idellzheng <idellzheng@tencent.com>
3d6b1d9 to
f52ab36
Compare
b691a8b to
72b8349
Compare
ApostaC
left a comment
There was a problem hiding this comment.
Please fix the issue in the logger output. Otherwise LGTM!
|
@ApostaC Thanks for your review, I have updated, could you help take a look again? |
* Support non-contiguous alloc in MemoryAllocator Signed-off-by: idellzheng <idellzheng@tencent.com> * optimeize lock cost Signed-off-by: idellzheng <idellzheng@tencent.com>
* Support non-contiguous alloc in MemoryAllocator Signed-off-by: idellzheng <idellzheng@tencent.com> * optimeize lock cost Signed-off-by: idellzheng <idellzheng@tencent.com> Signed-off-by: Aaron Wu <aaron.wu@dell.com>
* Support non-contiguous alloc in MemoryAllocator Signed-off-by: idellzheng <idellzheng@tencent.com> * optimeize lock cost Signed-off-by: idellzheng <idellzheng@tencent.com>
* Support non-contiguous alloc in MemoryAllocator Signed-off-by: idellzheng <idellzheng@tencent.com> * optimeize lock cost Signed-off-by: idellzheng <idellzheng@tencent.com>
* Support non-contiguous alloc in MemoryAllocator Signed-off-by: idellzheng <idellzheng@tencent.com> * optimeize lock cost Signed-off-by: idellzheng <idellzheng@tencent.com>
* Support non-contiguous alloc in MemoryAllocator Signed-off-by: idellzheng <idellzheng@tencent.com> * optimeize lock cost Signed-off-by: idellzheng <idellzheng@tencent.com>
* Support non-contiguous alloc in MemoryAllocator Signed-off-by: idellzheng <idellzheng@tencent.com> * optimeize lock cost Signed-off-by: idellzheng <idellzheng@tencent.com>
Support non-contiguous alloc in MemoryAllocator.
As the running time increases, the last block of each request will first be evicted each time, which will result in the inability to allocate large contiguous space in the future.