Skip to content

use dmabuf option when the ibperf binaries have them configured#235

Open
ahskabir wants to merge 4 commits into
mainfrom
feature/perf_dmabuf
Open

use dmabuf option when the ibperf binaries have them configured#235
ahskabir wants to merge 4 commits into
mainfrom
feature/perf_dmabuf

Conversation

@ahskabir

Copy link
Copy Markdown
Contributor

Motivation

IBPERF test makes use of the binaries for which path is provided in the configuration file. It also has an option to install the ibperf tool and then to run the test. But during the run-time when it prepares the ibperf invocation command(s) it doesn't use the --use_rocm_dmabuf option and the run could be less performant.

Technical Details

A function is added in the ibperf library. This function check to see whether the ibperf binary was configured with --use_rocm_dmabuf. If yes, it will use the flag for invocation, otherwise not.

Test Plan

All ibperf test was run using ibperf binaries configured with --use_rocm_dmabuf and test passed.
All ibperf test was run using ibperf binaries not configured with --use_rocm_dmabuf and test passed.

Test Result

In both the scenarios, all tests passed.

Submission Checklist

Comment thread cvs/lib/ibperf_lib.py Outdated

try:
# detailed=True gives us exit_code per host
host_results = phdl.exec(cmd, detailed=True, print_console=False)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It assumes a homogeneous cluster — all nodes have the same binary at the same app_path. That's a safe assumption in the ibperf context (the binary path comes from a shared config and is the same for all nodes), and it's consistent with how the rest of the test already treats the cluster.

So we can just use shdl.exec instead of phdl.exec, shdl.exec will test the binary only in the head node(which is sufficent)

Comment thread cvs/lib/ibperf_lib.py Outdated

dmabuf_supported_any = False

for host, result in host_results.items():

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when shdl is used this whole for loop to set "dmabuf_supported_any " becomes unnecessary.

ahskabir added 4 commits July 11, 2026 08:50
Signed-off-by: Ahsan Kabir <Ahsan.Kabir@amd.com>
Signed-off-by: Ahsan Kabir <Ahsan.Kabir@amd.com>
Signed-off-by: Ahsan Kabir <Ahsan.Kabir@amd.com>
Signed-off-by: Ahsan Kabir <Ahsan.Kabir@amd.com>
@ahskabir
ahskabir force-pushed the feature/perf_dmabuf branch from fa628ff to 6cef5d0 Compare July 11, 2026 16:38
Comment thread cvs/lib/ibperf_lib.py
return '/opt/rocm'


def check_perftest_dmabuf_support(shdl, binary_path, head_node):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We no need to pass head_node to this function, because shdl isa Pssh instance with only one node in the list(head_node) refer https://github.com/ROCm/cvs/pull/235/changes#diff-fc999b79285f07a1d04220513c8cc33f07b30514861fdf7baea8058c53a85bd8R170

Comment thread cvs/lib/ibperf_lib.py
return dmabuf_available
try:
dmabuf_check_out = shdl.exec(cmd)
dmabuf_available = int(dmabuf_check_out[head_node].strip()) > 0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dmabuf_check_out = shdl.exec(cmd)
for node in dmabuf_check_out .keys():
dmabuf_available = int(dmabuf_check_out [node].strip()) > 0

We can use above logic, without head_node argument, the for loop will iterate once as the dmabuf_check_out will have ouptput from one node(head_node)

Comment thread cvs/lib/ibperf_lib.py
port_no=1516,
duration=60,
rocm_path='',
cluster_node_list=None,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We no need to pass cluster_node_list , because shdl is connection handle to head node only

Comment thread cvs/lib/ibperf_lib.py
gid_index,
port_no=1516,
rocm_path='',
cluster_node_list=None,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We no need to pass cluster_node_list , because shdl is connection handle to head node only

Comment thread cvs/lib/ibperf_lib.py
card_no = 'card' + str(gpu_no)
rdma_dev = gpu_nic_dict[node][card_no]['rdma_dev']
cmd = f'numactl --physcpubind={gpu_numa_dict[node][card_no]["local_cpulist"]} --localalloc {app_path}/{bw_test} -d {rdma_dev} --use_rocm={gpu_no} -x {gid_index} --report_gbits -b -F -D {duration} -p {port_no} -s {msg_size} -q {qp_count} > /tmp/ib_perf_{inst_count}_logs & 2>&1'
if dmabuf_supported:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can simplify like below to avoid code duplication in if else

`
cmd_parts = [
"numactl",
f'--physcpubind={gpu_numa_dict[node][card_no]["local_cpulist"]}',
"--localalloc",
f"{app_path}/{bw_test}",
"-d", rdma_dev,
f"--use_rocm={gpu_no}",
*(["--use_rocm_dmabuf"] if dmabuf_supported else []),
"-x", str(gid_index),
"--report_gbits", "-b", "-F",
"-D", str(duration),
"-p", str(port_no),
"-s", str(msg_size),
"-q", str(qp_count),
server_addr,
]

cmd = " ".join(cmd_parts) + f" > /tmp/ib_perf_{inst_count}_logs 2>&1 &"
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants