Repository navigation
UCT/IB/MLX5: Add AArch64 ST64B BF copy mode #11542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
1855df3
826574b
938781d
db95d46
fb3d926
bf3e7cf
b6d8511
ea9b8e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,6 +32,13 @@ static const char *uct_ib_mlx5_mmio_modes[] = { | |
| [UCT_IB_MLX5_MMIO_MODE_LAST] = NULL | ||
| }; | ||
|
|
||
| static const char *uct_ib_mlx5_bf_copy_modes[] = { | ||
| [UCT_IB_MLX5_BF_COPY_MODE_AUTO] = "auto", | ||
| [UCT_IB_MLX5_BF_COPY_MODE_GENERIC] = "generic", | ||
| [UCT_IB_MLX5_BF_COPY_MODE_ST64B] = "st64b", | ||
| [UCT_IB_MLX5_BF_COPY_MODE_LAST] = NULL | ||
| }; | ||
|
|
||
| ucs_config_field_t uct_ib_mlx5_iface_config_table[] = { | ||
| #if HAVE_IBV_DM | ||
| {"DM_SIZE", "2k", | ||
|
|
@@ -54,6 +61,15 @@ ucs_config_field_t uct_ib_mlx5_iface_config_table[] = { | |
| ucs_offsetof(uct_ib_mlx5_iface_config_t, mmio_mode), | ||
| UCS_CONFIG_TYPE_ENUM(uct_ib_mlx5_mmio_modes)}, | ||
|
|
||
| {"BF_COPY_MODE", "auto", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do you think we can define new mmio mode instead?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Merging them into one user-facing value doesn't really work, because the two I did prototype merging them internally (following recent bot comment): resolve both at setup time into extra But the code change is significant and perf is unchanged, so I'd prefer to keep the current split. |
||
| "How to copy WQE building blocks to BlueFlame MMIO register. One of " | ||
| "the following:\n" | ||
| " auto - Select best according to runtime CPU capabilities.\n" | ||
| " generic - Use portable scalar stores.\n" | ||
| " st64b - Use AArch64 ST64B store when supported.", | ||
|
tvegas1 marked this conversation as resolved.
Resolved
|
||
| ucs_offsetof(uct_ib_mlx5_iface_config_t, bf_copy_mode), | ||
| UCS_CONFIG_TYPE_ENUM(uct_ib_mlx5_bf_copy_modes)}, | ||
|
|
||
| {"AR_ENABLE", "auto", | ||
| "Enable Adaptive Routing (out of order) feature on SL that supports it.\n" | ||
| "On RoCE devices, this is done by modifying the QP directly.\n" | ||
|
|
@@ -763,8 +779,48 @@ uct_ib_mlx5_get_mmio_mode(uct_priv_worker_t *worker, | |
| return UCS_OK; | ||
| } | ||
|
|
||
| ucs_status_t | ||
| uct_ib_mlx5_txwq_init_bf_copy(uct_ib_mlx5_txwq_t *txwq, | ||
| uct_ib_mlx5_bf_copy_mode_t bf_copy_mode) | ||
| { | ||
| ucs_assert(bf_copy_mode < UCT_IB_MLX5_BF_COPY_MODE_LAST); | ||
|
|
||
| #if UCT_IB_MLX5_HAVE_ST64B | ||
| txwq->bf_copy_mode = UCT_IB_MLX5_BF_COPY_MODE_GENERIC; | ||
| if (bf_copy_mode == UCT_IB_MLX5_BF_COPY_MODE_GENERIC) { | ||
| return UCS_OK; | ||
| } | ||
|
|
||
| if (ucs_cpu_has_flag(UCS_CPU_FLAG_LS64)) { | ||
|
tvegas1 marked this conversation as resolved.
Resolved
tvegas1 marked this conversation as resolved.
Resolved
|
||
| txwq->bf_copy_mode = UCT_IB_MLX5_BF_COPY_MODE_ST64B; | ||
| return UCS_OK; | ||
| } | ||
|
|
||
| if (bf_copy_mode == UCT_IB_MLX5_BF_COPY_MODE_ST64B) { | ||
| ucs_error("mlx5 BlueFlame ST64B copy was requested but CPU does " | ||
| "not report LS64 support"); | ||
| return UCS_ERR_UNSUPPORTED; | ||
| } | ||
| #else | ||
| (void)txwq; | ||
|
tvegas1 marked this conversation as resolved.
Resolved
|
||
|
|
||
| if (bf_copy_mode == UCT_IB_MLX5_BF_COPY_MODE_ST64B) { | ||
| #if defined(__aarch64__) | ||
| ucs_error("mlx5 BlueFlame ST64B copy was requested but UCX was built " | ||
| "without assembler support for ST64B"); | ||
| #else | ||
| ucs_error("mlx5 BlueFlame ST64B copy is supported only on AArch64"); | ||
| #endif | ||
| return UCS_ERR_UNSUPPORTED; | ||
| } | ||
| #endif | ||
|
|
||
| return UCS_OK; | ||
| } | ||
|
|
||
| ucs_status_t uct_ib_mlx5_txwq_init(uct_priv_worker_t *worker, | ||
| uct_ib_mlx5_mmio_mode_t cfg_mmio_mode, | ||
| uct_ib_mlx5_bf_copy_mode_t bf_copy_mode, | ||
| uct_ib_mlx5_txwq_t *txwq, | ||
| struct ibv_qp *verbs_qp) | ||
| { | ||
|
|
@@ -798,6 +854,11 @@ ucs_status_t uct_ib_mlx5_txwq_init(uct_priv_worker_t *worker, | |
| return status; | ||
| } | ||
|
|
||
| status = uct_ib_mlx5_txwq_init_bf_copy(txwq, bf_copy_mode); | ||
| if (status != UCS_OK) { | ||
| return status; | ||
| } | ||
|
|
||
| ucs_debug("tx wq %d bytes [bb=%d, nwqe=%d] mmio_mode %s", | ||
| qp_info.dv.sq.stride * qp_info.dv.sq.wqe_cnt, | ||
| qp_info.dv.sq.stride, qp_info.dv.sq.wqe_cnt, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.