[BugFix]: dataloader_multithread test to propagate shard thread failures as non-zero exit code - #505
Open
levxn wants to merge 1 commit into
Open
Conversation
… non-zero exit code
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.
Motivation
Fixes #499: Dataloader tests don't check return value, can return false positive
Technical Details
std::vector<std::thread>withstd::vector<std::future<int>>, launching each shard viastd::async(std::launch::async, thread_func, ...)instead ofstd::thread.future::get(), which blocks until each shard completes and returns its actual status.main()now returns a non-zero exit code instead of always returning0.Test Plan
Built rocAL with the HIP backend, then manually forced a shard failure by requesting more GPU ids than physically exist (
num_shards=3 num_gpus=3on a machine with 2 GPUs), so the third shard'srocalCreatefails cleanly. Compared exit codes before and after the fix using the same repro command.Test Result
Before the fix, the shard failure is printed but the process still exits
0:[ERR] {rocalCreate} Failed to init the Rocal context, { MasterGraph } ERROR: HIP Device(%d) out of range2 Could not create the Rocal context exit code: 0After the fix, the same failure is now detected and surfaced as a non-zero exit code:
[ERR] {rocalCreate} Failed to init the Rocal context, { MasterGraph } ERROR: HIP Device(%d) out of range2 Could not create the Rocal context shard_id: 2 failed with status -1 exit code: 255