-
Notifications
You must be signed in to change notification settings - Fork 19
feat: device registration #103
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
Open
kilinchange
wants to merge
7
commits into
master
Choose a base branch
from
device_registry
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
ee4e27b to
2e2b4c3
Compare
c60d854 to
ab3274a
Compare
f0b0494 to
2b5ad33
Compare
Collaborator
Author
…tics - Split internal implementation headers into a separate include group - Drop redundant explicit default initialization for Device - Add `impl` suffix to CUDA guard implementation files - Unify Arange initialization via DeviceGuardImpl
eaacac4 to
7a43321
Compare
chen2021673
reviewed
Feb 9, 2026
|
|
||
| // stream | ||
| Stream *CudaGuardImpl::GetStream(Device device) const { | ||
| std::call_once(device_stream_flags.at(device.index()), InitSingleStream, device); |
Contributor
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.
call_once生命周期是进程级别的,这里可能有点风险(但不大,p4级修复)
chen2021673
reviewed
Feb 10, 2026
- Drop legacy hardware-specific branching - Convert DeviceGuardImpl base methods to fatal-only fallbacks - Explicitly implement supported CPU runtime behaviors - Validate CUDA device type and index bounds in CudaGuardImpl - Widen DeviceCount return type to prevent truncation
1f1247f to
e2c91ef
Compare
| streams.push_back(dynamic_cast<const CudaDevice *>(device)->Stream()); | ||
| comms.push_back(device_comm_map_.at(device)); | ||
| streams.push_back(dynamic_cast<infini_train::core::cuda::CudaStream *>( | ||
| core::GetDeviceGuardImpl(device.type())->GetStream(device)) |
Contributor
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.
获取Stream的地方很多,是不是也封装一个function,可以放在和GetDeviceGuardImpl同一个位置
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.

device 注册设计文档:https://gxtctab8no8.feishu.cn/docx/F0CzdkVXCoaxRgxYc3AcFewtnOc?from=from_copylink
Device 现在是一个只维护 type/index 的简单类型,所有运行时方法都由 DeviceGuard/DeviceGuardImpl 提供。
本次 pr 涉及主要改动: