Repository navigation
Conversation
ucp_put_bw, ucp_get, tag_bw and ucp_am_bw keep up to -O operations in flight, and all of them use the same buffers. With multi-rail zero-copy transfers from GPU memory, the source data then stays in the GPU L2, and the NICs could read it at lower bandwidth than from device memory. Applications usually transfer distinct buffers, so allow the tests to do the same to be able to test this case. Add "-u <count>" to allocate several message buffers on both sides and make consecutive operations rotate through them. The default count of one keeps the previous behavior, and "-u auto" derives the count from the message size: a single buffer below 1 MB, otherwise enough buffers to span 256 MB. The last-iteration signal and the final ack still use the first buffer.
|
🤖 Starting review — findings will be posted here when done. |
| perf->send_allocator, &perf->send_buffer, | ||
| &perf->ucp.send_memh); | ||
| if (status != UCS_OK) { | ||
| ucs_error("failed to allocate send memory, \"-u <count>\" reduces " |
There was a problem hiding this comment.
This hint is printed also when the test uses a single buffer and -u was never passed, where it is confusing. Please print it only when the buffer count is > 1, and add the requested size to the message. (Same applies to the copy at line 214.)
|
|
||
| #define UCP_PERF_FC_WINDOW_DEFAULT 4 | ||
|
|
||
| #define UCP_PERF_BUFFER_COUNT_AUTO 0 |
There was a problem hiding this comment.
Using 0 for auto means that any zero-initialized ucx_perf_params_t silently asks for auto rotation (this is why test_perf.cc now has to set 1). Can we use a non-zero sentinel, like UCS_MEMUNITS_AUTO, so an unset field keeps a single buffer?
| recv(worker, ep, recv_buffer, recv_length, recv_datatype, sn); | ||
| offset = next_buffer_offset(&buffer_index, buffer_count, | ||
| length); | ||
| recv(worker, ep, UCS_PTR_BYTE_OFFSET(recv_buffer, offset), |
There was a problem hiding this comment.
For AM the data always lands in m_am_rx_buffer, which is set once to offset 0, so the receiver never rotates and this offset has no effect. Is rotation of the AM receive side intended? With auto mode the rotated sizes (>= 1MB) are exactly the rndv ones that do write into that buffer.
| return (params->api == UCX_PERF_API_UCP) && | ||
| ((params->command == UCX_PERF_CMD_PUT) || | ||
| (params->command == UCX_PERF_CMD_GET) || | ||
| (params->command == UCX_PERF_CMD_TAG) || |
There was a problem hiding this comment.
Why not UCX_PERF_CMD_TAG_SYNC as well? tag_sync_bw uses the same send/recv path.
| params->super.flags |= UCX_PERF_TEST_FLAG_VALIDATE; | ||
| return UCS_OK; | ||
| case 'u': | ||
| return parse_buffer_count(opt_arg, ¶ms->super.ucp.buffer_count); |
There was a problem hiding this comment.
Can we add coverage for the new option? E.g. one -u <count> and one -u auto run of ucp_put_bw/tag_bw in run_ucx_perftest() in contrib/test_jenkins.sh, similar to run_ucx_perftest_sgl.
| return 1; | ||
| } | ||
|
|
||
| return ucs_div_round_up(256 * UCS_MBYTE, length); |
There was a problem hiding this comment.
Minor: 256 MB is hardcoded here and again in the usage text in perftest_params.c. Please add a define next to UCP_PERF_BUFFER_COUNT_AUTO and use it in both places, so they cannot drift.
| #define TL_RESOURCE_NAME_NONE "<none>" | ||
| #define TEST_PARAMS_ARGS \ | ||
| "t:n:s:W:O:w:D:i:H:oSCIqM:r:E:T:d:x:A:BUe:m:aR:lyzL:F:Y:V" | ||
| "t:n:s:W:O:w:D:i:H:oSCIqM:r:E:T:d:x:A:BUe:m:aR:lyzL:F:Y:Vu:" |
There was a problem hiding this comment.
Minor: please add a long option (e.g. --buffer-count) to TEST_PARAMS_ARGS_LONG too — src/tools/AGENTS.md asks for it for new flags, and -u alone is not self-explanatory.
|
Residual coverage gaps: no test or CI job exercises |
|
🤖 CI Triage Agent — TL;DR: The gtest job crashed in Full analysisSummary: Root cause: Evidence from the log, in order:
So a transport-level error left the AM stream out of sync, and the PUT_REQ handling path has no runtime validation: PR #12419 ("TOOLS/PERF: Rotate message buffers in bandwidth tests") only changes Implicated commit: Not caused by the PR commit File: Suggested fix:
Related: PR #12419 (this build), #12081 (AM length validation), #12266 (flush ordering)
|
What?
Add
ucx_perftest -u <count>|autoto rotate the message buffers of theucp_put_bw,ucp_get,tag_bwanducp_am_bwtests. The default stays one buffer, as before.Why?
These tests keep up to
-Ooperations in flight, and all of them use the same send and receive buffers. With multi-rail zero-copy transfers from GPU memory, the source data then stays in the GPU L2, and the NICs could read it at lower bandwidth than from device memory (HBM).Applications usually transfer distinct buffers, so allow the tests to do the same, to be able to test this case.
Example:
How?
ucp.buffer_counttest parameter;UCP_PERF_BUFFER_COUNT_AUTO(0) derives the count from the message size.ucx_perftestand the gtest perf harness set it to 1.-u auto: one buffer below 1 MB, where the per-message overhead dominates; otherwise enough buffers to span 256 MB, which is more than the L2. Messages of 256 MB or more get one buffer.ucx_perf_get_thread_buffer_size()multiplies the message size by the count, so each thread allocates the buffers consecutively on both sides. The server gets the count with the rest of the test parameters.run_stream_uni()moves the local buffers and the remote address to the next buffer on each iteration (next_buffer_offset()). The last-iteration signal and the final ack still use the first buffer, so the receiver polls the same location as before.ucp_am_bwthe send buffer rotates, while the AM handler still receives into the first receive buffer.-u autouses one buffer there.