Skip to content

Commit ce790de

Browse files
excelle08facebook-github-bot
authored andcommitted
FeedSim V2: update job config, install and run script (facebookresearch#364)
Summary: - Install DLRM deps and download the model in install scripts - Create a new `feedsim_dlrm` benchmark job for this new workload Reviewed By: YifanYuan3 Differential Revision: D89341996
1 parent fb24ed5 commit ce790de

File tree

11 files changed

+359
-323
lines changed

11 files changed

+359
-323
lines changed

benchpress/config/jobs.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,9 +538,51 @@
538538
options:
539539
is_move: true
540540
after:
541+
- '/tmp/feedsim_log.txt'
541542
- 'benchmarks/feedsim/feedsim_results.txt'
542543
- 'benchmarks/feedsim/src/perf.data'
543544

545+
- name: feedsim_dlrm
546+
benchmark: feedsim
547+
description: >
548+
Aggregator like workload with DLRM (Deep Learning Recommendation Model)
549+
inference. Uses async I/O for improved throughput on high-core CPUs.
550+
Finds maximum QPS that system can sustain while keeping
551+
95th percentile latency <= 500 msecs.
552+
args:
553+
- '-p {port}'
554+
- '-o {output}'
555+
- '--async-io'
556+
- '--io-dist={io_dist}'
557+
- '--io-mean={io_mean}'
558+
- '--workload={workload}'
559+
- '--dlrm-model={dlrm_model}'
560+
- '--dlrm-batch-size={dlrm_batch_size}'
561+
- '--dlrm-threads={dlrm_threads}'
562+
vars:
563+
- 'port=11222'
564+
- 'output=feedsim_results.txt'
565+
- 'io_dist=fixed'
566+
- 'io_mean=200'
567+
- 'workload=dlrm'
568+
- 'dlrm_model=models/dlrm_small.pt'
569+
- 'dlrm_batch_size=256'
570+
- 'dlrm_threads=8'
571+
hooks:
572+
- hook: cpu-mpstat
573+
options:
574+
args:
575+
- '-u' # utilization
576+
- '1' # second interval
577+
- hook: copymove
578+
options:
579+
is_move: true
580+
after:
581+
- '/tmp/feedsim_log.txt'
582+
- 'benchmarks/feedsim/feedsim_results.txt'
583+
- 'benchmarks/feedsim/src/perf.data'
584+
- '/tmp/feedsim_log.txt'
585+
544586
- name: feedsim_autoscale
545587
benchmark: feedsim_autoscale
546588
description: >
@@ -568,6 +610,7 @@
568610
- 'benchmarks/feedsim/feedsim_results*.txt'
569611
- 'benchmarks/feedsim/feedsim-multi-inst-*.log'
570612
- 'benchmarks/feedsim/src/perf.data'
613+
- '/tmp/feedsim_log.txt'
571614

572615
- name: feedsim_autoscale_mini
573616
benchmark: feedsim_autoscale
@@ -613,6 +656,7 @@
613656
- 'benchmarks/feedsim/feedsim-multi-inst-*.log'
614657
- 'benchmarks/feedsim/src/perf.data'
615658
- 'benchmarks/feedsim/breakdown.csv'
659+
- '/tmp/feedsim_log.txt'
616660

617661
- name: feedsim_autoscale_arm
618662
benchmark: feedsim_autoscale
@@ -643,6 +687,7 @@
643687
- 'benchmarks/feedsim/feedsim_results*.txt'
644688
- 'benchmarks/feedsim/feedsim-multi-inst-*.log'
645689
- 'benchmarks/feedsim/src/perf.data'
690+
- '/tmp/feedsim_log.txt'
646691

647692
- name: feedsim_autoscale_arm_mini
648693
benchmark: feedsim_autoscale
@@ -685,6 +730,7 @@
685730
- 'benchmarks/feedsim/feedsim-multi-inst-*.log'
686731
- 'benchmarks/feedsim/src/perf.data'
687732
- 'benchmarks/feedsim/breakdown.csv'
733+
- '/tmp/feedsim_log.txt'
688734

689735

690736
- benchmark: spark_standalone

packages/feedsim/alternative_install_feedsim_aws.sh

Lines changed: 0 additions & 189 deletions
This file was deleted.

packages/feedsim/install_feedsim.sh

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ FEEDSIM_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
1212
BENCHPRESS_ROOT="$(readlink -f "$FEEDSIM_ROOT/../..")"
1313
FEEDSIM_ROOT_SRC="${BENCHPRESS_ROOT}/benchmarks/feedsim"
1414
FEEDSIM_THIRD_PARTY_SRC="${FEEDSIM_ROOT_SRC}/third_party"
15+
LIBTORCH_VERSION="2.1.0"
16+
DLRM_MODEL_URL="https://github.com/facebookresearch/DCPerf-datasets/releases/download/feedsim-dlrm/dlrm_small.tar.gz"
1517
echo "BENCHPRESS_ROOT is ${BENCHPRESS_ROOT}"
1618

1719
source "${BENCHPRESS_ROOT}/packages/common/os-distro.sh"
@@ -48,7 +50,8 @@ fi
4850
dnf install -y bc ninja-build flex bison git texinfo binutils-devel \
4951
libsodium-devel libunwind-devel bzip2-devel double-conversion-devel \
5052
libzstd-devel lz4-devel xz-devel snappy-devel libtool bzip2 openssl-devel \
51-
zlib-devel libdwarf libdwarf-devel libaio-devel libatomic patch jq xxhash xxhash-devel
53+
zlib-devel libdwarf libdwarf-devel libaio-devel libatomic patch jq \
54+
xxhash xxhash-devel unzip
5255

5356
# Creates feedsim directory under benchmarks/
5457
mkdir -p "${BENCHPRESS_ROOT}/benchmarks/feedsim"
@@ -176,6 +179,48 @@ fi
176179

177180
msg "Installing third-party dependencies ... DONE"
178181

182+
# Installing LibTorch for DLRM support
183+
msg "Installing LibTorch for DLRM support..."
184+
cd "${FEEDSIM_THIRD_PARTY_SRC}"
185+
186+
ARCH="$(uname -m)"
187+
if [ "$ARCH" = "x86_64" ]; then
188+
LIBTORCH_URL="https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-${LIBTORCH_VERSION}%2Bcpu.zip"
189+
elif [ "$ARCH" = "aarch64" ]; then
190+
msg "WARNING: Pre-built LibTorch for ARM64 may not be available."
191+
msg "Attempting to download CPU version..."
192+
LIBTORCH_URL="https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-${LIBTORCH_VERSION}%2Bcpu.zip"
193+
else
194+
die "Unsupported architecture: ${ARCH}"
195+
fi
196+
197+
if ! [ -d "libtorch" ]; then
198+
msg "Downloading LibTorch ${LIBTORCH_VERSION}..."
199+
wget "${LIBTORCH_URL}" -O libtorch.zip
200+
msg "Extracting LibTorch..."
201+
unzip -q libtorch.zip
202+
rm libtorch.zip
203+
msg "LibTorch installed to ${FEEDSIM_THIRD_PARTY_SRC}/libtorch"
204+
else
205+
msg "[SKIPPED] LibTorch already installed"
206+
fi
207+
208+
# Download DLRM model
209+
msg "Downloading DLRM model..."
210+
DLRM_MODEL_DIR="${FEEDSIM_ROOT_SRC}/models"
211+
mkdir -p "${DLRM_MODEL_DIR}"
212+
213+
if ! [ -f "${DLRM_MODEL_DIR}/dlrm_small.pt" ]; then
214+
msg "Downloading DLRM model from ${DLRM_MODEL_URL}..."
215+
wget "${DLRM_MODEL_URL}" -O "${DLRM_MODEL_DIR}/dlrm_small.tar.gz"
216+
msg "Extracting DLRM model..."
217+
tar -xzf "${DLRM_MODEL_DIR}/dlrm_small.tar.gz" -C "${DLRM_MODEL_DIR}"
218+
rm "${DLRM_MODEL_DIR}/dlrm_small.tar.gz"
219+
msg "DLRM model installed to ${DLRM_MODEL_DIR}"
220+
else
221+
msg "[SKIPPED] DLRM model already installed"
222+
fi
223+
179224

180225
# Installing FeedSim
181226
cd "${FEEDSIM_ROOT_SRC}"
@@ -203,18 +248,32 @@ fi
203248

204249
mkdir -p build && cd build/
205250

206-
# Build FeedSim
251+
# Build FeedSim with DLRM support
207252
FS_CFLAGS="${BP_CFLAGS:--O3 -DNDEBUG}"
208253
FS_CXXFLAGS="${BP_CXXFLAGS:--O3 -DNDEBUG }"
209254
FS_LDFLAGS="${BP_LDFLAGS:-} -latomic -Wl,--export-dynamic"
210255

211256
cmake -G Ninja \
212257
-DCMAKE_BUILD_TYPE=Release \
213-
-DCMAKE_C_COMPILER="$BP_CC" \
214-
-DCMAKE_CXX_COMPILER="$BP_CXX" \
258+
-DCMAKE_C_COMPILER="${BP_CC:-gcc}" \
259+
-DCMAKE_CXX_COMPILER="${BP_CXX:-g++}" \
215260
-DCMAKE_C_FLAGS_RELEASE="$FS_CFLAGS" \
216261
-DCMAKE_CXX_FLAGS_RELEASE="$FS_CXXFLAGS -DFMT_HEADER_ONLY=1" \
217262
-DCMAKE_EXE_LINKER_FLAGS_RELEASE="$FS_LDFLAGS" \
263+
-DFEEDSIM_USE_DLRM=ON \
264+
-DTorch_DIR="${FEEDSIM_THIRD_PARTY_SRC}/libtorch/share/cmake/Torch" \
265+
-DCMAKE_PREFIX_PATH="${FEEDSIM_THIRD_PARTY_SRC}/libtorch" \
218266
../
219267

220268
ninja -v -j1
269+
270+
msg ""
271+
msg "=== FeedSim Installation Complete ==="
272+
msg ""
273+
msg "To run FeedSim with DLRM workload:"
274+
msg " cd ${FEEDSIM_ROOT_SRC}"
275+
msg " ./run.sh --workload=dlrm --dlrm-model=${DLRM_MODEL_DIR}/dlrm_small.pt"
276+
msg ""
277+
msg "Or use the standard PageRank workload:"
278+
msg " ./run.sh"
279+
msg ""

0 commit comments

Comments
 (0)