-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathtest_nccl.sh
More file actions
77 lines (66 loc) · 2.65 KB
/
Copy pathtest_nccl.sh
File metadata and controls
77 lines (66 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/env bash
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
# Load configuration from config.env
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CONFIG_FILE="${SCRIPT_DIR}/config.env"
if [ ! -f "$CONFIG_FILE" ]; then
echo "Error: config.env not found!"
echo "Please create config.env from config.env.sample:"
echo " cp config.env.sample config.env"
echo "Then edit config.env with your API key and function ID."
exit 1
fi
source "$CONFIG_FILE"
# Validate required variables
if [ -z "$KEY" ] || [ "$KEY" = "your-api-key-here" ]; then
echo "Error: KEY not set in config.env"
exit 1
fi
if [ -z "$FUNCTION_ID" ] || [ "$FUNCTION_ID" = "your-multi-node-function-id" ] || [ "$FUNCTION_ID" = "your-single-node-function-id" ]; then
echo "Error: FUNCTION_ID not set in config.env"
exit 1
fi
CLUSTER_TYPE="ncp-mlx5" # "aws-gb200" for AWS/EFA, "aws-gb300" for AWS GB300, "ncp-mlx5" for NCP/Mellanox
NUM_GPUS=72 # number of GPUs to test, must match at most the number of GPUs in the helm chart
RESPONSE=$(curl --silent --request POST \
--url https://${FUNCTION_ID}.invocation.api.nvcf.nvidia.com/nccl-test \
--header "Authorization: Bearer ${KEY}" \
--header "NVCF-POLL-SECONDS: 600" \
--header 'Content-Type: application/json' \
--data "{
\"np\": ${NUM_GPUS},
\"n\": \"20\",
\"b\": \"1K\",
\"e\": \"16G\",
\"f\": \"2\",
\"g\": \"1\",
\"npernode\": 4,
\"mnnvl\": true,
\"debug\": false,
\"cluster_type\": \"${CLUSTER_TYPE}\"
}")
echo "$RESPONSE"
echo ""
echo "======================================================================================================"
echo " NCCL Test Output"
echo "======================================================================================================"
echo "$RESPONSE" | jq -r '.command'
echo "$RESPONSE" | jq -r '.output'
echo ""
echo "======================================================================================================"
# save the formatted response to a file
echo "$RESPONSE" | jq '{command, output}' > nccl_test_response.json