Skip to content

Commit

Permalink
fabtests/pytest/efa: Avoid duiplicate completion semantic for RMA test
Browse files Browse the repository at this point in the history
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 <sjina@amazon.com>
(cherry picked from commit c74eac2)
  • Loading branch information
shijin-aws committed Nov 26, 2024
1 parent 24a1a29 commit 8a912f9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 16 deletions.
14 changes: 14 additions & 0 deletions fabtests/pytest/efa/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
from efa_common import has_rdma

# The memory types for bi-directional tests.
memory_type_list_bi_dir = [
Expand Down Expand Up @@ -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",
Expand Down
20 changes: 10 additions & 10 deletions fabtests/pytest/efa/test_rma_bw.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -24,37 +24,37 @@ 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
@pytest.mark.serial
@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)
12 changes: 6 additions & 6 deletions fabtests/pytest/efa/test_rma_pingpong.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 8a912f9

Please sign in to comment.