Skip to content

Commit 5efdf4b

Browse files
committed
[Test] In test_essential_feature use flexible GPU-powered instance types to reduce the risk of ICEs.
Flexible instance type are cached to reduce the number of EC2 requests.
1 parent 03010a6 commit 5efdf4b

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

tests/integration-tests/tests/basic/test_essential_features.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from assertpy import assert_that, soft_assertions
1616
from constants import UNSUPPORTED_OSES_FOR_DCV
1717
from remote_command_executor import RemoteCommandExecutor
18-
from utils import check_status, is_dcv_supported, test_cluster_health_metric
18+
from utils import check_status, get_flexible_gpu_instance_types, is_dcv_supported, test_cluster_health_metric
1919

2020
from tests.basic.disable_hyperthreading_utils import _test_disable_hyperthreading_settings
2121
from tests.basic.log_rotation_utils import _test_compute_log_rotation, _test_headnode_log_rotation
@@ -65,6 +65,7 @@ def test_essential_features(
6565
dcv_enabled=dcv_enabled,
6666
max_queue_size=max_queue_size,
6767
scaledown_idletime=scaledown_idletime,
68+
flexible_gpu_instance_types=get_flexible_gpu_instance_types(instance, region),
6869
)
6970
cluster = clusters_factory(cluster_config)
7071

tests/integration-tests/tests/basic/test_essential_features/test_essential_features/pcluster.config.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ Scheduling:
128128
ComputeResources:
129129
- Name: cr1
130130
Instances:
131-
- InstanceType: g4dn.2xlarge
131+
{% for instance_type in flexible_gpu_instance_types %}
132+
- InstanceType: {{ instance_type }}
133+
{% endfor %}
132134
MinCount: 0
133135
MaxCount: 1
134136
SlurmSettings:

tests/integration-tests/utils.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import string
2020
import subprocess
2121
from datetime import datetime, timedelta
22+
from functools import cache
2223
from hashlib import sha1
2324

2425
import boto3
@@ -1073,6 +1074,14 @@ def get_similar_instance_types(instance_type: str, region: str = None, max_items
10731074
return similar_instances
10741075

10751076

1077+
@cache
1078+
def get_flexible_gpu_instance_types(instance, region):
1079+
"""Return a list of NVIDIA GPU instance types compatible with ``instance``'s architecture."""
1080+
architecture = get_architecture_supported_by_instance_type(instance, region)
1081+
gpu_instance_type = "g4dn.2xlarge" if architecture == "x86_64" else "g5g.2xlarge"
1082+
return list({gpu_instance_type, *get_similar_instance_types(gpu_instance_type, region, 5)})
1083+
1084+
10761085
def verify_cluster_node_config_version_in_ddb(region, cluster_name, instance_id, expected_version):
10771086
"""
10781087
Verify that a cluster node has the correct config version in DynamoDB.

0 commit comments

Comments
 (0)