feat:add shard-level thread pool for parallel H2H transfers && sglang integration - #1292
Open
lc1314555 wants to merge 3 commits into
Open
feat:add shard-level thread pool for parallel H2H transfers && sglang integration#1292lc1314555 wants to merge 3 commits into
lc1314555 wants to merge 3 commits into
Conversation
lc1314555
requested review from
Infinite666,
Wwwzff,
harrisonyhq,
mag1c-h,
qyh111 and
ygwpz
as code owners
August 27, 2026 08:05
qyh111
approved these changes
Aug 31, 2026
qyh111
self-requested a review
August 31, 2026 02:52
qyh111
requested changes
Aug 31, 2026
| h2hCompletionPool_ | ||
| .SetNWorker(1) | ||
| .SetWorkerFn([this](H2HDumpContextPtr& context, void* const&) { | ||
| CompleteH2HDump(std::move(context)); |
Contributor
There was a problem hiding this comment.
建议考虑将本 PR 新增的 H2H 复制能力抽象为独立的 HostCopyStream,而不是由 LoadQueue 和 DumpQueue 分别直接持有 ThreadPool 并实现 scatter/gather。
当前 h2hCopyPool_、worker 初始化、任务排队以及 HostToHostScatter/Gather 分散在 Load/Dump 两条路径中,使业务队列同时负责请求状态编排和底层复制执行。后续若需要增加 NUMA affinity、替换 memcpy 实现、统一流控或增加同步接口,需要在两处重复修改。
建议让 HostCopy 抽象负责 worker 生命周期、H2H copy/scatter/gather 和 completion;LoadQueue/DumpQueue 只保留 backend 协调、buffer 状态以及请求级 pending/failure 聚合。另外需要明确该抽象是单 worker FIFO “stream”,还是多 worker 无序 “executor”,避免调用方错误依赖 stream ordering。某种程度上可以参考simustream的写法
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
This PR adds shard-level Host-to-Host (H2H) thread pools to CacheStore and integrates the H2H path with SGLang HiCache.
In the SGLang integration, one page corresponds to one CacheStore shard. Multiple pages can therefore be copied concurrently by different H2H workers.
CacheStore H2H thread pools
Added the following configuration options: