-
Notifications
You must be signed in to change notification settings - Fork 87
feat: optimize kv cache load/offload. #306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
17797ce to
034f86e
Compare
7cd5bd4 to
d4446aa
Compare
RobbieLeung
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
90457da to
b996af0
Compare
| "", | ||
| "The address of the kv cache store metadata service."); | ||
|
|
||
| DEFINE_string(store_local_hostname, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the different between store_metadata_server and store_local_hostname.
| } | ||
| } | ||
| if (is_completed) { | ||
| close_future.wait(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: If is_completed was set to false above, does that mean we no longer need to wait() on close_future here?
how brpc to handle stream_handler in this case
And by the way, how can we ensure that multiple batches are delivered in order or received in order?
| int Stream::synchronize() const { | ||
| #if defined(USE_NPU) | ||
| return aclrtSynchronizeStream(stream_.stream()); | ||
| return aclrtSynchronizeStreamWithTimeout(stream_.stream(), timeout_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in which case we need timeout? and what happen if timeout.
| std::move(copy_out_blocks_async(input.input_params))); | ||
| { | ||
| std::lock_guard<std::mutex> lock(mutex_); | ||
| if (layer_wise_load_synchronizer_.count(input.input_params.batch_id) != |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can we dont use lock here ? just a suggestion
629d719 to
1c0f9a2
Compare
| std::vector<BlockTransferInfo> block_transfer_info; | ||
| proto_to_block_transfer_info(*req, block_transfer_info); | ||
|
|
||
| copy_threadpool_.schedule( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactor to bthread
1c0f9a2 to
e5ba51f
Compare
| proto_to_block_transfer_info(*req, block_transfer_info); | ||
|
|
||
| auto future = worker_->load_kv_blocks_from_store_async(dst_blocks); | ||
| BThreadPool::get_instance().schedule( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need BThreadPool here, just bthread_start_background, bthread.join
e5ba51f to
fb9d1c4
Compare
fb9d1c4 to
8c05d99
Compare
walsonyang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
8c05d99 to
82627cd
Compare
walsonyang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
88b12ae to
b9cc794
Compare
b9cc794 to
49d7280
Compare
49d7280 to
881bfaa
Compare
881bfaa to
86c9bc0
Compare
No description provided.