feat(runtime): add explicit asynchronous tensor copy support - #1457
Open
qinyiqun wants to merge 2 commits into
Open
feat(runtime): add explicit asynchronous tensor copy support#1457qinyiqun wants to merge 2 commits into
qinyiqun wants to merge 2 commits into
Conversation
PanZezhong1725
requested changes
Aug 10, 2026
| } | ||
|
|
||
| // ↑↑↑ 重新封装 cub api,减少模板参数,方便调用 | ||
| // ↓↓↓ Random sampling keeps token indices in a 32-bit workspace and casts only at the output boundary. |
Collaborator
There was a problem hiding this comment.
为什么这个PR里有random sample的更改
| if (this != &other) { | ||
| // Clean up current resources | ||
| if (event_ != nullptr) { | ||
| Device current_device = context::getDevice(); |
Collaborator
|
如果tensor涉及event同步,我建议直接给tensor加一个hook基建,如果tensor有event需要同步,在access data的时候自动调event同步,避免外部手动同步。这样可以无需增加新的copy from async |
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.
This PR adds explicit asynchronous tensor copy support required by overlapped
decode execution in InfiniLM.
It separates asynchronous transfer behavior from the existing synchronous
Tensor::copy_fromAPI, keeping the common tensor runtime predictable andbackend-neutral.