Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge from go #82

Merged
merged 8 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-image-classification-onnx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: image classification with ONNX

on:
pull_request:
branches: [ "main", "dev", "mlperf-inference" ]
branches: [ "main", "dev" ]
paths:
- '.github/workflows/test-image-classification-onnx.yml'
- '**'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: MLPerf loadgen with HuggingFace bert onnx fp32 squad model

on:
pull_request:
branches: [ "main", "dev", "mlperf-inference" ]
branches: [ "main", "dev" ]
paths:
- '.github/workflows/test-mlperf-loadgen-onnx-huggingface-bert-fp32-squad.yml'
- '**'
Expand Down
54 changes: 41 additions & 13 deletions script/app-mlperf-inference-intel/_cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,6 @@ deps:
- ml-model
tags: get,ml-model,resnet50,_fp32,_pytorch

- enable_if_env:
CM_MODEL:
- resnet50
tags: compile,intel,model,_resnet50
names:
- resnet50-compiler

- enable_if_env:
CM_MODEL:
- resnet50
Expand Down Expand Up @@ -164,27 +157,37 @@ variations:
default: true
env:
CM_MLPERF_INFERENCE_CODE_VERSION: "v4.0"
adr:
pytorch:
tags: _for-intel-mlperf-inference-v4.0
deps:
- tags: get,mlperf,inference,results,_go
names:
inference-results
version: v4.0
v4.0,gptj_:
adr:
pytorch:
tags: _for-intel-mlperf-inference-v4.0
v4.0,bert_:
adr:
pytorch:
tags: _for-intel-mlperf-inference-v4.0
v3.1:
group: version
env:
CM_MLPERF_INFERENCE_CODE_VERSION: "v3.1"
adr:
pytorch:
tags: _for-intel-mlperf-inference-v3.1
deps:
- tags: get,mlperf,inference,results,_ctuning
names:
inference-results
version: v3.1

v3.1,gptj_:
adr:
pytorch:
tags: _for-intel-mlperf-inference-v3.1
v3.1,bert_:
adr:
pytorch:
tags: _for-intel-mlperf-inference-v3.1

# Target devices
cpu:
Expand Down Expand Up @@ -384,6 +387,26 @@ variations:
enable_if_env:
CM_MLPERF_INFERENCE_CODE_VERSION:
- 'v4.0'

resnet50,_build-harness:
deps:
tags: app,mlperf,inference,intel,_compile-model
inherit_variation_tags: true
force_cache: true
skip_inherit_variation_groups:
- run-mode
- loadgen-scenario

resnet50,_compile-model:
deps:
tags: app,mlperf,inference,intel,_calibration
inherit_variation_tags: true
force_cache: true
skip_inherit_variation_groups:
- run-mode
- loadgen-scenario


gptj_,pytorch:
adr:
conda-package:
Expand Down Expand Up @@ -587,6 +610,11 @@ variations:
- CM_ML_MODEL_*
- DATA_PATH

compile-model:
group: run-mode
env:
CM_LOCAL_MLPERF_INFERENCE_INTEL_RUN_MODE: compilation

calibration:
group: run-mode
env:
Expand Down
7 changes: 7 additions & 0 deletions script/app-mlperf-inference-intel/compile_resnet50.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export DATA_CAL_DIR=calibration_dataset
export CHECKPOINT=resnet50-fp32-model.pth

cd ${CM_HARNESS_CODE_ROOT}
bash generate_torch_model.sh

bash build_binaries.sh
22 changes: 14 additions & 8 deletions script/app-mlperf-inference-intel/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,20 @@ def preprocess(i):
env['CONDA_PREFIX'] = env['CM_CONDA_PREFIX']

if env['CM_LOCAL_MLPERF_INFERENCE_INTEL_RUN_MODE'] == "calibration":
calibration_root = os.path.join(env['CM_MLPERF_INFERENCE_RESULTS_PATH'], 'closed', 'Intel', 'calibration', master_model, backend+"-"+device)

