Skip to content

Commit 80c6494

Browse files
authored
Fix to execute efa tests on mainline (#1083)
1 parent b986d13 commit 80c6494

File tree

6 files changed

+9
-49
lines changed

6 files changed

+9
-49
lines changed

test/dlc_tests/eks/eks_manifest_templates/tensorflow/training/multi_node_gpu_training.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ spec:
3131
- -x
3232
- LD_LIBRARY_PATH
3333
- -x
34+
- RDMAV_FORK_SAFE=1
35+
- -x
3436
- PATH
3537
- -x
3638
- NCCL_SOCKET_IFNAME=eth0

test/sagemaker_tests/mxnet/training/conftest.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,7 @@ def pytest_addoption(parser):
4646
parser.addoption('--tag', default=None)
4747
parser.addoption('--generate-coverage-doc', default=False, action='store_true',
4848
help='use this option to generate test coverage doc')
49-
parser.addoption(
50-
"--efa", action="store_true", default=False, help="Run only efa tests",
51-
)
52-
53-
def pytest_configure(config):
54-
config.addinivalue_line("markers", "efa(): explicitly mark to run efa tests")
55-
56-
def pytest_runtest_setup(item):
57-
if item.config.getoption("--efa"):
58-
efa_tests = [mark for mark in item.iter_markers(name="efa")]
59-
if not efa_tests:
60-
pytest.skip("Skipping non-efa tests")
49+
6150

6251
def pytest_collection_modifyitems(session, config, items):
6352
if config.getoption("--generate-coverage-doc"):

test/sagemaker_tests/pytorch/training/conftest.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -105,20 +105,6 @@ def pytest_addoption(parser):
105105
parser.addoption('--tag', default=None)
106106
parser.addoption('--generate-coverage-doc', default=False, action='store_true',
107107
help='use this option to generate test coverage doc')
108-
parser.addoption(
109-
"--efa", action="store_true", default=False, help="Run only efa tests",
110-
)
111-
112-
113-
def pytest_configure(config):
114-
config.addinivalue_line("markers", "efa(): explicitly mark to run efa tests")
115-
116-
117-
def pytest_runtest_setup(item):
118-
if item.config.getoption("--efa"):
119-
efa_tests = [mark for mark in item.iter_markers(name="efa")]
120-
if not efa_tests:
121-
pytest.skip("Skipping non-efa tests")
122108

123109

124110
def pytest_collection_modifyitems(session, config, items):

test/sagemaker_tests/tensorflow/tensorflow1_training/integration/conftest.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,7 @@ def pytest_addoption(parser):
4242
parser.addoption('--instance-type', default=None)
4343
parser.addoption('--generate-coverage-doc', default=False, action='store_true',
4444
help='use this option to generate test coverage doc')
45-
parser.addoption(
46-
"--efa", action="store_true", default=False, help="Run only efa tests",
47-
)
4845

49-
def pytest_configure(config):
50-
config.addinivalue_line("markers", "efa(): explicitly mark to run efa tests")
51-
52-
def pytest_runtest_setup(item):
53-
if item.config.getoption("--efa"):
54-
efa_tests = [mark for mark in item.iter_markers(name="efa")]
55-
if not efa_tests:
56-
pytest.skip("Skipping non-efa tests")
5746

5847
def pytest_collection_modifyitems(session, config, items):
5948
if config.getoption("--generate-coverage-doc"):

test/sagemaker_tests/tensorflow/tensorflow2_training/integration/conftest.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,7 @@ def pytest_addoption(parser):
4242
parser.addoption('--instance-type', default=None)
4343
parser.addoption('--generate-coverage-doc', default=False, action='store_true',
4444
help='use this option to generate test coverage doc')
45-
parser.addoption(
46-
"--efa", action="store_true", default=False, help="Run only efa tests",
47-
)
4845

49-
def pytest_configure(config):
50-
config.addinivalue_line("markers", "efa(): explicitly mark to run efa tests")
51-
52-
def pytest_runtest_setup(item):
53-
if item.config.getoption("--efa"):
54-
efa_tests = [mark for mark in item.iter_markers(name="efa")]
55-
if not efa_tests:
56-
pytest.skip("Skipping non-efa tests")
5746

5847
def pytest_collection_modifyitems(session, config, items):
5948
if config.getoption("--generate-coverage-doc"):

test/test_utils/sagemaker.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,15 @@ def generate_sagemaker_pytest_cmd(image, sagemaker_test_type):
139139
local_test_report = os.path.join(UBUNTU_HOME_DIR, "test", f"{job_type}_{tag}_sm_local.xml")
140140
is_py3 = " python3 -m "
141141

142+
efa_flag = ""
143+
if job_type == "training" and (framework_major_version == "tensorflow" or framework == "pytorch"):
144+
efa_dedicated = os.getenv("EFA_DEDICATED", "False").lower() == "true"
145+
efa_flag = '--efa' if efa_dedicated else '-m not efa'
146+
142147
remote_pytest_cmd = (
143148
f"pytest -rA {integration_path} --region {region} --processor {processor} {docker_base_arg} "
144149
f"{sm_remote_docker_base_name} --tag {tag} {framework_version_arg} {framework_version} "
145-
f"{aws_id_arg} {account_id} {instance_type_arg} {instance_type} --junitxml {test_report}"
150+
f"{aws_id_arg} {account_id} {instance_type_arg} {instance_type} {efa_flag} --junitxml {test_report}"
146151
)
147152

148153
if processor == "eia" :

0 commit comments

Comments
 (0)