From 156d34dfdc4aa3fd4c36a8a707501507382ed09b Mon Sep 17 00:00:00 2001 From: Shi Jin Date: Mon, 25 Nov 2024 19:12:50 +0000 Subject: [PATCH] fabtests/pytest/efa: Avoid duiplicate completion semantic for RMA test For fi_read, there is no difference between DC and non-DC as it's not a transmission. For write and writedata, if device support rdma-write, all the transmissions are DC already. Signed-off-by: Shi Jin (cherry picked from commit c74eac27f336db534bc78d80066df73d5fafb6a3) --- fabtests/pytest/efa/conftest.py | 14 ++++++++++++++ fabtests/pytest/efa/test_rma_bw.py | 20 ++++++++++---------- fabtests/pytest/efa/test_rma_pingpong.py | 12 ++++++------ 3 files changed, 30 insertions(+), 16 deletions(-) diff --git a/fabtests/pytest/efa/conftest.py b/fabtests/pytest/efa/conftest.py index 6192e83fa32..2871a9b8ca9 100644 --- a/fabtests/pytest/efa/conftest.py +++ b/fabtests/pytest/efa/conftest.py @@ -1,4 +1,5 @@ import pytest +from efa_common import has_rdma # The memory types for bi-directional tests. memory_type_list_bi_dir = [ @@ -34,6 +35,19 @@ def rma_bw_memory_type(memory_type, rma_operation_type): pytest.skip("Duplicated memory type for bi-directional test") return memory_type +@pytest.fixture(scope="function") +def rma_bw_completion_semantic(cmdline_args, completion_semantic, rma_operation_type): + if completion_semantic != 'delivery_complete': + # There is no difference between DC and non-DC for read as it's + # not a transmission + if rma_operation_type == 'read': + pytest.skip("Duplicate completion semantic for fi_read test") + assert rma_operation_type in ['write', 'writedata'] + # If device support rdma write, all the transmissions are DC + if has_rdma(cmdline_args, 'write'): + pytest.skip("Duplicate completion semantic for fi_write* test") + return completion_semantic + @pytest.fixture(scope="module", params=["r:0,4,64", "r:4048,4,4148", diff --git a/fabtests/pytest/efa/test_rma_bw.py b/fabtests/pytest/efa/test_rma_bw.py index f80a87ce64d..dd2a8e7ce5d 100644 --- a/fabtests/pytest/efa/test_rma_bw.py +++ b/fabtests/pytest/efa/test_rma_bw.py @@ -7,15 +7,15 @@ @pytest.mark.parametrize("iteration_type", [pytest.param("short", marks=pytest.mark.short), pytest.param("standard", marks=pytest.mark.standard)]) -def test_rma_bw(cmdline_args, iteration_type, rma_operation_type, completion_semantic, rma_bw_memory_type): +def test_rma_bw(cmdline_args, iteration_type, rma_operation_type, rma_bw_completion_semantic, rma_bw_memory_type): command = "fi_rma_bw -e rdm" command = command + " -o " + rma_operation_type + " " + perf_progress_model_cli # rma_bw test with data verification takes longer to finish timeout = max(540, cmdline_args.timeout) - efa_run_client_server_test(cmdline_args, command, iteration_type, completion_semantic, rma_bw_memory_type, "all", timeout=timeout) + efa_run_client_server_test(cmdline_args, command, iteration_type, rma_bw_completion_semantic, rma_bw_memory_type, "all", timeout=timeout) @pytest.mark.parametrize("env_vars", [["FI_EFA_TX_SIZE=64"], ["FI_EFA_RX_SIZE=64"], ["FI_EFA_TX_SIZE=64", "FI_EFA_RX_SIZE=64"]]) -def test_rma_bw_small_tx_rx(cmdline_args, rma_operation_type, completion_semantic, rma_bw_memory_type, env_vars): +def test_rma_bw_small_tx_rx(cmdline_args, rma_operation_type, rma_bw_completion_semantic, rma_bw_memory_type, env_vars): cmdline_args_copy = copy.copy(cmdline_args) for env_var in env_vars: cmdline_args_copy.append_environ(env_var) @@ -24,24 +24,24 @@ def test_rma_bw_small_tx_rx(cmdline_args, rma_operation_type, completion_semanti command = command + " -o " + rma_operation_type + " " + perf_progress_model_cli # rma_bw test with data verification takes longer to finish timeout = max(540, cmdline_args_copy.timeout) - efa_run_client_server_test(cmdline_args_copy, command, "short", completion_semantic, rma_bw_memory_type, "all", timeout=timeout) + efa_run_client_server_test(cmdline_args_copy, command, "short", rma_bw_completion_semantic, rma_bw_memory_type, "all", timeout=timeout) @pytest.mark.functional -def test_rma_bw_range(cmdline_args, rma_operation_type, completion_semantic, message_size, rma_bw_memory_type): +def test_rma_bw_range(cmdline_args, rma_operation_type, rma_bw_completion_semantic, message_size, rma_bw_memory_type): command = "fi_rma_bw -e rdm" command = command + " -o " + rma_operation_type # rma_bw test with data verification takes longer to finish timeout = max(540, cmdline_args.timeout) - efa_run_client_server_test(cmdline_args, command, "short", completion_semantic, rma_bw_memory_type, message_size, timeout=timeout) + efa_run_client_server_test(cmdline_args, command, "short", rma_bw_completion_semantic, rma_bw_memory_type, message_size, timeout=timeout) @pytest.mark.functional -def test_rma_bw_range_no_inject(cmdline_args, rma_operation_type, completion_semantic, inject_message_size): +def test_rma_bw_range_no_inject(cmdline_args, rma_operation_type, rma_bw_completion_semantic, inject_message_size): command = "fi_rma_bw -e rdm -j 0" command = command + " -o " + rma_operation_type # rma_bw test with data verification takes longer to finish timeout = max(540, cmdline_args.timeout) - efa_run_client_server_test(cmdline_args, command, "short", completion_semantic, "host_to_host", inject_message_size, timeout=timeout) + efa_run_client_server_test(cmdline_args, command, "short", rma_bw_completion_semantic, "host_to_host", inject_message_size, timeout=timeout) # This test is run in serial mode because it takes a lot of memory @@ -49,12 +49,12 @@ def test_rma_bw_range_no_inject(cmdline_args, rma_operation_type, completion_sem @pytest.mark.functional # TODO Add "writedata", "write" back in when EFA firmware bug is fixed @pytest.mark.parametrize("operation_type", ["read"]) -def test_rma_bw_1G(cmdline_args, operation_type, completion_semantic): +def test_rma_bw_1G(cmdline_args, operation_type, rma_bw_completion_semantic): # Default window size is 64 resulting in 128GB being registered, which # exceeds max number of registered host pages timeout = max(540, cmdline_args.timeout) command = "fi_rma_bw -e rdm -W 1" command = command + " -o " + operation_type efa_run_client_server_test(cmdline_args, command, 2, - completion_semantic=completion_semantic, message_size=1073741824, + completion_semantic=rma_bw_completion_semantic, message_size=1073741824, memory_type="host_to_host", warmup_iteration_type=0, timeout=timeout) diff --git a/fabtests/pytest/efa/test_rma_pingpong.py b/fabtests/pytest/efa/test_rma_pingpong.py index b3fdf9c1408..7d028f9a09a 100644 --- a/fabtests/pytest/efa/test_rma_pingpong.py +++ b/fabtests/pytest/efa/test_rma_pingpong.py @@ -14,23 +14,23 @@ def rma_pingpong_message_size(request): @pytest.mark.parametrize("iteration_type", [pytest.param("short", marks=pytest.mark.short), pytest.param("standard", marks=pytest.mark.standard)]) -def test_rma_pingpong(cmdline_args, iteration_type, operation_type, completion_semantic, memory_type_bi_dir): +def test_rma_pingpong(cmdline_args, iteration_type, operation_type, rma_bw_completion_semantic, memory_type_bi_dir): command = "fi_rma_pingpong -e rdm" command = command + " -o " + operation_type + " " + perf_progress_model_cli - efa_run_client_server_test(cmdline_args, command, iteration_type, completion_semantic, memory_type_bi_dir, "all") + efa_run_client_server_test(cmdline_args, command, iteration_type, rma_bw_completion_semantic, memory_type_bi_dir, "all") @pytest.mark.functional @pytest.mark.parametrize("operation_type", ["writedata"]) -def test_rma_pingpong_range(cmdline_args, operation_type, completion_semantic, rma_pingpong_message_size, memory_type_bi_dir): +def test_rma_pingpong_range(cmdline_args, operation_type, rma_bw_completion_semantic, rma_pingpong_message_size, memory_type_bi_dir): command = "fi_rma_pingpong -e rdm" command = command + " -o " + operation_type - efa_run_client_server_test(cmdline_args, command, "short", completion_semantic, memory_type_bi_dir, rma_pingpong_message_size) + efa_run_client_server_test(cmdline_args, command, "short", rma_bw_completion_semantic, memory_type_bi_dir, rma_pingpong_message_size) @pytest.mark.functional @pytest.mark.parametrize("operation_type", ["writedata"]) -def test_rma_pingpong_range_no_inject(cmdline_args, operation_type, completion_semantic, rma_pingpong_message_size, memory_type_bi_dir): +def test_rma_pingpong_range_no_inject(cmdline_args, operation_type, rma_bw_completion_semantic, rma_pingpong_message_size, memory_type_bi_dir): command = "fi_rma_pingpong -e rdm -j 0" command = command + " -o " + operation_type - efa_run_client_server_test(cmdline_args, command, "short", completion_semantic, memory_type_bi_dir, rma_pingpong_message_size) + efa_run_client_server_test(cmdline_args, command, "short", rma_bw_completion_semantic, memory_type_bi_dir, rma_pingpong_message_size)