if "gpt" in env['CM_MODEL']:
i['run_script_input']['script_name'] = "calibrate_gptj_int4_model"
calibration_path = os.path.join(calibration_root, "INT4")
env['CM_MLPERF_INFERENCE_INTEL_CALIBRATION_PATH'] = calibration_path
env['INT4_CALIBRATION_DIR'] = os.path.join(calibration_path, "data", "quantized-int4-model")

if master_model == "resnet50":
i['run_script_input']['script_name'] = "prepare_imagenet_calibration"
else:
calibration_root = os.path.join(env['CM_MLPERF_INFERENCE_RESULTS_PATH'], 'closed', 'Intel', 'calibration', master_model, backend+"-"+device)

if "gpt" in env['CM_MODEL']:
i['run_script_input']['script_name'] = "calibrate_gptj_int4_model"
calibration_path = os.path.join(calibration_root, "INT4")
env['CM_MLPERF_INFERENCE_INTEL_CALIBRATION_PATH'] = calibration_path
env['INT4_CALIBRATION_DIR'] = os.path.join(calibration_path, "data", "quantized-int4-model")

elif env['CM_LOCAL_MLPERF_INFERENCE_INTEL_RUN_MODE'] == "compilation":
if master_model == "resnet50":
i['run_script_input']['script_name'] = "compile_resnet50"

elif env['CM_LOCAL_MLPERF_INFERENCE_INTEL_RUN_MODE'] == "build_harness":
print(f"Harness Root: {harness_root}")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if [ ! -e ILSVRC2012_img_val ]; then
ln -s ${CM_DATASET_IMAGENET_VAL_PATH} ILSVRC2012_img_val
fi

bash prepare_calibration_dataset.sh
3 changes: 2 additions & 1 deletion script/app-mlperf-inference-nvidia/_cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,10 @@ variations:
- tags: get,generic-python-lib,_package.nibabel
- tags: get,generic-python-lib,_pandas
version_max: "1.5.3"
- tags: get,generic-python-lib,_onnx-graphsurgeon
version: 0.3.27
- tags: get,generic-python-lib,_package.onnx
version: 1.13.1
- tags: get,generic-python-lib,_onnx-graphsurgeon

