forked from mlcommons/cm4mlops
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'mlperf-inference' into nvidia-llama2
- Loading branch information
Showing
25 changed files
with
584 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
cd ${CM_HARNESS_CODE_ROOT} | ||
|
||
cd utils | ||
cmd=" python -m pip install ." | ||
|
||
echo "$cmd" | ||
eval "$cmd" | ||
test "$?" -eq 0 || exit "$?" | ||
|
||
cd ../tools | ||
wget https://raw.githubusercontent.com/mlcommons/inference/master/text_to_image/tools/coco.py | ||
test "$?" -eq 0 || exit "$?" | ||
cd .. | ||
|
||
mkdir -p coco2014/captions | ||
wget -P coco2014/captions/ https://raw.githubusercontent.com/mlcommons/inference/master/text_to_image/coco2014/captions/captions_source.tsv | ||
test "$?" -eq 0 || exit "$?" | ||
|
||
mkdir -p coco2014/latents | ||
wget -P coco2014/latents/ https://github.com/mlcommons/inference/raw/master/text_to_image/tools/latents.pt | ||
test "$?" -eq 0 || exit "$?" | ||
|
||
cd tools/ | ||
bash download-coco-2014-calibration.sh --download-path ${PWD}/../coco2014/warmup_dataset --num-workers 1 | ||
test "$?" -eq 0 || exit "$?" | ||
cd .. | ||
|
16 changes: 14 additions & 2 deletions
16
script/app-mlperf-inference-intel/calibrate_dlrm_v2_model.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
#!/bin/bash | ||
|
||
export MODEL_DIR=${CM_ML_MODEL_FILE_WITH_PATH} | ||
export DATA_DIR=/mnt/dlrm_data | ||
echo ${CM_HARNESS_CODE_ROOT} | ||
cd ${CM_HARNESS_CODE_ROOT} | ||
numactl -m 1 python python/dump_torch_model.py --model-path=$MODEL_DIR --dataset-path=$DATA_DIR | ||
exit 1 | ||
python -m pip install scikit-learn==1.3.0 torchsnapshot torchrec==0.3.2 | ||
test $? -eq 0 || exit $? | ||
python -m pip install fbgemm-gpu==0.3.2 --index-url https://download.pytorch.org/whl/cpu | ||
test $? -eq 0 || exit $? | ||
python python/dump_torch_model.py --model-path=$MODEL_DIR --dataset-path=$DATA_DIR | ||
test $? -eq 0 || exit $? | ||
|
||
python python/calibration.py \ | ||
--max-batchsize=65536 \ | ||
--model-path=${MODEL_DIR}/../dlrm-multihot-pytorch.pt \ | ||
--dataset-path=/mnt/dlrm_data/ \ | ||
--use-int8 --calibration | ||
test $? -eq 0 || exit $? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/bash | ||
export MODEL_DIR=${CM_ML_MODEL_FILE_WITH_PATH} | ||
export DATA_DIR=/mnt/dlrm_data | ||
|
||
|
||
NUM_SOCKETS=${CM_HOST_CPU_SOCKETS:-2} | ||
export NUM_SOCKETS=$NUM_SOCKETS | ||
export num_physical_cores=`lscpu -b -p=Core,Socket | grep -v '^#' | sort -u | wc -l` | ||
export CPUS_PER_SOCKET=$((num_physical_cores/NUM_SOCKETS)) | ||
echo $CPUS_PER_SOCKET | ||
export CPUS_PER_PROCESS=24 | ||
#${CPUS_PER_SOCKET} | ||
export CPUS_PER_INSTANCE=1 | ||
export CPUS_FOR_LOADGEN=1 | ||
export BATCH_SIZE=100 | ||
export DNNL_MAX_CPU_ISA=AVX512_CORE_AMX | ||
|
||
export LD_PRELOAD=${CM_CONDA_LIB_PATH}/libiomp5.so | ||
|
||
export KMP_BLOCKTIME=1 | ||
export OMP_NUM_THREADS=$CPUS_PER_INSTANCE | ||
export KMP_AFFINITY="granularity=fine,compact,1,0" | ||
export DNNL_PRIMITIVE_CACHE_CAPACITY=20971520 | ||
export DLRM_DIR=$PWD/python/model | ||
#export TCMALLOC_LARGE_ALLOC_REPORT_THRESHOLD=30469645312 | ||
|
||
mode="Offline" | ||
extra_option="--samples-per-query-offline=204800" | ||
|
||
int8_cfg="--int8-configure-dir=int8_configure.json" | ||
echo "Running $mode bs=$batch_size $dtype $test_type $DNNL_MAX_CPU_ISA" | ||
|
||
export CUDA_VISIBLE_DEVICES="" | ||
extra_option=" $extra_option --use-int8" | ||
export EXTRA_OPS="$extra_option" | ||
|
||
#export number_cores=`lscpu -b -p=Core,Socket | grep -v '^#' | sort -u | wc -l` | ||
|
||
model_path="$MODEL_DIR/dlrm-multihot-pytorch.pt" | ||
profile=dlrm-multihot-pytorch | ||
cd ${CM_HARNESS_CODE_ROOT} | ||
OUTPUT_DIR="${CM_MLPERF_OUTPUT_DIR}" | ||
|
||
if [[ "${CM_MLPERF_LOADGEN_MODE}" == "accuracy" ]]; then | ||
accuracy_opt=" --accuracy" | ||
else | ||
accuracy_opt="" | ||
fi | ||
|
||
USER_CONF="${CM_MLPERF_USER_CONF}" | ||
cmd="python -u python/runner.py --profile $profile $common_opt --model dlrm --model-path $model_path \ | ||
--config ${CM_MLPERF_CONF} --user-config ${CM_MLPERF_USER_CONF} \ | ||
--dataset multihot-criteo --dataset-path $DATA_DIR --output $OUTPUT_DIR $EXTRA_OPS \ | ||
--max-ind-range=40000000 --samples-to-aggregate-quantile-file=${PWD}/tools/dist_quantile.txt \ | ||
--max-batchsize=$BATCH_SIZE --scenario=${CM_MLPERF_LOADGEN_SCENARIO} ${accuracy_opt}" | ||
|
||
|
||
echo "$cmd" | ||
#exit 1 | ||
eval "$cmd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/bash | ||
|
||
export KMP_BLOCKTIME=1 | ||
export KMP_AFFINITY=granularity=fine,compact,1,0 | ||
export LD_PRELOAD=${LD_PRELOAD}:${CONDA_PREFIX}/lib/libiomp5.so | ||
# export LD_PRELOAD=${LD_PRELOAD}:${CONDA_PREFIX}/lib/libtcmalloc.so | ||
# | ||
|
||
BATCH_SIZE=${CM_MLPERF_LOADGEN_BATCH_SIZE} | ||
|
||
export num_physical_cores=$(lscpu -b -p=Core,Socket | grep -v '^#' | sort -u | wc -l) | ||
num_numa=$(numactl --hardware|grep available|awk -F' ' '{ print $2 }') | ||
|
||
|
||
|
||
OUTPUT_DIR="${CM_MLPERF_OUTPUT_DIR}" | ||
MODEL_PATH="${SDXL_CHECKPOINT_PATH}" | ||
cd ${CM_HARNESS_CODE_ROOT} | ||
|
||
NUM_PROC=1 | ||
CPUS_PER_PROC=16 | ||
WORKERS_PER_PROC=1 | ||
TOTAL_SAMPLE_COUNT=5000 | ||
BATCH_SIZE=8 | ||
|
||
FD_MAX=$(ulimit -n -H) | ||
ulimit -n $((FD_MAX - 1)) | ||
|
||
echo "Start time: $(date)" | ||
cmd="python -u main.py \ | ||
--dtype bfloat16 \ | ||
--device 'cpu' \ | ||
--scenario ${CM_MLPERF_LOADGEN_SCENARIO} \ | ||
--mode ${LOADGEN_MODE} \ | ||
--num-proc ${NUM_PROC} \ | ||
--cpus-per-proc ${CPUS_PER_PROC} \ | ||
--model-path ${MODEL_PATH} \ | ||
--batch-size ${BATCH_SIZE} \ | ||
--mlperf-conf ${CM_MLPERF_CONF} \ | ||
--user-conf ${CM_MLPERF_USER_CONF} \ | ||
--workers-per-proc ${WORKERS_PER_PROC} \ | ||
--total-sample-count ${TOTAL_SAMPLE_COUNT} \ | ||
--log-dir ${OUTPUT_DIR} " | ||
|
||
echo "$cmd" | ||
eval "$cmd" | ||
test $? -eq 0 || exit $? | ||
echo "End time: $(date)" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.