-
Notifications
You must be signed in to change notification settings - Fork 905
Add/update multi node/multi GPU test scripts #2410
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
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3fd1932
Refactor unit testing scripts
dierksen 3db7ace
add mpirun prefix for multi-gpu tests
dierksen a9f9513
shellcheck fixes
dierksen 48b4003
Remove a couple of allreduce tests for now
dierksen fedbea5
Address PR review feedback
dierksen 0904bdd
Add test env setup missed in refactor
dierksen 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -eo pipefail | ||
|
|
||
| # Get the directory where this script is located | ||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| # Source test environment setup (handles package overrides like TVM-FFI) | ||
| source "${SCRIPT_DIR}/setup_test_env.sh" | ||
|
|
||
| # Source common test functions | ||
| # shellcheck disable=SC1091 # File exists, checked separately | ||
| source "${SCRIPT_DIR}/test_utils.sh" | ||
|
|
||
| # Find and filter test files based on pytest.ini exclusions | ||
| find_test_files() { | ||
| echo "Reading pytest.ini for excluded directories..." | ||
| EXCLUDED_DIRS="" | ||
| if [ -f "./pytest.ini" ]; then | ||
| # Extract norecursedirs from pytest.ini and convert to array | ||
| NORECURSEDIRS=$(grep "^norecursedirs" ./pytest.ini | sed 's/norecursedirs\s*=\s*//' | sed 's/#.*//') | ||
| if [ -n "$NORECURSEDIRS" ]; then | ||
| EXCLUDED_DIRS=$(echo "$NORECURSEDIRS" | tr ',' ' ' | tr -s ' ') | ||
| echo "⚠️ WARNING: Excluding directories from pytest.ini: $EXCLUDED_DIRS" | ||
| echo "" | ||
| fi | ||
| fi | ||
|
|
||
| echo "Finding all test_*.py files in tests/ directory..." | ||
|
|
||
| # Find all test_*.py files | ||
| ALL_TEST_FILES=$(find tests/ -name "test_*.py" -type f | sort) | ||
|
|
||
| # Filter out excluded files based on directory exclusions | ||
| TEST_FILES="" | ||
| for test_file in $ALL_TEST_FILES; do | ||
| exclude_file=false | ||
| test_dir=$(dirname "$test_file") | ||
|
|
||
| for excluded_dir in $EXCLUDED_DIRS; do | ||
| excluded_dir=$(echo "$excluded_dir" | xargs) # trim whitespace | ||
| if [ -n "$excluded_dir" ]; then | ||
| # Check if this file's directory should be excluded | ||
| if [[ "$test_dir" == *"/$excluded_dir" ]] || [[ "$test_dir" == "tests/$excluded_dir" ]] || [[ "$test_dir" == *"/$excluded_dir/"* ]]; then | ||
| exclude_file=true | ||
| break | ||
| fi | ||
| fi | ||
| done | ||
|
|
||
| if [ "$exclude_file" = false ]; then | ||
| TEST_FILES="$TEST_FILES $test_file" | ||
| fi | ||
| done | ||
|
|
||
| # Clean up whitespace | ||
| TEST_FILES=$(echo "$TEST_FILES" | xargs) | ||
|
|
||
| if [ -z "$TEST_FILES" ]; then | ||
| echo "No test files found in tests/ directory (after exclusions)" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Found test files:" | ||
| for test_file in $TEST_FILES; do | ||
| echo " $test_file" | ||
| done | ||
| echo "" | ||
| } | ||
|
|
||
| # Main execution | ||
| main() { | ||
| # Parse command line arguments | ||
| parse_args "$@" | ||
|
|
||
| # Print test mode banner | ||
| print_test_mode_banner | ||
|
|
||
| # Install and verify (includes precompiled kernels) | ||
| install_and_verify | ||
|
|
||
| # Find test files (unique to unit tests - auto-discovery) | ||
| find_test_files | ||
|
|
||
| # Execute tests or dry run | ||
| if [ "$DRY_RUN" == "true" ]; then | ||
| execute_dry_run "$TEST_FILES" | ||
| else | ||
| execute_tests "$TEST_FILES" | ||
| fi | ||
|
|
||
| exit "$EXIT_CODE" | ||
| } | ||
|
|
||
| main "$@" | ||
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.