3d-unet-99:
group: model
Expand Down
5 changes: 5 additions & 0 deletions script/get-git-repo/_cm.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@
"CM_GIT_SUBMODULES": "#"
}
},
"pr-to-apply.#": {
"env": {
"CM_GIT_PR_TO_APPLY": "#"
}
},
"repo.#": {
"group": "repo",
"env": {
Expand Down
5 changes: 5 additions & 0 deletions script/get-git-repo/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ else
cd ${folder}
fi

if [ ! -z ${CM_GIT_PR_TO_APPLY} ]; then
git fetch origin ${CM_GIT_PR_TO_APPLY}:tmp-apply
git config user.email "temp@example.com"
git merge tmp-apply --no-edit
fi

IFS=',' read -r -a submodules <<< "${CM_GIT_SUBMODULES}"

Expand Down
13 changes: 0 additions & 13 deletions script/get-rclone/accessfiles/rclone-gdrive.json

This file was deleted.

2 changes: 1 addition & 1 deletion script/get-rclone/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def postprocess(i):
config_file_path = os.path.join(env['CM_TMP_CURRENT_SCRIPT_PATH'], "configs", "rclone.conf")

config.read(config_file_path)
config['cm-team']['service_account_file'] = os.path.join(env['CM_TMP_CURRENT_SCRIPT_PATH'], "accessfiles", "rclone-gdrive.json")
#config['cm-team']['service_account_file'] = os.path.join(env['CM_TMP_CURRENT_SCRIPT_PATH'], "accessfiles", "rclone-gdrive.json")

default_config_path = os.path.join(os.path.expanduser( '~' ), ".config", "rclone", "rclone.conf")

Expand Down
73 changes: 69 additions & 4 deletions script/install-ipex-from-src/_cm.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
"pytorch"
],
"skip_if_env": {
"CM_CONDA_ENV": [
"yes"
]
"CM_IPEX_SKIP_PYTORCH": [ "yes" ]
},
"tags": "get,pytorch,from.src"
},
Expand Down Expand Up @@ -146,7 +144,74 @@
}
],
"env": {
"CM_CONDA_ENV": "yes"
"CM_CONDA_ENV": "yes",
"CM_IPEX_SKIP_PYTORCH": "yes",
"CM_USE_LLVM_FOR_IPEX": "yes"
}
},
"for-intel-mlperf-inference-v3.1-resnet50": {
"alias": "for-intel-mlperf-inference-resnet50"
},
"for-intel-mlperf-inference-resnet50": {
"adr": {
"conda-package": {
"tags": "_name.resnet50-pt"
},
"pytorch": {
"tags": "_for-intel-mlperf-inference-resnet50"
}
},
"base": [
"tag.v1.12.0"
],
"deps": [
{
"names": [
"conda"
],
"tags": "get,conda,_name.resnet50-pt"
},
{
"names": [
"conda-package",
"python3"
],
"tags": "get,generic,conda-package,_package.python",
"version": "3.9"
},
{
"names": [
"conda-package",
"wheel"
],
"tags": "get,generic,conda-package,_package.wheel,_source.conda-forge"
},
{
"names": [
"conda-package",
"setuptools"
],
"version": "69.5.1",
"tags": "get,generic,conda-package,_package.setuptools,_source.conda-forge"
},
{
"names": [
"conda-package",
"typing-extensions"
],
"tags": "get,generic,conda-package,_package.typing-extensions,_source.conda-forge"
},
{
"names": [
"conda-package",
"sympy"
],
"tags": "get,generic,conda-package,_package.sympy,_source.conda-forge"
}
],
"env": {
"CM_CONDA_ENV": "yes",
"CM_INTEL_IPEX_RESNET50_PATCH": "yes"
}
},
"repo.#": {
Expand Down
6 changes: 6 additions & 0 deletions script/install-ipex-from-src/apply_intel_resnet50_patch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cd $IPEX_DIR
wget -nc https://github.com/mlcommons/inference_results_v3.1/blob/main/closed/Intel/code/resnet50/pytorch-cpu/input_output_aligned_scales.patch
test $? -eq 0 || exit $?
git apply input_output_aligned_scales.patch
test $? -eq 0 || exit $?
cd -
14 changes: 11 additions & 3 deletions script/install-ipex-from-src/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,21 @@ def preprocess(i):
env = i['env']

env['IPEX_DIR'] = env['CM_IPEX_SRC_REPO_PATH']
env['DNNL_GRAPH_BUILD_COMPILER_BACKEND'] = 1
env['USE_LLVM'] = env['CM_LLVM_INSTALLED_PATH']
env['LLVM_DIR'] = os.path.join(env['CM_LLVM_INSTALLED_PATH'], "lib", "cmake", "llvm")

if env.get('CM_USE_LLVM_FOR_IPEX', '') == 'yes':
env['DNNL_GRAPH_BUILD_COMPILER_BACKEND'] = 1
env['USE_LLVM'] = env['CM_LLVM_INSTALLED_PATH']
env['LLVM_DIR'] = os.path.join(env['CM_LLVM_INSTALLED_PATH'], "lib", "cmake", "llvm")

run_cmd="python setup.py clean && python setup.py install"

env['CM_RUN_DIR'] = env['IPEX_DIR']
env['CM_RUN_CMD'] = run_cmd

return {'return':0}

def postprocess(i):

env = i['env']

return {'return':0}
5 changes: 5 additions & 0 deletions script/install-ipex-from-src/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

export PATH=${CM_CONDA_BIN_PATH}:${PATH}

if [[ ${CM_INTEL_IPEX_RESNET50_PATCH} == "yes" ]]; then
bash ${CM_TMP_CURRENT_SCRIPT_PATH}/apply_intel_resnet50_patch.sh
fi

cd ${CM_RUN_DIR}
echo ${CM_RUN_CMD}
eval ${CM_RUN_CMD}

if [ "${?}" != "0" ]; then exit 1; fi

echo "******************************************************"

Loading
Loading