Skip to content

feat(presto/slurm): CPU NUMA worker placement and UCX row exchange - #393

Draft
misiugodfrey wants to merge 1 commit into
mainfrom
misiug/bench-cpu-workers
Draft

feat(presto/slurm): CPU NUMA worker placement and UCX row exchange#393
misiugodfrey wants to merge 1 commit into
mainfrom
misiug/bench-cpu-workers

Conversation

@misiugodfrey

Copy link
Copy Markdown
Contributor

Summary

Adds runtime support for launching multiple CPU Presto workers per Slurm node with per-worker NUMA binding and UCX row exchange transport. This is the largest behavior change in the bench33 series.

Based on kjmph's bench33 POC patch.

  • numa-worker-launch.sh (new): thin numactl wrapper that binds a worker process to its assigned NUMA node (cpunodebind + membind) and verifies Cpus_allowed_list / Mems_allowed_list from /proc/self/status before exec; preserves PID across the diagnostic shell so perf can attach
  • prepare_cpu_numa_layout (new function in functions.sh): discovers NUMA topology across all allocated nodes via srun --overlap; builds a per-worker-slot NUMA node assignment table; rejects heterogeneous allocations rather than silently applying mismatched limits
  • run_worker CPU path: spawns one srun per worker slot with computed HTTP port offsets and NUMA node; each slot runs through numa-worker-launch.sh
  • UCX address resolution: resolve_node_ipv4_for_interface / resolve_node_ipv4_for_ucx_device resolve the per-GPU/per-rail internal IP used for each worker's presto.internal-address; handles multi-rail setups via CLUSTER_UCX_NET_DEVICES_BY_LOCAL_WORKER
  • --verify-cpu-ucx: pre-benchmark check that all expected worker UCX ports are responding before query execution starts
  • launch-run.sh: new flags --cpu, --use-numa, --workers-per-host N, --ucx-net-device, --internal-address-interface, --verify-cpu-ucx
  • worker.env: baseline CPU UCX runtime knobs: VELOX_UCX_CPU_EXCHANGE, PRESTO_WORKER_UCX_LOCAL_LIB_FIRST, UCX_MODULE_DIR, UCX_TLS=sysv,tcp,self, UCX_NET_DEVICES, UCX_POSIX_USE_PROC_LINK=n
  • launch-analyze-tables.sh: CPU variant support, --worker-env-file option

Dependencies

Verification

  • On a 2-socket Grace host with CPU_WORKERS_PER_HOST=2, launch a CPU benchmark with --use-numa and verify each worker's container is bound to a distinct NUMA node (check Cpus_allowed_list in worker logs)
  • Verify per-worker HTTP port offsets are unique (e.g. workers at ports 9080, 9083, 9086 for a 3-worker-per-host setup)
  • Run with --verify-cpu-ucx and confirm the preflight check blocks until all UCX ports are responding
  • Run launch-analyze-tables.sh --cpu and verify it successfully runs the analyze job with CPU workers
  • Verify worker.env UCX knobs are picked up: UCX_TLS=sysv,tcp,self and UCX_POSIX_USE_PROC_LINK=n should appear in worker environment
  • On a multi-rail setup with CLUSTER_UCX_NET_DEVICES_BY_LOCAL_WORKER, verify each worker's UCX_NET_DEVICES is set to the correct per-slot NIC
  • Run ./ci/check_style.sh on changed files

@copy-pr-bot

copy-pr-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

Based on kjmph's bench33 POC patch.

Adds runtime support for launching multiple CPU workers per Slurm node
with per-worker NUMA binding and UCX row exchange transport.

- numa-worker-launch.sh: numactl wrapper that binds a worker to its
  assigned NUMA node (cpunodebind + membind) and verifies Cpus_allowed
  and Mems_allowed before exec
- prepare_cpu_numa_layout: discovers NUMA topology across all nodes and
  builds per-worker-slot NUMA node assignments; rejects heterogeneous
  allocations
- run_worker: CPU variant path spawns workers via numa-worker-launch.sh
  with computed NUMA node and HTTP port offsets per slot
- resolve_node_ipv4_for_interface / resolve_node_ipv4_for_ucx_device:
  per-GPU/per-worker UCX rail selection and internal address resolution
- --verify-cpu-ucx: checks all expected worker UCX ports are ready
  before the benchmark starts
- launch-run.sh: --cpu, --use-numa, --workers-per-host, --ucx-device,
  --internal-address-interface, --verify-cpu-ucx flags
- launcher_common.sh: CLUSTER_UCX_NET_DEVICES_BY_LOCAL_WORKER and
  internal address interface maps; per-rail UCX resolution
- worker.env: baseline CPU UCX runtime knobs (VELOX_UCX_CPU_EXCHANGE,
  UCX_TLS, UCX_NET_DEVICES, UCX_POSIX_USE_PROC_LINK, module dir)
- launch-analyze-tables.sh: CPU variant support, --worker-env-file
@misiugodfrey
misiugodfrey force-pushed the misiug/bench-cpu-workers branch from c6f42f5 to 4b78e48 Compare July 28, 2026 16:03
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.

1 participant