Repository navigation
test(rccl): add host microtests for src/ras/diagnostics_gpu.cc #12436
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
Merged
aduforest
merged 10 commits into
develop
from
users/aduforest/ras-diagnostics-gpu-host-microtests
Oct 12, 2026
Merged
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a6a2e40
test(rccl): add host microtests for diagnostics_gpu.cc
aduforest 94f5168
test(rccl): cover diagnostics gpu failure paths
aduforest 0489e66
Merge develop and preserve both RAS and tuning test registration
aduforest aa4008f
test(rccl): address RAS diagnostics review feedback
aduforest 84007e7
Merge develop and update GPU diagnostics NVML test fakes
aduforest 8355d9c
Merge develop after diagnostics host tests
aduforest aeb2e02
test(rccl): cover NVIDIA graphics driver diagnostics
aduforest 5283ff8
Merge develop after ras_param host tests
aduforest c205110
Merge remote-tracking branch 'origin/develop' into fix/12436-merge-de…
aduforest 7d8f57b
Merge remote-tracking branch 'origin/develop' into users/aduforest/ra…
aduforest 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
55 changes: 55 additions & 0 deletions
55
projects/rccl/test/host/fakes/ras_diagnostics_test_support.h
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,55 @@ | ||
| #ifndef RCCL_TEST_HOST_RAS_DIAGNOSTICS_TEST_SUPPORT_H_ | ||
| #define RCCL_TEST_HOST_RAS_DIAGNOSTICS_TEST_SUPPORT_H_ | ||
|
|
||
| #include <memory> | ||
| #include <string> | ||
| #include <vector> | ||
|
|
||
| #include "comm.h" | ||
| #include "ras/diagnostics.h" | ||
| #include "fakes/ras_registry_test_support.h" | ||
|
|
||
| namespace ras_test { | ||
|
|
||
| struct OwnedComm { | ||
| OwnedComm(uint64_t commHash, uint64_t hostHash, uint64_t pidHash, int rank, bool peerInfoValid = true) | ||
| : comm(std::make_unique<ncclComm>()), peers(std::make_unique<ncclPeerInfo[]>(1)) { | ||
| comm->commHash = commHash; | ||
| comm->peerInfo = peers.get(); | ||
| comm->peerInfoValid = peerInfoValid; | ||
| comm->rank = rank; | ||
| comm->nRanks = 8; | ||
| comm->cudaDev = rank + 10; | ||
| comm->nvmlDev = rank + 20; | ||
| comm->busId = 0x1000 + rank; | ||
| comm->localRank = rank % 4; | ||
| comm->localRanks = 4; | ||
| peers[0].hostHash = hostHash; | ||
| peers[0].pidHash = pidHash; | ||
| } | ||
|
|
||
| std::unique_ptr<ncclComm> comm; | ||
| std::unique_ptr<ncclPeerInfo[]> peers; | ||
| }; | ||
|
|
||
| struct ReporterState { | ||
| std::vector<std::string> lines; | ||
| ncclResult_t emitResult = ncclSuccess; | ||
| int calls = 0; | ||
| int failCall = 0; | ||
| }; | ||
|
|
||
| inline ncclResult_t CaptureReport(void* target, const char* line) { | ||
| auto* state = static_cast<ReporterState*>(target); | ||
| state->lines.emplace_back(line); | ||
| ++state->calls; | ||
| return state->failCall == 0 || state->calls == state->failCall ? state->emitResult : ncclSuccess; | ||
| } | ||
|
|
||
| inline rasDiagnosticsReporter MakeReporter(ReporterState* state) { | ||
| return rasDiagnosticsReporter{CaptureReport, nullptr, state}; | ||
| } | ||
|
|
||
| } | ||
|
|
||
| #endif |
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,34 @@ | ||
| #ifndef RCCL_TEST_HOST_RAS_REGISTRY_TEST_SUPPORT_H_ | ||
| #define RCCL_TEST_HOST_RAS_REGISTRY_TEST_SUPPORT_H_ | ||
|
|
||
| #include <cstdlib> | ||
| #include <mutex> | ||
| #include <vector> | ||
|
|
||
| #include <gtest/gtest.h> | ||
| #include "ras/ras_internal.h" | ||
|
|
||
| namespace ras_test { | ||
|
|
||
| inline void InstallNcclComms(const std::vector<ncclComm*>& comms) { | ||
| std::lock_guard<std::mutex> lock(ncclCommsMutex); | ||
| auto** replacement = static_cast<ncclComm**>(std::calloc(comms.empty() ? 1 : comms.size(), sizeof(ncclComm*))); | ||
| ASSERT_NE(nullptr, replacement); | ||
| std::free(ncclComms); | ||
| ncclComms = replacement; | ||
| nNcclComms = static_cast<int>(comms.size()); | ||
| ncclCommsSorted = false; | ||
| for (size_t index = 0; index < comms.size(); ++index) ncclComms[index] = comms[index]; | ||
| } | ||
|
|
||
| inline void ResetNcclComms() { | ||
| std::lock_guard<std::mutex> lock(ncclCommsMutex); | ||
| std::free(ncclComms); | ||
| ncclComms = nullptr; | ||
| nNcclComms = 0; | ||
| ncclCommsSorted = false; | ||
| } | ||
|
|
||
| } | ||
|
|
||
| #endif |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.