Skip to content

Commit 3ba4246

Browse files
excelle08meta-codesync[bot]
authored andcommitted
LeafNodeRank: kOutboundFanoutWindow=16, driver_threads=nproc/4 on SMT-on (#734)
Summary: Pull Request resolved: #734 Two small platform-tuning changes: 1. LeafNodeRank.cc: kOutboundFanoutWindow 32 → 16. With nproc-sized ThriftSrv.IO pool (D105119223) and per-MockClient EventBase placement, 32 was overbatching outbound RPCs per request and inflating dispatch_per_rpc tail latency on BGM/Turin (88-176 cores). 16 keeps a sane queue depth on big-SMT hosts without meaningful throughput loss on smaller boxes. 2. run.sh: DRIVER_THREADS unified at nproc/4 across SMT-on and SMT-off. Previously SMT-on used nproc/5, SMT-off used nproc/4 — an inconsistency that under-pinned driver work on big SMT hosts (e.g. BGM 176 logical: 35 SMT-on driver threads vs 44 SMT-off). Using nproc/4 in both branches removes one source of cross-platform variance. Reviewed By: YifanYuan3 Differential Revision: D105659809 fbshipit-source-id: e276e98b443f2aa447c4bd53edd37f717abce92a
1 parent 576a428 commit 3ba4246

2 files changed

Lines changed: 8 additions & 11 deletions

File tree

packages/feedsim/run.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,16 @@ EVENTBASE_THREADS_DEFAULT="$(nproc)" # nproc threads so the ThriftSrv.IO pool i
5050
SRV_THREADS_DEFAULT=8 # 8 should also suffice for most purposes
5151
if [[ "$IS_SMT_ON" = 1 ]]; then
5252
RANKING_THREADS_DEFAULT="$(( $(nproc) * 7/20))" # 7/20 is 0.35 cpu factor
53-
DRIVER_THREADS="$(echo "scale=2; $(nproc) / 5.0 + 0.5 " | bc )" # Driver threads, rounds nearest.
54-
DRIVER_THREADS="${DRIVER_THREADS%.*}" # Truncate decimal fraction.
55-
DRIVER_THREADS="$(echo "${BC_MAX_FN}; max(${DRIVER_THREADS:-0}, 4)" | bc )" # At least 4 threads.
5653
else
5754
RANKING_THREADS_DEFAULT="$(( $(nproc) * 15/20))" # 15/20 is 0.75 cpu factor
58-
DRIVER_THREADS="$(echo "scale=2; $(nproc) / 4.0 + 0.5 " | bc )" # Driver threads, rounds nearest.
59-
DRIVER_THREADS="${DRIVER_THREADS%.*}" # Truncate decimal fraction.
60-
DRIVER_THREADS="$(echo "${BC_MAX_FN}; max(${DRIVER_THREADS:-0}, 4)" | bc )" # At least 4 threads.
6155
fi
56+
# Driver threads = nproc/4 across SMT-on / SMT-off. Previously the SMT-on
57+
# branch used nproc/5, which under-pinned driver work on big SMT boxes
58+
# (e.g. BGM 176 logical → 35 vs 44 threads). Standardizing both branches
59+
# at nproc/4 removes one source of cross-platform variance.
60+
DRIVER_THREADS="$(echo "scale=2; $(nproc) / 4.0 + 0.5 " | bc )" # rounds nearest
61+
DRIVER_THREADS="${DRIVER_THREADS%.*}" # Truncate decimal fraction.
62+
DRIVER_THREADS="$(echo "${BC_MAX_FN}; max(${DRIVER_THREADS:-0}, 4)" | bc )" # At least 4 threads.
6263

6364
show_help() {
6465
cat <<EOF

packages/feedsim/third_party/src/workloads/ranking/LeafNodeRank.cc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -728,11 +728,7 @@ static feedsim::LatencyHistogram g_sampled_lat_us;
728728
// dispatch_per_rpc averages ~500ms even though mock_handler_actual was
729729
// ~4ms — pure EB queue depth. window(K) issues K up-front and then
730730
// refills as each completes, capping per-request EB pressure.
731-
//
732-
// 32 was picked to be small enough to keep the EB queue shallow (each
733-
// in-flight RPC ~5-200ms means the queue completes in 50-300ms) while
734-
// still amortizing the per-RPC overhead of the window machinery.
735-
static constexpr size_t kOutboundFanoutWindow = 32;
731+
static constexpr size_t kOutboundFanoutWindow = 16;
736732

737733
namespace {
738734
struct FanoutSpec {

0 commit comments

Comments
 (0)