Skip to content

Commit

Permalink
Merge pull request GATEOverflow#115 from mlcommons/main
Browse files Browse the repository at this point in the history
updating dev branch
  • Loading branch information
ctuning-admin authored Jul 16, 2024
2 parents 5808586 + e459f8d commit 9335505
Show file tree
Hide file tree
Showing 50 changed files with 1,643 additions and 268 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![License](https://img.shields.io/badge/License-Apache%202.0-green)](LICENSE.md)
[![Python Version](https://img.shields.io/badge/python-3+-blue.svg)](https://github.com/mlcommons/ck/tree/master/cm/cmind)
[![Powered by CM](https://img.shields.io/badge/Powered_by-MLCommons%20CM-blue)](https://github.com/mlcommons/ck).
[![Downloads](https://static.pepy.tech/badge/cmind)](https://pepy.tech/project/cmind)
[![Downloads](https://static.pepy.tech/badge/cm4mlops)](https://pepy.tech/project/cm4mlops)

[![CM script automation test](https://github.com/mlcommons/cm4mlops/actions/workflows/test-cm-scripts.yml/badge.svg)](https://github.com/mlcommons/cm4mlops/actions/workflows/test-cm-scripts.yml)
[![CM script automation features test](https://github.com/mlcommons/cm4mlops/actions/workflows/test-cm-script-features.yml/badge.svg)](https://github.com/mlcommons/cm4mlops/actions/workflows/test-cm-script-features.yml)
Expand Down
280 changes: 103 additions & 177 deletions automation/script/module.py

Large diffs are not rendered by default.

21 changes: 17 additions & 4 deletions automation/script/module_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1827,6 +1827,7 @@ def docker(i):
for c_input in input_mapping:
if c_input in i:
env[input_mapping[c_input]] = i[c_input]
#del(i[c_input])

# Updating environment variables from CM input based on docker_input_mapping from meta

Expand All @@ -1835,11 +1836,11 @@ def docker(i):
for c_input in docker_input_mapping:
if c_input in i:
env[docker_input_mapping[c_input]] = i[c_input]
#del(i[c_input])

container_env_string = '' # env keys corresponding to container mounts are explicitly passed to the container run cmd
for index in range(len(mounts)):
mount = mounts[index]

# Since windows may have 2 :, we search from the right
j = mount.rfind(':')
if j>0:
Expand All @@ -1858,10 +1859,12 @@ def docker(i):

tmp_values = re.findall(r'\${{ (.*?) }}', str(host_mount))
skip = False
host_env_key = None
if tmp_values:
for tmp_value in tmp_values:
if tmp_value in env:
new_host_mount = get_host_path(env[tmp_value])
host_env_key = tmp_value
new_host_mount = get_host_path(env[tmp_value])
else:# we skip those mounts
mounts[index] = None
skip = True
Expand All @@ -1870,18 +1873,28 @@ def docker(i):
tmp_values = re.findall(r'\${{ (.*?) }}', str(container_mount))
if tmp_values:
for tmp_value in tmp_values:
container_env_key = tmp_value
if tmp_value in env:
new_container_mount, new_container_mount_env = get_container_path(env[tmp_value])
container_env_string += " --env.{}={} ".format(tmp_value, new_container_mount_env)
container_env_key = new_container_mount_env
#container_env_string += " --env.{}={} ".format(tmp_value, new_container_mount_env)
else:# we skip those mounts
mounts[index] = None
skip = True
break
else:
container_env_key = str(container_mount)

if skip:
continue
mounts[index] = new_host_mount+":"+new_container_mount

if host_env_key:
container_env_string += " --env.{}={} ".format(host_env_key, container_env_key)
# check if the below lines are needed when inputs are mapped to container paths
'''for v in docker_input_mapping:
if docker_input_mapping[v] == host_env_key:
i[v] = container_env_key
'''
mounts = list(filter(lambda item: item is not None, mounts))

mount_string = "" if len(mounts)==0 else ",".join(mounts)
Expand Down
221 changes: 218 additions & 3 deletions script/app-mlperf-inference-intel/_cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ variations:
adr:
pytorch:
tags: _for-intel-mlperf-inference-v3.1
v3.1,dlrm-v2_:
adr:
pytorch:
tags: _for-intel-mlperf-inference-v3.1
v3.1,bert_:
adr:
pytorch:
Expand Down Expand Up @@ -326,6 +330,121 @@ variations:
- pip-package
- optimum

sdxl:
group: model
env:
CM_BENCHMARK: STANDALONE_SDXL
CM_MODEL: stable-diffusion-xl

sdxl,pytorch:
adr:
conda-package:
tags: _name.sdxl-pt
deps:
- tags: get,conda,_name.sdxl-pt
- tags: get,python,_conda.sdxl-pt
adr:
conda-python:
version: "3.9"
- names:
- conda-package
- mkl
tags: get,generic,conda-package,_package.mkl,_source.conda-forge
- names:
- conda-package
- mkl-include
tags: get,generic,conda-package,_package.mkl-include,_source.intel
- names:
- conda-package
- llvm-openmp
tags: get,generic,conda-package,_package.llvm-openmp,_source.conda-forge
- names:
- conda-package
- ncurses
tags: get,generic,conda-package,_package.ncurses,_source.conda-forge
- tags: get,generic-sys-util,_numactl
- tags: get,generic,conda-package,_package.jemalloc,_source.conda-forge
names:
- conda-package
- jemalloc
- tags: get,generic-python-lib,_package.torch,_path.https://download.pytorch.org/whl/nightly/cpu/torch-2.3.0.dev20231214%2Bcpu-cp39-cp39-linux_x86_64.whl
names:
- pip-package
- pip-torch
- tags: get,generic-python-lib,_package.torchvision,_path.https://download.pytorch.org/whl/nightly/cpu/torchvision-0.18.0.dev20231214%2Bcpu-cp39-cp39-linux_x86_64.whl
names:
- pip-package
- pip-torchvision
- tags: get,generic-python-lib,_torch
names:
- pip-package
- torch
- tags: install,diffusers,from.src,_for-intel-mlperf-inference-v4.0-sdxl
names:
- diffusers-from-src
- tags: install,ipex,from.src,_for-intel-mlperf-inference-v4.0-sdxl
names:
- ipex-from-src
- tags: get,generic,conda-package,_package.ninja
names:
- conda-package
- ninja
- tags: get,mlcommons,inference,src
names:
- inference-src
- tags: get,mlcommons,inference,loadgen,_custom-python,_keep-build
names:
- inference-loadgen

sdxl,build-harness:
deps:
- tags: get,generic-python-lib,_package.pybind11[global]
names:
- pip-package
- pybind11

sdxl,run-harness:
deps:
- tags: get,ml-model,sdxl,_fp32,_pytorch
- tags: get,dataset,coco2014,original,_validation
- tags: get,generic-python-lib,_package.opencv-python
names:
- pip-package
- opencv
- tags: get,generic-python-lib,_package.transformers
names:
- pip-package
- transformers
- tags: get,generic-python-lib,_package.accelerate
names:
- pip-package
- accelerate
- tags: get,generic-python-lib,_package.open-clip-torch
names:
- pip-package
- open-clip-torch
- tags: get,generic-python-lib,_package.pycocotools
names:
- pip-package
- pycocotools
- tags: get,generic-python-lib,_package.torchmetrics[image]
names:
- pip-package
- torchmetrics
- tags: get,generic-python-lib,_torchvision
version: "0.17.1"
names:
- pip-package
- torchvision
- tags: get,generic-python-lib,_package.py-libnuma
names:
- pip-package
- libnuma





resnet50,pytorch:
adr:
conda-package:
Expand Down Expand Up @@ -692,8 +811,6 @@ variations:
- tags: get,mlcommons,inference,loadgen,_custom-python
names:
- inference-loadgen
env:
CM_PYTHON_BIN_WITH_PATH: "<<<CM_CONDA_BIN_PATH>>>/python3"
- tags: get,ml-model,large-language-model,gptj
names:
- ml-model
Expand All @@ -712,7 +829,6 @@ variations:
CM_MLPERF_INFERENCE_CODE_VERSION:
- v3.1
env:
CM_PYTHON_BIN_WITH_PATH: "<<<CM_CONDA_BIN_PATH>>>/python3"
"+ CXXFLAGS":
- "-Wno-nonnull"
- "-Wno-maybe-uninitialized"
Expand Down Expand Up @@ -748,6 +864,105 @@ variations:
CM_MODEL: gptj-99.9
CM_NOT_ML_MODEL_STARTING_WEIGHTS_FILENAME: "https://zenodo.org/record/3733910/files/model.onnx"

dlrm-v2_,build-harness:
deps:
- tags: reproduce,mlperf,inference,intel,_calibration
inherit_variation_tags: true
force_cache: true
skip_inherit_variation_groups:
- run-mode
- loadgen-scenario

dlrm-v2_,pytorch:
adr:
conda-package:
tags: _name.dlrm-v2-pt
deps:
- tags: get,conda,_name.dlrm-v2-pt
- tags: get,python,_conda.dlrm-v2-pt
adr:
conda-python:
version: "3.9"
- names:
- conda-package
- mkl
tags: get,generic,conda-package,_package.mkl,_source.conda-forge
- names:
- conda-package
- mkl-include
tags: get,generic,conda-package,_package.mkl-include,_source.conda-forge
- names:
- conda-package
- llvm-openmp
tags: get,generic,conda-package,_package.llvm-openmp,_source.conda-forge
enable_if_env:
CM_MLPERF_INFERENCE_CODE_VERSION:
- v4.0
- names:
- conda-package
- pybind11
tags: get,generic,conda-package,_package.pybind11,_source.conda-forge
enable_if_env:
CM_MLPERF_INFERENCE_CODE_VERSION:
- v4.0
- names:
- conda-package
- ncurses
tags: get,generic,conda-package,_package.ncurses,_source.conda-forge
- names:
- conda-package
- ncurses
tags: get,generic,conda-package,_package.ncurses,_source.conda-forge
- tags: get,generic-sys-util,_numactl
- tags: get,generic,conda-package,_package.jemalloc,_source.conda-forge
names:
- conda-package
- jemalloc
- tags: install,ipex,from.src,_for-intel-mlperf-inference-v3.1-dlrm-v2
names:
- ipex-from-src
- tags: get,mlcommons,inference,src
names:
- inference-src
- tags: get,mlcommons,inference,loadgen,_custom-python
names:
- inference-loadgen
- tags: get,ml-model,dlrm,_pytorch
names:
- ml-model
- dlrm-v2-model
- dlrm_v2-model
- tags: get,generic-python-lib,_package.absl-py
names:
- pip-package
- absl-py
- tags: get,generic-python-lib,_package.accelerate
names:
- pip-package
- accelerate
- tags: get,generic-python-lib,_package.torch,_path.https://download.pytorch.org/whl/nightly/cpu-cxx11-abi/torch-2.1.0.dev20230715%2Bcpu.cxx11.abi-cp39-cp39-linux_x86_64.whl
names:
- pip-package
- pip-torch
dlrm-v2_:
env: {}

dlrm-v2-99:
group: model
base:
- dlrm-v2_
env:
CM_MODEL: dlrm-v2-99
CM_ML_MODEL_WEIGHTS_DATA_TYPE: int8
CM_ML_MODEL_INPUTS_DATA_TYPE: int8

dlrm-v2-99.9:
group: model
base:
- dlrm-v2_
env:
CM_MODEL: dlrm-v2-99.9

standalone:
group: network-mode
default: true
Expand Down
27 changes: 27 additions & 0 deletions script/app-mlperf-inference-intel/build_sdxl_harness.sh
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 ..

19 changes: 19 additions & 0 deletions script/app-mlperf-inference-intel/calibrate_dlrm_v2_model.sh
Original file line number Diff line number Diff line change
@@ -0,0 +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}
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 $?
Loading

0 comments on commit 9335505

Please sign in to comment.