Skip to content

Commit a3e0e2c

Browse files
authored
Add NCCL test validation to G4 Integration tests (GoogleCloudPlatform#4933)
2 parents 668e5b5 + 7541852 commit a3e0e2c

3 files changed

Lines changed: 64 additions & 3 deletions

File tree

examples/gke-g4/nccl-test.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ metadata:
1919
labels:
2020
app: nccl-test
2121
spec:
22-
ttlSecondsAfterFinished: 600
22+
ttlSecondsAfterFinished: 1200
23+
suspend: False
2324
template:
2425
metadata:
2526
labels:
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Copyright 2025 "Google LLC"
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
- name: Assert variables are defined
15+
ansible.builtin.assert:
16+
that:
17+
- region is defined
18+
- custom_vars.project is defined
19+
- name: Get cluster credentials for kubectl
20+
delegate_to: localhost
21+
ansible.builtin.shell: |
22+
gcloud container clusters get-credentials {{ deployment_name }} --region {{ region }} --project {{ custom_vars.project }} --verbosity=debug
23+
- name: Run the NCCL test
24+
delegate_to: localhost
25+
ansible.builtin.shell: |
26+
kubectl create -f {{ workspace }}/examples/gke-g4/nccl-test.yaml -v=9
27+
args:
28+
executable: /bin/bash
29+
30+
- name: Wait for Job to hit completion
31+
delegate_to: localhost
32+
ansible.builtin.shell: |
33+
kubectl get job --field-selector status.successful=1 -v=9
34+
register: job_completion
35+
until: job_completion.stdout_lines | length > 1
36+
retries: 10
37+
delay: 60
38+
39+
- name: Fetch logs from the pod and save to pod_logs.txt
40+
delegate_to: localhost
41+
ansible.builtin.shell: |
42+
pod_name="$(kubectl get pods --no-headers -o custom-columns="Name:.metadata.name" | awk '{if ($1 ~ "nccl-test") print $0}')"
43+
kubectl logs ${pod_name} > pod_logs.txt
44+
cat pod_logs.txt
45+
register: nccl_test_logs
46+
47+
- name: Print the NCCL test logs from the pod
48+
debug:
49+
msg: "{{nccl_test_logs.stdout}}"
50+
- name: Ensure average bus bandwidth is >= 30 GB/s
51+
delegate_to: localhost
52+
ansible.builtin.shell: |
53+
grep -o '# Avg bus bandwidth : [0-9\.]*' pod_logs.txt | cut -d ':' -f 2 | awk '{$1=$1;print}'
54+
register: avg_bus_bandwidth
55+
failed_when: avg_bus_bandwidth.stdout | float < 30
56+
- name: Clean up
57+
delegate_to: localhost
58+
ansible.builtin.shell: |
59+
kubectl delete jobs --all -v=9

tools/cloud-build/daily-tests/tests/gke-g4.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ network: "{{ deployment_name }}-net-0"
2424
region: us-central1
2525
zone: us-central1-b
2626
remote_node: "{{ deployment_name }}-remote-node-0"
27-
machine_type: g4-standard-48
28-
num_gpus: 1
27+
machine_type: g4-standard-96
28+
num_gpus: 2
2929
static_node_count: 2
3030
cli_deployment_vars:
3131
region: "{{ region }}"
@@ -38,3 +38,4 @@ custom_vars:
3838
project: "{{ project }}"
3939
post_deploy_tests:
4040
- test-validation/test-gke-job.yml
41+
- test-validation/test-gke-g4.yml

0 commit comments

Comments
 (0)