-
Notifications
You must be signed in to change notification settings - Fork 104
Add accumulate method for PortChannel
#784
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
Changho Hwang (chhwang)
wants to merge
9
commits into
fix/ethernet-receiver-close-race
Choose a base branch
from
chhwang/new-atomic-add
base: fix/ethernet-receiver-close-race
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
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6363f6f
Encode trigger types as opcodes instead of flags
chhwang ccab6d7
Add `accumulate` method for `PortChannel`
chhwang 706ee4b
Harden PortChannel accumulate validation and tests
chhwang 2add990
Consolidate accumulate tests
chhwang 6a10c8a
Merge branch 'main' into chhwang/new-atomic-add
chhwang d5ed2f5
Resolve accumulate follow-up semantics
chhwang 02a6e81
Merge remote-tracking branch 'origin/fix/ethernet-receiver-close-race…
chhwang 2875555
Restore standalone Ethernet accumulate validation test
chhwang 4ddf179
Synchronize accumulate wraparound initialization
chhwang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| #include <mscclpp/gpu.hpp> | ||
|
|
||
| #if defined(MSCCLPP_USE_ROCM) | ||
|
|
||
| #include <mscclpp/atomic_device.hpp> | ||
| #include <mscclpp/gpu_utils.hpp> | ||
|
|
||
| #include "context.hpp" | ||
|
|
||
| namespace mscclpp { | ||
|
|
||
| // System-scope modulo-2^64 atomic add. | ||
| __global__ void accumulateU64Kernel(uint64_t* dst, uint64_t value) { | ||
| (void)atomicFetchAdd<uint64_t, scopeSystem>(dst, value, memoryOrderRelaxed); | ||
| } | ||
|
|
||
| void CudaIpcStream::accumulate(uint64_t* dst, uint64_t value) { | ||
| CudaDeviceGuard deviceGuard(deviceId_); | ||
| setStreamIfNeeded(); | ||
| // Submit to this connection's stream, which orders the add ahead of any signal or flush that | ||
| // follows. On ROCm a kernel runs while the caller's kernel occupies the GPU, so the proxy does | ||
| // not wait for the caller. | ||
| accumulateU64Kernel<<<1, 1, 0, *stream_>>>(dst, value); | ||
| MSCCLPP_CUDATHROW(cudaGetLastError()); | ||
| dirty_ = true; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why need to set dirty here? It will be reset some where? |
||
| } | ||
|
|
||
| } // namespace mscclpp | ||
|
|
||
| #endif // defined(MSCCLPP_USE_ROCM) | ||
Oops, something went wrong.
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.
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.
Do we need to reserve 5 here? You mean user may build customized algo with old API?
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.
It's just unused so unassigned, but probably we'd better reserve for a future operation. Will do