-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from mlcommons/mlperf-inference
MLPerf inference regular update to dev
- Loading branch information
Showing
91 changed files
with
1,129 additions
and
1,822 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
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,69 @@ | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: MLPerf inference ABTF POC Test | ||
|
||
on: | ||
pull_request_target: | ||
branches: [ "main", "mlperf-inference" ] | ||
paths: | ||
- '.github/workflows/test-mlperf-inference-abtf-poc.yml' | ||
- '**' | ||
- '!**.md' | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-22.04, ubuntu-20.04, ubuntu-24.04] | ||
python-version: [ "3.8", "3.12" ] | ||
backend: [ "pytorch" ] | ||
implementation: [ "python" ] | ||
exclude: | ||
- os: ubuntu-24.04 | ||
python-version: "3.8" | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
pip install cmind | ||
cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }} | ||
cm pull repo mlcommons@cm4abtf --branch=poc | ||
- name: Test MLPerf Inference ABTF POC using ${{ matrix.backend }} on docker | ||
run: | | ||
cm run script --tags=run-abtf,inference,_poc-demo --adr.compiler.tags=gcc --quiet --docker --docker_it=no -v --gh_token=${{ secrets.ABTF_ACCESS_TOKEN }} | ||
build2: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [macos-latest, macos-13] | ||
python-version: [ "3.8", "3.12" ] | ||
backend: [ "pytorch" ] | ||
implementation: [ "python" ] | ||
exclude: | ||
- os: ubuntu-24.04 | ||
python-version: "3.8" | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install cmind | ||
cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }} | ||
cm pull repo mlcommons@cm4abtf --branch=poc | ||
- name: Test MLPerf Inference ABTF POC using ${{ matrix.backend }} on ${{ matrix.os }} | ||
run: | | ||
cm run script --tags=run-abtf,inference,_poc-demo --adr.compiler.tags=gcc --quiet -v --gh_token=${{ secrets.ABTF_ACCESS_TOKEN }} | ||
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
58 changes: 58 additions & 0 deletions
58
script/app-mlperf-inference-intel/build_resnet50_harness.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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
export PATH=${CM_CONDA_BIN_PATH}:$PATH | ||
echo $PWD | ||
|
||
|
||
export DATA_CAL_DIR=calibration_dataset | ||
export CHECKPOINT=${CM_ML_MODEL_FILE_WITH_PATH} | ||
|
||
cd ${CM_HARNESS_CODE_ROOT} | ||
|
||
cd src/ckernels/ && mkdir -p 3rdparty && \ | ||
cd 3rdparty && \ | ||
(test -e onednn || git clone https://github.com/oneapi-src/oneDNN.git onednn) && \ | ||
cd onednn && \ | ||
git checkout v2.6 && cd ../../../../ | ||
|
||
|
||
export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"} | ||
|
||
export IPEX_PATH=${CM_IPEX_INSTALLED_PATH} | ||
export TORCH_PATH=`python -c 'import torch;print(torch.utils.cmake_prefix_path)'` | ||
|
||
if [[ -z ${TORCH_PATH} ]]; then | ||
echo "Torch not found" | ||
exit 1 | ||
fi | ||
|
||
export LOADGEN_DIR="${CM_MLPERF_INFERENCE_LOADGEN_INSTALL_PATH}/../" | ||
export OPENCV_DIR=${CM_OPENCV_BUILD_PATH} | ||
export RAPIDJSON_INCLUDE_DIR=${CM_RAPIDJSON_SRC_REPO_PATH}/include | ||
export GFLAGS_DIR=${CM_GFLAGS_BUILD_PATH} | ||
export ONEDNN_DIR=${CM_ONEDNN_INSTALLED_PATH} | ||
export USE_CUDA=0 | ||
|
||
BUILD_DIR=${PWD}/build | ||
rm -rf "$BUILD_DIR" | ||
|
||
SRC_DIR=${PWD}/src | ||
|
||
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${OPENCV_DIR}/lib:${ONEDNN_DIR}/build/src:${CONDA_PREFIX}/lib | ||
export LIBRARY_PATH=${LIBRARY_PATH}:${CONDA_PREFIX}/lib | ||
|
||
|
||
cmd="cmake -DCMAKE_PREFIX_PATH=${TORCH_PATH} \ | ||
-DLOADGEN_DIR=${LOADGEN_DIR} \ | ||
-DOpenCV_DIR=${OPENCV_DIR} \ | ||
-DRapidJSON_INCLUDE_DIR=${RAPIDJSON_INCLUDE_DIR} \ | ||
-Dgflags_DIR=${GFLAGS_DIR} \ | ||
-DINTEL_EXTENSION_FOR_PYTORCH_PATH=${IPEX_PATH} \ | ||
-DONEDNN_DIR=${ONEDNN_DIR} \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-B${BUILD_DIR} \ | ||
-H${SRC_DIR}" | ||
echo "$cmd" | ||
eval "$cmd" | ||
test "$?" -eq 0 || exit "$?" | ||
|
||
cmake --build ${BUILD_DIR} --config Release -j$(nproc) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export PATH=${CM_CONDA_BIN_PATH}:$PATH | ||
echo $PWD | ||
|
||
|
||
export DATA_CAL_DIR=calibration_dataset | ||
export CHECKPOINT=${CM_ML_MODEL_FILE_WITH_PATH} | ||
|
||
cd ${CM_HARNESS_CODE_ROOT} | ||
#mkdir -p | ||
#cp src/ckernels/scripts/resnet50-int8-scales.json | ||
bash generate_torch_model.sh | ||
test "$?" -eq 0 || exit "$?" |
Oops, something went wrong.