-
Notifications
You must be signed in to change notification settings - Fork 37
All reduce nccl test #263
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
All reduce nccl test #263
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a2b99e2
Add ml tests
66c05b4
Fix test
da733d9
Adjust test
a7b7083
Reformat and download the benchmark on-the-fly
55db49d
Merge branch 'main' into all_reduce_NCCL_test
jgphpc c12e5df
Update checks/apps/pytorch/pytorch_allreduce.py
Blanca-Fuentes be8cea9
Update checks/apps/pytorch/pytorch_allreduce.py
Blanca-Fuentes 1fa31de
Update checks/apps/pytorch/pytorch_allreduce.py
Blanca-Fuentes 75889f0
Use torchrun and fetch latest image
46b9a82
Merge branch 'main' into all_reduce_NCCL_test
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,88 @@ | ||
| # Copyright 2025 Swiss National Supercomputing Centre (CSCS/ETH Zurich) | ||
| # ReFrame Project Developers. See the top-level LICENSE file for details. | ||
| # | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| import pathlib | ||
| import sys | ||
|
|
||
| import reframe as rfm | ||
| import reframe.utility.sanity as sn | ||
|
|
||
| sys.path.append(str(pathlib.Path(__file__).parent.parent.parent / 'mixins')) | ||
|
|
||
| from container_engine import ContainerEngineMixin # noqa: E402 | ||
|
|
||
|
|
||
| @rfm.simple_test | ||
| class PyTorchNCCLAllReduce(rfm.RunOnlyRegressionTest, ContainerEngineMixin): | ||
| valid_systems = ['+nvgpu'] | ||
| valid_prog_environs = ['builtin'] | ||
| num_nodes = variable(int, value=8) | ||
| sourcesdir = None | ||
| image = parameter(['nvcr.io#nvidia/pytorch:25.01-py3']) | ||
| env_vars = { | ||
| 'NCCL_DEBUG': 'Info', | ||
| } | ||
| tags = {'ml'} | ||
| all_ref = { | ||
| 'sm_90': | ||
| {'*': | ||
| {'GB/s': (91.04, -0.05, None, 'GB/s')} | ||
| }, | ||
| } | ||
|
|
||
| @run_after('init') | ||
| def set_image(self): | ||
| self.container_image = self.image | ||
| self.container_env_table = { | ||
| 'annotations.com.hooks': { | ||
| 'aws_ofi_nccl.enabled': 'true', | ||
| 'aws_ofi_nccl.variant': 'cuda12', | ||
| }, | ||
| } | ||
|
|
||
| @run_after('setup') | ||
| def setup_test(self): | ||
| curr_part = self.current_partition | ||
| self.num_gpus_per_node = curr_part.select_devices('gpu')[0].num_devices | ||
| self.num_tasks_per_node = 1 | ||
| self.num_tasks = self.num_nodes | ||
| self.job.options = ['--gpus-per-task={self.num_gpus_per_node}'] | ||
| self.num_cpus_per_task = curr_part.processor.num_cpus | ||
| self.env_vars['OMP_NUM_THREADS'] = (self.num_cpus_per_task // | ||
Blanca-Fuentes marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| self.num_gpus_per_node) | ||
| self.executable = 'python' | ||
|
|
||
| @run_after('setup') | ||
| def set_executable_opts(self): | ||
| self.prerun_cmds = ['wget https://raw.githubusercontent.com/stas00/ml-engineering/179e37865157c526b7f80b258b448caab4953247/network/benchmarks/all_reduce_bench.py'] # noqa: E501 | ||
Blanca-Fuentes marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| headnode_cmd = ( | ||
| '$(scontrol show hostnames $SLURM_JOB_NODELIST | head -n 1)' | ||
| ) | ||
| self.executable_opts = [ | ||
| f'-u', f'-m', f'torch.distributed.run', | ||
| f'--nproc_per_node={self.num_gpus_per_node}', | ||
| f'--nnodes={self.num_nodes}', | ||
| f'--rdzv_endpoint {headnode_cmd}:6000', | ||
| f'--rdzv_backend c10d', | ||
| f'all_reduce_bench.py', | ||
| ] | ||
|
|
||
| @sanity_function | ||
| def assert_sanity(self): | ||
| return sn.assert_found( | ||
| r'The average bandwidth of all_reduce', self.stdout | ||
| ) | ||
|
|
||
| @run_before('performance') | ||
| def set_perf(self): | ||
| self.perf_patterns = { | ||
| 'GB/s': sn.extractsingle( | ||
| r'\|\s*16GiB\s*\|\s*(?P<busbw>\S+)GBps\s*\|', | ||
| self.stdout, tag='busbw', conv=float | ||
| ) | ||
| } | ||
| partition = self.current_partition | ||
| gpu_arch = partition.select_devices('gpu')[0].arch | ||
| self.reference = self.all_ref[gpu_arch] | ||
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.