Skip to content

Commit

Permalink
UCP: Fix BW lanes score calculation
Browse files Browse the repository at this point in the history
Device num_paths coefficient should be applied after
fp8 pack/unpack. Otherwise the ratio effect maybe just hidden
by fp8 inaccuracy
  • Loading branch information
brminich committed Jul 25, 2023
1 parent 5c9f5c8 commit 1a2da4b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/ucp/wireup/select.c
Original file line number Diff line number Diff line change
Expand Up @@ -1231,16 +1231,21 @@ ucp_wireup_iface_avail_bandwidth(const ucp_worker_iface_t *wiface,
double eps = 1e-3;
double local_bw, remote_bw;

local_bw = ucp_wireup_iface_bw_distance(wiface) *
ucp_tl_iface_bandwidth_ratio(context, local_dev_count[dev_index],
wiface->attr.dev_num_paths);
local_bw = ucp_wireup_iface_bw_distance(wiface);

if (remote_addr->iface_attr.addr_version == UCP_OBJECT_VERSION_V2) {
/* FP8 is a lossy compression method, so in order to create a symmetric
* calculation we pack/unpack the local bandwidth as well */
local_bw = ucp_wireup_fp8_pack_unpack_bw(local_bw);
}

/* Apply dev num paths ratio after fp8 pack/unpack to make sure it is not
* neglected because of fp8 inaccuracy
*/
local_bw *= ucp_tl_iface_bandwidth_ratio(
context, local_dev_count[dev_index],
wiface->attr.dev_num_paths);

remote_bw = remote_addr->iface_attr.bandwidth *
ucp_tl_iface_bandwidth_ratio(
context, remote_dev_count[remote_addr->dev_index],
Expand Down

0 comments on commit 1a2da4b

Please sign in to comment.