Skip to content

tests: Add test runner scripts - #1248

Open
bibrakc wants to merge 1 commit into
aws:masterfrom
bibrakc:tests/add-test-scripts
Open

tests: Add test runner scripts#1248
bibrakc wants to merge 1 commit into
aws:masterfrom
bibrakc:tests/add-test-scripts

Conversation

@bibrakc

@bibrakc bibrakc commented May 15, 2026

Copy link
Copy Markdown
Contributor

Description of changes:

Running functional tests, nccl-tests, and sanitizer checks currently requires each developer to maintain their own ad-hoc scripts with hardcoded paths. This makes it easy to miss validation steps before submitting PRs and difficult for AI agents to run tests autonomously.

Add a tests/scripts/ directory with reusable, Slurm-agnostic runners that cover the common test workflows (functional, nccl-tests, ASAN, Valgrind). Environment is configured via a gitignored env.sh so user-specific paths stay out of the repo. A Slurm batch template is provided for clusters that use it.

Also includes an AGENTS.md with detailed instructions for AI agents on how to run each test type and interpret results.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@bibrakc
bibrakc requested a review from a team as a code owner May 15, 2026 22:10
Running functional tests, nccl-tests, and sanitizer checks currently
requires each developer to maintain their own ad-hoc scripts with
hardcoded paths. This makes it easy to miss validation steps before
submitting PRs and difficult for AI agents to run tests autonomously.

Add a tests/scripts/ directory with reusable, Slurm-agnostic runners
that cover the common test workflows (functional, nccl-tests, ASAN,
Valgrind). Environment is configured via a gitignored env.sh so
user-specific paths stay out of the repo. A Slurm batch template is
provided for clusters that use it.

Also includes an AGENTS.md with detailed instructions for AI agents
on how to run each test type and interpret results.

Signed-off-by: Bibrak Qamar Chandio <bibracha@amazon.com>
@bibrakc
bibrakc force-pushed the tests/add-test-scripts branch from e7bcb9b to d37c590 Compare May 15, 2026 23:44
@Zhenye-Na

Copy link
Copy Markdown
Member

bot:aws:retest

1 similar comment
@Aishwaryar007

Copy link
Copy Markdown

bot:aws:retest

NUM_NODES=${NUM_NODES:-1}
RANKS_PER_NODE=${RANKS_PER_NODE:-8}
NUM_GPUS_PER_RANK=${NUM_GPUS_PER_RANK:-1}
EXTRA_TEST_ARGS=${EXTRA_TEST_ARGS:-"-n 15 -w 10 -b 1K -e 16G -f 2 -c 1 -R 0"}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-n 15 -w 10: we usually run with different options -- why are these default?

Comment on lines +97 to +98
export NCCL_BUFFSIZE=${NCCL_BUFFSIZE:-8388608}
export NCCL_P2P_NET_CHUNKSIZE=${NCCL_P2P_NET_CHUNKSIZE:-524288}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We no longer recommend setting these options.


# Defaults
MODE=${MODE:-regular}
PROTOCOL=${PROTOCOL:-RDMA}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the default protocol be empty -- let plugin pick?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this file have nccl-tests in the name? It isn't applicable to the functional tests, whose run scripts are also in this folder.

Comment thread tests/scripts/AGENTS.md
- Exit code 0 (the script propagates mpirun's exit code directly)
- Output contains `Results: N/N passed`
- No `NCCL_OFI_WARN` in output
- No segfaults or aborts

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: that should also be covered by "exit code 0"

fi

# Check correctness in output files
OUTPUTS=$(find "$CHECK_DIR" -name "output.txt" -o -name "slurmout_*.txt" 2>/dev/null)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In run-slurm.sh.example, the default output file name is slurm-%j.txt. So, I think we should find slurm-*.txt instead of slurmout_*.txt.

OUTPUTS=$(find "$CHECK_DIR" -name "output.txt" -o -name "slurmout_*.txt" 2>/dev/null)
if [[ -z "$OUTPUTS" ]]; then
echo "WARNING: No output files found in $CHECK_DIR"
exit 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If no output is found, then should we exit 1?

Comment on lines +143 to +144
BW=$(grep "Avg bus bandwidth" "$LOGFILE" | awk '{print $NF}')
echo "Avg bus bandwidth: ${BW:-N/A}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order for line 144 to be useful, we should change line 143 to

BW=$(grep "Avg bus bandwidth" "$LOGFILE" | awk '{print $NF}' || true)

@rongbingzhou

Copy link
Copy Markdown
Contributor

bot:aws:retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants