Skip to content

Commit 7122b57

Browse files
Merge pull request #4584 from RachaelSTamakloe/fix_network_wait_solution
Expand A* gpu network wait solution
2 parents e1f1f49 + c546e46 commit 7122b57

2 files changed

Lines changed: 11 additions & 89 deletions

File tree

examples/machine-learning/a4x-highgpu-4g/a4xhigh-slurm-blueprint.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ deployment_groups:
5555
- id: slurm-build-script
5656
source: modules/scripts/startup-script
5757
settings:
58+
enable_gpu_network_wait_online: true
5859
runners:
5960
- type: data
6061
destination: /etc/apt/preferences.d/block-broken-nvidia-container

modules/scripts/startup-script/files/install_gpu_network_wait_online.yml

Lines changed: 10 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -13,121 +13,42 @@
1313
# limitations under the License.
1414

1515
---
16-
- name: Wait until all network interfaces are online for A3/A4 variants
16+
- name: Install network wait service for A3/A4 variants
1717
hosts: all
1818
become: true
1919
tasks:
20-
- name: Create SystemD service for A3 High networking
21-
when: ansible_os_family == "Debian"
22-
ansible.builtin.copy:
23-
dest: /etc/systemd/system/delay-a3-high.service
24-
owner: root
25-
group: root
26-
mode: "0644"
27-
content: |
28-
[Unit]
29-
Description=Delay A3 High boot until all network interfaces are routable
30-
After=network-online.target
31-
Wants=network-online.target
32-
Before=google-startup-scripts.service
33-
34-
[Service]
35-
# Condition to only run on A3 High machines
36-
ExecCondition=/bin/bash -c '/usr/bin/curl -s -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/machine-type | grep -q "/a3-highgpu-8g$"'
37-
ExecStart=/usr/lib/systemd/systemd-networkd-wait-online -i enp0s12 -i enp6s0 -i enp12s0 -i enp134s0 -i enp140s0 -o routable --timeout=180
38-
ExecStartPost=/bin/sleep 30
39-
40-
[Install]
41-
WantedBy=multi-user.target
42-
notify:
43-
- Reload SystemD
44-
45-
- name: Create SystemD service for A3 Mega networking
46-
when: ansible_os_family == "Debian"
47-
ansible.builtin.copy:
48-
dest: /etc/systemd/system/delay-a3-mega.service
49-
owner: root
50-
group: root
51-
mode: "0644"
52-
content: |
53-
[Unit]
54-
Description=Delay A3 Mega boot until all network interfaces are routable
55-
After=network-online.target
56-
Wants=network-online.target
57-
Before=google-startup-scripts.service
58-
59-
[Service]
60-
# Condition to only run on A3 Mega machines
61-
ExecCondition=/bin/bash -c '/usr/bin/curl -s -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/machine-type | grep -q "/a3-megagpu-8g$"'
62-
ExecStart=/usr/lib/systemd/systemd-networkd-wait-online -i enp0s12 -i enp6s0f0 -i enp7s0f0 -i enp13s0f0 -i enp14s0f0 -i enp134s0f0 -i enp135s0f0 -i enp141s0f0 -i enp142s0f0 -o routable --timeout=180
63-
ExecStartPost=/bin/sleep 30
64-
65-
[Install]
66-
WantedBy=multi-user.target
67-
notify:
68-
- Reload SystemD
69-
70-
- name: Create SystemD service for A3 Ultra networking
71-
when: ansible_os_family == "Debian"
72-
ansible.builtin.copy:
73-
dest: /etc/systemd/system/delay-a3-ultra.service
74-
owner: root
75-
group: root
76-
mode: "0644"
77-
content: |
78-
[Unit]
79-
Description=Delay A3 Ultra boot until all network interfaces are routable
80-
After=network-online.target
81-
Wants=network-online.target
82-
Before=google-startup-scripts.service
83-
84-
[Service]
85-
# Condition to only run on A3 Ultra machines
86-
ExecCondition=/bin/bash -c '/usr/bin/curl -s -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/machine-type | grep -q "/a3-ultragpu-8g$"'
87-
ExecStart=/usr/lib/systemd/systemd-networkd-wait-online -i enp0s19 -i enp192s20 -i gpu0rdma0 -i gpu1rdma0 - gpu2rdma0 -i gpu3rdma0 -i gpu4rdma0 -i gpu5rdma0 -i gpu6rdma0 -i gpu7rdma0 -o routable --timeout=180
88-
ExecStartPost=/bin/sleep 30
89-
90-
[Install]
91-
WantedBy=multi-user.target
92-
notify:
93-
- Reload SystemD
9420

95-
- name: Create SystemD service for A4 High networking
21+
- name: Create universal SystemD service for GPU networking delay
9622
when: ansible_os_family == "Debian"
9723
ansible.builtin.copy:
98-
dest: /etc/systemd/system/delay-a4-high.service
24+
dest: /etc/systemd/system/delay-gpu-network.service
9925
owner: root
10026
group: root
10127
mode: "0644"
10228
content: |
10329
[Unit]
104-
Description=Delay A4 High boot until all network interfaces are routable
30+
Description=Delay boot on multi-NIC VMs until networks are routable
10531
After=network-online.target
10632
Wants=network-online.target
10733
Before=google-startup-scripts.service
10834
10935
[Service]
110-
# Condition to only run on A4 High machines
111-
ExecCondition=/bin/bash -c '/usr/bin/curl -s -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/machine-type | grep -q "/a4-highgpu-8g$"'
112-
ExecStart=/usr/lib/systemd/systemd-networkd-wait-online -i enp0s19 -i enp192s20 -i gpu0rdma0 -i gpu1rdma0 - gpu2rdma0 -i gpu3rdma0 -i gpu4rdma0 -i gpu5rdma0 -i gpu6rdma0 -i gpu7rdma0 -o routable --timeout=180
36+
# This condition checks if the machine type is one of the supported A3/A4 variants.
37+
# The service will only run if the machine type matches.
38+
ExecCondition=/bin/bash -c "/usr/bin/curl -s -H 'Metadata-Flavor: Google' http://metadata.google.internal/computeMetadata/v1/instance/machine-type | grep -qE '(/a3-highgpu-8g|/a3-megagpu-8g|/a3-ultragpu-8g|/a4-highgpu-8g|/a4x-highgpu-4g)$'"
39+
ExecStart=/usr/lib/systemd/systemd-networkd-wait-online -o routable --timeout=180
11340
ExecStartPost=/bin/sleep 30
114-
# To debug interface names on an A4 instance, run: ip link show
11541
11642
[Install]
11743
WantedBy=multi-user.target
11844
notify:
11945
- Reload SystemD
12046

121-
- name: Enable A3/A4 delay services
47+
- name: Enable universal GPU network delay service
12248
when: ansible_os_family == "Debian"
12349
ansible.builtin.systemd_service:
124-
name: "{{ item }}"
50+
name: delay-gpu-network.service
12551
enabled: true
126-
loop:
127-
- delay-a3-high.service
128-
- delay-a3-mega.service
129-
- delay-a3-ultra.service
130-
- delay-a4-high.service
13152

13253
handlers:
13354
- name: Reload SystemD

0 commit comments

Comments
 (0)