diff --git a/README_CN.md b/README_ZH.md similarity index 100% rename from README_CN.md rename to README_ZH.md diff --git a/scripts/OWNERS b/scripts/OWNERS new file mode 100644 index 0000000000000000000000000000000000000000..4302181bbf5cafe9ca9c69d1271037ac7b236399 --- /dev/null +++ b/scripts/OWNERS @@ -0,0 +1,3 @@ +approvers: +- zhoufeng54 +- jjfeing diff --git a/scripts/check_clang_format.sh b/scripts/check_clang_format.sh new file mode 100755 index 0000000000000000000000000000000000000000..3e3e64cecb91b7bf84e02eeaac0d1fb3d0d921d9 --- /dev/null +++ b/scripts/check_clang_format.sh @@ -0,0 +1,130 @@ +#!/bin/bash +# Copyright 2019 Huawei Technologies Co., Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================ + +set -e + +CLANG_FORMAT=$(which clang-format) || (echo "Please install 'clang-format' tool first"; exit 1) + +version=$("${CLANG_FORMAT}" --version | sed -n "s/.*\ \([0-9]*\)\.[0-9]*\.[0-9]*.*/\1/p") +if [[ "${version}" -lt "8" ]]; then + echo "clang-format's version must be at least 8.0.0" + exit 1 +fi + +CURRENT_PATH=$(pwd) +SCRIPTS_PATH=$(dirname "$0") + +echo "CURRENT_PATH=$CURRENT_PATH" +echo "SCRIPTS_PATH=$SCRIPTS_PATH" + +# print usage message +function usage() +{ + echo "Check whether the specified source files were well formatted" + echo "Usage:" + echo "bash $0 [-a] [-c] [-l] [-h]" + echo "e.g. $0 -a" + echo "" + echo "Options:" + echo " -a Check code format of all files, default case" + echo " -c Check code format of the files changed compared to last commit" + echo " -l Check code format of the files changed in last commit" + echo " -h Print usage" +} + +# check and set options +function checkopts() +{ + # init variable + mode="all" # default check all files + + # Process the options + while getopts 'aclh' opt + do + case "${opt}" in + a) + mode="all" + ;; + c) + mode="changed" + ;; + l) + mode="lastcommit" + ;; + h) + usage + exit 0 + ;; + *) + echo "Unknown option ${opt}!" + usage + exit 1 + esac + done +} + +# init variable +# check options +checkopts "$@" + +# switch to project root path, which contains clang-format config file '.clang-format' +cd "${SCRIPTS_PATH}/.." || exit 1 + +CHECK_LIST_FILE='__checked_files_list__' + +if [ "X${mode}" == "Xall" ]; then + find mindspore/{ccsrc,core,lite} -type f -name "*" | grep "\.h$\|\.cc$\|\.c$" > "${CHECK_LIST_FILE}" || true +elif [ "X${mode}" == "Xchanged" ]; then + # --diff-filter=ACMRTUXB will ignore deleted files in commit + git diff --diff-filter=ACMRTUXB --name-only | grep "mindspore/ccsrc\|mindspore/core\|mindspore/lite" | grep "\.h$\|\.cc$\|\.c$" > "${CHECK_LIST_FILE}" || true +else # "X${mode}" == "Xlastcommit" + git diff --diff-filter=ACMRTUXB --name-only HEAD~ HEAD | grep "mindspore/ccsrc\|mindspore/core\|mindspore/lite" | grep "\.h$\|\.cc$\|\.c$" > "${CHECK_LIST_FILE}" || true +fi + +CHECK_RESULT_FILE=__code_format_check_result__ +echo "0" > "$CHECK_RESULT_FILE" + +set +e + +# check format of files modified in the latest commit +while read line; do + if [ ! -e ${line} ]; then + continue + fi + BASE_NAME=$(basename "${line}") + TEMP_FILE="__TEMP__${BASE_NAME}" + cp "${line}" "${TEMP_FILE}" + ${CLANG_FORMAT} -i "${TEMP_FILE}" + diff "${TEMP_FILE}" "${line}" + ret=$? + rm "${TEMP_FILE}" + if [[ "${ret}" -ne 0 ]]; then + echo "File ${line} is not formatted, please format it." + echo "1" > "${CHECK_RESULT_FILE}" + break + fi +done < "${CHECK_LIST_FILE}" + +set -e + +result=$(cat "${CHECK_RESULT_FILE}") +rm "${CHECK_RESULT_FILE}" +rm "${CHECK_LIST_FILE}" +cd "${CURRENT_PATH}" || exit 1 +if [[ "X${result}" == "X0" ]]; then + echo "Check PASS: specified files are well formatted!" +fi +exit "${result}" diff --git a/scripts/check_tid.sh b/scripts/check_tid.sh new file mode 100755 index 0000000000000000000000000000000000000000..cfdad069c453efd47bd9cc0f24acefc633205d09 --- /dev/null +++ b/scripts/check_tid.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +SCRIPT_DIR=$(dirname "$0") +MS_DIR=$(realpath ${SCRIPT_DIR}/..) +BUILD_DIR=${MS_DIR}/build +HASH_EXE=${BUILD_DIR}/gentid +HASH_SRC=${BUILD_DIR}/gentid.cc + +mkdir -p ${BUILD_DIR} +echo "#include " > ${HASH_SRC} +echo "#include \"${MS_DIR}/mindspore/core/utils/hashing.h\"" >> ${HASH_SRC} +echo "int main(int argc, char *argv[0]) { std::cout << mindspore::ConstStringHash(argv[1]) << std::endl; }" >> ${HASH_SRC} +g++ -std=c++17 -o ${HASH_EXE} ${HASH_SRC} + +BASE_TID=$(${HASH_EXE} Base) +declare -A TIDMAP=( [${BASE_TID}]=Base ) + +grep -r MS_DECLARE_PARENT --include=*.h --include=*.cc ${MS_DIR} | while read line +do +#echo $line +if [[ "$line" =~ .*\((.*)\,(.*)\).* ]] +then +CLASS_NAME=${BASH_REMATCH[2]}_${BASH_REMATCH[1]} +TID=$(${HASH_EXE} ${CLASS_NAME}) +if [ ${TIDMAP[${TID}]+_} ]; then + echo $line + echo Same tid $TID is used by $CLASS_NAME and ${TIDMAP[${TID}]}. + exit 1 +fi +TIDMAP[${TID}]=${CLASS_NAME} +echo ${TID} ${CLASS_NAME} +fi +done +if [ $? != 0 ];then + echo 'Check tid failed!' + exit 1 +fi +echo 'All tids are unique, check tid ok.' diff --git a/scripts/conda/OWNERS b/scripts/conda/OWNERS new file mode 100644 index 0000000000000000000000000000000000000000..bbace273463eb159a304547ed50fd20ad17e5271 --- /dev/null +++ b/scripts/conda/OWNERS @@ -0,0 +1,6 @@ +approvers: +- zhoufeng54 +- jjfeing +- kisnwang +reviewers: +- HW_KK \ No newline at end of file diff --git a/scripts/conda/README.md b/scripts/conda/README.md new file mode 100644 index 0000000000000000000000000000000000000000..1d2459ca175e61f0c69d2546b6ab2c83cc18af5e --- /dev/null +++ b/scripts/conda/README.md @@ -0,0 +1,15 @@ +## MindSpore Conda build file Repository + +This folder hosts all files relating to building conda packages, to download existing conda packages, simply typing +conda install -c mindspore mindspore-{platform} +in conda environments, whereby {platform} refers to hardware platform supported by MindSpore, including CPU, GPU and Ascend + +### MindSpore conda install command + +| Hardware Platform | Version | Download Command | +| :---------------- | :------ | :------------ | +| Ascend | `x.y.z` | conda install -c mindspore mindspore-ascend=x.y.z | +| CPU | `x.y.z` | conda install -c mindspore mindspore-cpu=x.y.z | +| GPU | `x.y.z` | conda install -c mindspore mindspore-gpu=x.y.z | + +> **NOTICE:** The `x.y.z` version shown above should be replaced with the real version number. diff --git a/scripts/conda/mindspore-ascend/1.3.0/build.sh b/scripts/conda/mindspore-ascend/1.3.0/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..f9b08d1a2ff8a8b0f2dc4eee9a92d2f24eff0c2f --- /dev/null +++ b/scripts/conda/mindspore-ascend/1.3.0/build.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# install MindSpore-Ascend using pip +if [ "$(uname)" == Linux ]; then + if [ "$(arch)" == aarch64 ]; then + echo "running on aarch64 linux system." + if [ "$PY_VER" == "3.7" ]; then + echo "building conda package for python3.7" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.3.0/MindSpore/ascend/aarch64/mindspore_ascend-1.3.0-cp37-cp37m-linux_aarch64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + elif [ "$PY_VER" == "3.9" ]; then + echo "building conda package for python3.9" + else + echo "ERROR: you are trying to build MindSpore conda package on a unsupported python environment, try python 3.7 or 3.9" + exit 1 + fi + elif [ "$(arch)" == x86_64 ]; then + echo "running on x86_64 linux system." + if [ "$PY_VER" == "3.7" ]; then + echo "building conda package for python3.7" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.3.0/MindSpore/ascend/x86_64/mindspore_ascend-1.3.0-cp37-cp37m-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + elif [ "$PY_VER" == "3.9" ]; then + echo "building conda package for python3.9" + else + echo "ERROR: you are trying to build MindSpore conda package on a unsupported python environment, try python 3.7 or 3.9" + exit 1 + fi + else + echo "ERROR: unknown linux architecture, try building MindSpore conda package on a supported architecture." + exit 1 + fi +fi \ No newline at end of file diff --git a/scripts/conda/mindspore-ascend/1.3.0/meta.yaml b/scripts/conda/mindspore-ascend/1.3.0/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d81e56a44bbf8934e2b69d799ad91bc13708c75f --- /dev/null +++ b/scripts/conda/mindspore-ascend/1.3.0/meta.yaml @@ -0,0 +1,30 @@ +package: + name: mindspore-ascend + version: "1.3.0" + +build: + number: 0 + +requirements: + build: + - python + - pip + run: + - python + - numpy >=1.17.0 + - protobuf >=3.13.0 + - asttokens >=1.1.13 + - pillow >=6.2.0 + - scipy >=1.5.2 + - cffi >=1.12.3 + - wheel >=0.32.0 + - decorator >=4.4.0 + - setuptools >=40.8.0 + - astunparse >=1.6.3 + - packaging >=20.0 + - psutil >=5.7.0 + +about: + home: https://www.mindspore.cn/ + license: Apache 2.0 + summary: MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios. diff --git a/scripts/conda/mindspore-ascend/1.5.0/build.sh b/scripts/conda/mindspore-ascend/1.5.0/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..b6fbb44c413be376222d69663f6a8b11a642b9dc --- /dev/null +++ b/scripts/conda/mindspore-ascend/1.5.0/build.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# install MindSpore-Ascend using pip +if [ "$(uname)" == Linux ]; then + if [ "$(arch)" == aarch64 ]; then + echo "running on aarch64 linux system." + if [ "$PY_VER" == "3.7" ]; then + echo "building conda package for python3.7" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/MindSpore/ascend/aarch64/mindspore_ascend-1.5.0-cp37-cp37m-linux_aarch64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + elif [ "$PY_VER" == "3.9" ]; then + echo "building conda package for python3.9" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/MindSpore/ascend/aarch64/mindspore_ascend-1.5.0-cp39-cp39-linux_aarch64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + else + echo "ERROR: you are trying to build MindSpore conda package on a unsupported python environment, try python 3.7 or 3.9" + exit 1 + fi + elif [ "$(arch)" == x86_64 ]; then + echo "running on x86_64 linux system." + if [ "$PY_VER" == "3.7" ]; then + echo "building conda package for python3.7" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/MindSpore/ascend/x86_64/mindspore_ascend-1.5.0-cp37-cp37m-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + elif [ "$PY_VER" == "3.9" ]; then + echo "building conda package for python3.9" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/MindSpore/ascend/x86_64/mindspore_ascend-1.5.0-cp39-cp39-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + else + echo "ERROR: you are trying to build MindSpore conda package on a unsupported python environment, try python 3.7 or 3.9" + exit 1 + fi + else + echo "ERROR: unknown linux architecture, try building MindSpore conda package on a supported architecture." + exit 1 + fi +fi diff --git a/scripts/conda/mindspore-ascend/1.5.0/meta.yaml b/scripts/conda/mindspore-ascend/1.5.0/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b521048e31d51fe3c70c037d8d9041da712eef4d --- /dev/null +++ b/scripts/conda/mindspore-ascend/1.5.0/meta.yaml @@ -0,0 +1,40 @@ +package: + name: mindspore-ascend + version: "1.5.0" + +build: + number: 0 + rpaths: + - /usr/local/Ascend/nnae/latest/fwkacllib/lib64 + - /usr/local/Ascend/ascend-toolkit/latest/fwkacllib/lib64 + - /usr/local/Ascend/fwkacllib/lib64 + - /usr/local/Ascend/nnae/latest/fwkacllib/lib64/plugin/opskernel + - /usr/local/Ascend/ascend-toolkit/latest/fwkacllib/lib64/plugin/opskernel + - /usr/local/Ascend/fwkacllib/lib64/plugin/opskernel + - /usr/local/Ascend/opp/op_impl/built-in/ai_core/tbe/op_tiling + - /usr/local/Ascend/nnae/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling + - /usr/local/Ascend/ascend-toolkit/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling + +requirements: + build: + - python + - pip + run: + - python + - numpy >=1.17.0 + - protobuf >=3.13.0 + - asttokens >=1.1.13 + - pillow >=6.2.0 + - scipy >=1.5.2 + - cffi >=1.12.3 + - wheel >=0.32.0 + - decorator >=4.4.0 + - setuptools >=40.8.0 + - astunparse >=1.6.3 + - packaging >=20.0 + - psutil >=5.7.0 + +about: + home: https://www.mindspore.cn/ + license: Apache 2.0 + summary: MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios. diff --git a/scripts/conda/mindspore-ascend/1.5.0rc1/build.sh b/scripts/conda/mindspore-ascend/1.5.0rc1/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..d91f7dd605fa57d403b123d9df4d97c7e06049cc --- /dev/null +++ b/scripts/conda/mindspore-ascend/1.5.0rc1/build.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# install MindSpore-Ascend using pip +if [ "$(uname)" == Linux ]; then + if [ "$(arch)" == aarch64 ]; then + echo "running on aarch64 linux system." + if [ "$PY_VER" == "3.7" ]; then + echo "building conda package for python3.7" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0-rc1/MindSpore/ascend/aarch64/mindspore_ascend-1.5.0rc1-cp37-cp37m-linux_aarch64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + elif [ "$PY_VER" == "3.9" ]; then + echo "building conda package for python3.9" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0-rc1/MindSpore/ascend/aarch64/mindspore_ascend-1.5.0rc1-cp39-cp39-linux_aarch64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + else + echo "ERROR: you are trying to build MindSpore conda package on a unsupported python environment, try python 3.7 or 3.9" + exit 1 + fi + elif [ "$(arch)" == x86_64 ]; then + echo "running on x86_64 linux system." + if [ "$PY_VER" == "3.7" ]; then + echo "building conda package for python3.7" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0-rc1/MindSpore/ascend/x86_64/mindspore_ascend-1.5.0rc1-cp37-cp37m-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + elif [ "$PY_VER" == "3.9" ]; then + echo "building conda package for python3.9" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0-rc1/MindSpore/ascend/x86_64/mindspore_ascend-1.5.0rc1-cp39-cp39-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + else + echo "ERROR: you are trying to build MindSpore conda package on a unsupported python environment, try python 3.7 or 3.9" + exit 1 + fi + else + echo "ERROR: unknown linux architecture, try building MindSpore conda package on a supported architecture." + exit 1 + fi +fi diff --git a/scripts/conda/mindspore-ascend/1.5.0rc1/meta.yaml b/scripts/conda/mindspore-ascend/1.5.0rc1/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e9a495eaa7b84d788059d6b8593c5555c68a16b4 --- /dev/null +++ b/scripts/conda/mindspore-ascend/1.5.0rc1/meta.yaml @@ -0,0 +1,40 @@ +package: + name: mindspore-ascend + version: "1.5.0rc1" + +build: + number: 0 + rpaths: + - /usr/local/Ascend/nnae/latest/fwkacllib/lib64 + - /usr/local/Ascend/ascend-toolkit/latest/fwkacllib/lib64 + - /usr/local/Ascend/fwkacllib/lib64 + - /usr/local/Ascend/nnae/latest/fwkacllib/lib64/plugin/opskernel + - /usr/local/Ascend/ascend-toolkit/latest/fwkacllib/lib64/plugin/opskernel + - /usr/local/Ascend/fwkacllib/lib64/plugin/opskernel + - /usr/local/Ascend/opp/op_impl/built-in/ai_core/tbe/op_tiling + - /usr/local/Ascend/nnae/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling + - /usr/local/Ascend/ascend-toolkit/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling + +requirements: + build: + - python + - pip + run: + - python + - numpy >=1.17.0 + - protobuf >=3.13.0 + - asttokens >=1.1.13 + - pillow >=6.2.0 + - scipy >=1.5.2 + - cffi >=1.12.3 + - wheel >=0.32.0 + - decorator >=4.4.0 + - setuptools >=40.8.0 + - astunparse >=1.6.3 + - packaging >=20.0 + - psutil >=5.7.0 + +about: + home: https://www.mindspore.cn/ + license: Apache 2.0 + summary: MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios. diff --git a/scripts/conda/mindspore-cpu/1.3.0/bld.bat b/scripts/conda/mindspore-cpu/1.3.0/bld.bat new file mode 100644 index 0000000000000000000000000000000000000000..0eebbd815d2fed45382450ff27399e80621557af --- /dev/null +++ b/scripts/conda/mindspore-cpu/1.3.0/bld.bat @@ -0,0 +1,13 @@ +@rem install MindSpore-CPU for windows using pip +@echo off + +IF "%PY_VER%" == "3.7" ( + echo "building conda package for python3.7" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.3.0/MindSpore/cpu/x86_64/mindspore-1.3.0-cp37-cp37m-win_amd64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple +) ELSE IF "%PY_VER%" == "3.9" ( + echo "building conda package for python3.9, which is not supported on MindSpore 1.3.0" + EXIT /b 1 +) ELSE ( + echo "ERROR: you are trying to build MindSpore conda package on a unsupported python environment, try python 3.7 or 3.9" + EXIT /b 1 +) diff --git a/scripts/conda/mindspore-cpu/1.3.0/build.sh b/scripts/conda/mindspore-cpu/1.3.0/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..3eee451fcdbcb75bd96db28c95c25588f3c2b6e3 --- /dev/null +++ b/scripts/conda/mindspore-cpu/1.3.0/build.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# install MindSpore-CPU using pip +if [ "$(uname)" == Linux ]; then + if [ "$(arch)" == aarch64 ]; then + echo "running on aarch64 linux system." + if [ "$PY_VER" == "3.7" ]; then + echo "building conda package for python3.7" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.3.0/MindSpore/cpu/aarch64/mindspore-1.3.0-cp37-cp37m-linux_aarch64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + elif [ "$PY_VER" == "3.9" ]; then + echo "building conda package for python3.9" + else + echo "ERROR: you are trying to build MindSpore conda package on a unsupported python environment, try python 3.7 or 3.9" + exit 1 + fi + elif [ "$(arch)" == x86_64 ]; then + echo "running on x86_64 linux system." + if [ "$PY_VER" == "3.7" ]; then + echo "building conda package for python3.7" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.3.0/MindSpore/cpu/x86_64/mindspore-1.3.0-cp37-cp37m-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + elif [ "$PY_VER" == "3.9" ]; then + echo "building conda package for python3.9" + else + echo "ERROR: you are trying to build MindSpore conda package on a unsupported python environment, try python 3.7 or 3.9" + exit 1 + fi + else + echo "ERROR: unknown linux architecture, try building MindSpore conda package on a supported architecture." + exit 1 + fi +fi \ No newline at end of file diff --git a/scripts/conda/mindspore-cpu/1.3.0/meta.yaml b/scripts/conda/mindspore-cpu/1.3.0/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..00138966ac018c035fb63ddab329dede64a60b49 --- /dev/null +++ b/scripts/conda/mindspore-cpu/1.3.0/meta.yaml @@ -0,0 +1,30 @@ +package: + name: mindspore-cpu + version: "1.3.0" + +build: + number: 0 + +requirements: + build: + - python + - pip + run: + - python + - numpy >=1.17.0 + - protobuf >=3.13.0 + - asttokens >=1.1.13 + - pillow >=6.2.0 + - scipy >=1.5.2 + - cffi >=1.12.3 + - wheel >=0.32.0 + - decorator >=4.4.0 + - setuptools >=40.8.0 + - astunparse >=1.6.3 + - packaging >=20.0 + - psutil >=5.7.0 + +about: + home: https://www.mindspore.cn/ + license: Apache 2.0 + summary: MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios. diff --git a/scripts/conda/mindspore-cpu/1.5.0/bld.bat b/scripts/conda/mindspore-cpu/1.5.0/bld.bat new file mode 100644 index 0000000000000000000000000000000000000000..3b1cd3ba29d2ca4f3137426a7becb93c8d0426ec --- /dev/null +++ b/scripts/conda/mindspore-cpu/1.5.0/bld.bat @@ -0,0 +1,13 @@ +@rem install MindSpore-CPU for windows using pip +@echo off + +IF "%PY_VER%" == "3.7" ( + echo "building conda package for python3.7" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/MindSpore/cpu/x86_64/mindspore-1.5.0-cp37-cp37m-win_amd64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple +) ELSE IF "%PY_VER%" == "3.9" ( + echo "building conda package for python3.9" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/MindSpore/cpu/x86_64/mindspore-1.5.0-cp39-cp39-win_amd64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple +) ELSE ( + echo "ERROR: you are trying to build MindSpore conda package on a unsupported python environment, try python 3.7 or 3.9" + EXIT /b 1 +) diff --git a/scripts/conda/mindspore-cpu/1.5.0/build.sh b/scripts/conda/mindspore-cpu/1.5.0/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..fc075a4d1984029fc54e2cf77b8a70726e0ca9c8 --- /dev/null +++ b/scripts/conda/mindspore-cpu/1.5.0/build.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +# install MindSpore-CPU using pip +if [ "$(uname)" == Darwin ]; then + if [ "$PY_VER" == "3.7" ]; then + echo "nothing happens yet" + else + echo "nothing happens yet" + fi +fi + + +if [ "$(uname)" == Linux ]; then + if [ "$(arch)" == aarch64 ]; then + echo "running on aarch64 linux system." + if [ "$PY_VER" == "3.7" ]; then + echo "building conda package for python3.7" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/MindSpore/cpu/aarch64/mindspore-1.5.0-cp37-cp37m-linux_aarch64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + elif [ "$PY_VER" == "3.9" ]; then + echo "building conda package for python3.9" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/MindSpore/cpu/aarch64/mindspore-1.5.0-cp39-cp39-linux_aarch64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + else + echo "ERROR: you are trying to build MindSpore conda package on a unsupported python environment, try python 3.7 or 3.9" + exit 1 + fi + elif [ "$(arch)" == x86_64 ]; then + echo "running on x86_64 linux system." + if [ "$PY_VER" == "3.7" ]; then + echo "building conda package for python3.7" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/MindSpore/cpu/x86_64/mindspore-1.5.0-cp37-cp37m-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + elif [ "$PY_VER" == "3.9" ]; then + echo "building conda package for python3.9" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/MindSpore/cpu/x86_64/mindspore-1.5.0-cp39-cp39-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + else + echo "ERROR: you are trying to build MindSpore conda package on a unsupported python environment, try python 3.7 or 3.9" + exit 1 + fi + else + echo "ERROR: unknown linux architecture, try building MindSpore conda package on a supported architecture." + exit 1 + fi +fi diff --git a/scripts/conda/mindspore-cpu/1.5.0/meta.yaml b/scripts/conda/mindspore-cpu/1.5.0/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..47aadd49ee9f20947757d13cb4707eddd0fd0388 --- /dev/null +++ b/scripts/conda/mindspore-cpu/1.5.0/meta.yaml @@ -0,0 +1,30 @@ +package: + name: mindspore-cpu + version: "1.5.0" + +build: + number: 0 + +requirements: + build: + - python + - pip + run: + - python + - numpy >=1.17.0 + - protobuf >=3.13.0 + - asttokens >=1.1.13 + - pillow >=6.2.0 + - scipy >=1.5.2 + - cffi >=1.12.3 + - wheel >=0.32.0 + - decorator >=4.4.0 + - setuptools >=40.8.0 + - astunparse >=1.6.3 + - packaging >=20.0 + - psutil >=5.7.0 + +about: + home: https://www.mindspore.cn/ + license: Apache 2.0 + summary: MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios. diff --git a/scripts/conda/mindspore-cpu/1.5.0rc1/bld.bat b/scripts/conda/mindspore-cpu/1.5.0rc1/bld.bat new file mode 100644 index 0000000000000000000000000000000000000000..80866b335dbf42fd91f694bbb27c82592a9dcc75 --- /dev/null +++ b/scripts/conda/mindspore-cpu/1.5.0rc1/bld.bat @@ -0,0 +1,13 @@ +@rem install MindSpore-CPU for windows using pip +@echo off + +IF "%PY_VER%" == "3.7" ( + echo "building conda package for python3.7" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0-rc1/MindSpore/cpu/x86_64/mindspore-1.5.0rc1-cp37-cp37m-win_amd64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple +) ELSE IF "%PY_VER%" == "3.9" ( + echo "building conda package for python3.9" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0-rc1/MindSpore/cpu/x86_64/mindspore-1.5.0rc1-cp39-cp39-win_amd64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple +) ELSE ( + echo "ERROR: you are trying to build MindSpore conda package on a unsupported python environment, try python 3.7 or 3.9" + EXIT /b 1 +) diff --git a/scripts/conda/mindspore-cpu/1.5.0rc1/build.sh b/scripts/conda/mindspore-cpu/1.5.0rc1/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..4f87d580deda1e7fe7b6e2eea0a1088e0677ad1b --- /dev/null +++ b/scripts/conda/mindspore-cpu/1.5.0rc1/build.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +# install MindSpore-CPU using pip +if [ "$(uname)" == Darwin ]; then + if [ "$PY_VER" == "3.7" ]; then + echo "nothing happens yet" + else + echo "nothing happens yet" + fi +fi + + +if [ "$(uname)" == Linux ]; then + if [ "$(arch)" == aarch64 ]; then + echo "running on aarch64 linux system." + if [ "$PY_VER" == "3.7" ]; then + echo "building conda package for python3.7" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0-rc1/MindSpore/cpu/aarch64/mindspore-1.5.0rc1-cp37-cp37m-linux_aarch64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + elif [ "$PY_VER" == "3.9" ]; then + echo "building conda package for python3.9" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0-rc1/MindSpore/cpu/aarch64/mindspore-1.5.0rc1-cp39-cp39-linux_aarch64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + else + echo "ERROR: you are trying to build MindSpore conda package on a unsupported python environment, try python 3.7 or 3.9" + exit 1 + fi + elif [ "$(arch)" == x86_64 ]; then + echo "running on x86_64 linux system." + if [ "$PY_VER" == "3.7" ]; then + echo "building conda package for python3.7" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0-rc1/MindSpore/cpu/x86_64/mindspore-1.5.0rc1-cp37-cp37m-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + elif [ "$PY_VER" == "3.9" ]; then + echo "building conda package for python3.9" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0-rc1/MindSpore/cpu/x86_64/mindspore-1.5.0rc1-cp39-cp39-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + else + echo "ERROR: you are trying to build MindSpore conda package on a unsupported python environment, try python 3.7 or 3.9" + exit 1 + fi + else + echo "ERROR: unknown linux architecture, try building MindSpore conda package on a supported architecture." + exit 1 + fi +fi diff --git a/scripts/conda/mindspore-cpu/1.5.0rc1/meta.yaml b/scripts/conda/mindspore-cpu/1.5.0rc1/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ef8270105d6274bfc708ed5427da7952d03dfc18 --- /dev/null +++ b/scripts/conda/mindspore-cpu/1.5.0rc1/meta.yaml @@ -0,0 +1,30 @@ +package: + name: mindspore-cpu + version: "1.5.0rc1" + +build: + number: 0 + +requirements: + build: + - python + - pip + run: + - python + - numpy >=1.17.0 + - protobuf >=3.13.0 + - asttokens >=1.1.13 + - pillow >=6.2.0 + - scipy >=1.5.2 + - cffi >=1.12.3 + - wheel >=0.32.0 + - decorator >=4.4.0 + - setuptools >=40.8.0 + - astunparse >=1.6.3 + - packaging >=20.0 + - psutil >=5.7.0 + +about: + home: https://www.mindspore.cn/ + license: Apache 2.0 + summary: MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios. diff --git a/scripts/conda/mindspore-gpu/1.3.0/build.sh b/scripts/conda/mindspore-gpu/1.3.0/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..f7731677065d10ae6b61fd6cc04093eb58a7eea3 --- /dev/null +++ b/scripts/conda/mindspore-gpu/1.3.0/build.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# install MindSpore-GPU using pip +if [ "$(uname)" == Linux ]; then + if [ "$PY_VER" == "3.7" ]; then + echo "building conda package for python3.7" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.3.0/MindSpore/gpu/x86_64/cuda-11.1/mindspore_gpu-1.3.0-cp37-cp37m-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + elif [ "$PY_VER" == "3.9" ]; then + echo "building conda package for python3.9" + else + echo "ERROR: you are trying to build MindSpore conda package on a unsupported python environment, try python 3.7 or 3.9" + exit 1 + fi +fi \ No newline at end of file diff --git a/scripts/conda/mindspore-gpu/1.3.0/meta.yaml b/scripts/conda/mindspore-gpu/1.3.0/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..88bcad6a4578db7963f901320bdaecd9259a9f0c --- /dev/null +++ b/scripts/conda/mindspore-gpu/1.3.0/meta.yaml @@ -0,0 +1,30 @@ +package: + name: mindspore-gpu + version: "1.3.0" + +build: + number: 0 + +requirements: + build: + - python + - pip + run: + - python + - numpy >=1.17.0 + - protobuf >=3.13.0 + - asttokens >=1.1.13 + - pillow >=6.2.0 + - scipy >=1.5.2 + - cffi >=1.12.3 + - wheel >=0.32.0 + - decorator >=4.4.0 + - setuptools >=40.8.0 + - astunparse >=1.6.3 + - packaging >=20.0 + - psutil >=5.7.0 + +about: + home: https://www.mindspore.cn/ + license: Apache 2.0 + summary: MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios. diff --git a/scripts/conda/mindspore-gpu/1.5.0/py37/cuda10.1/build.sh b/scripts/conda/mindspore-gpu/1.5.0/py37/cuda10.1/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..18002e7a03e62b811d4ffda3681afc430f273943 --- /dev/null +++ b/scripts/conda/mindspore-gpu/1.5.0/py37/cuda10.1/build.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# install MindSpore-GPU using pip +if [ "$(uname)" == Linux ]; then + if [ "$PY_VER" == "3.7" ]; then + echo "building conda package for python3.7" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/MindSpore/gpu/x86_64/cuda-10.1/mindspore_gpu-1.5.0-cp37-cp37m-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + elif [ "$PY_VER" == "3.9" ]; then + echo "building conda package for python3.9" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/MindSpore/gpu/x86_64/cuda-10.1/mindspore_gpu-1.5.0-cp39-cp39-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + else + echo "ERROR: you are trying to build MindSpore conda package on a unsupported python environment, try python 3.7 or 3.9" + exit 1 + fi +fi diff --git a/scripts/conda/mindspore-gpu/1.5.0/py37/cuda10.1/meta.yaml b/scripts/conda/mindspore-gpu/1.5.0/py37/cuda10.1/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..da7dab16e98913e74ac6b46affbe73c09f53f079 --- /dev/null +++ b/scripts/conda/mindspore-gpu/1.5.0/py37/cuda10.1/meta.yaml @@ -0,0 +1,32 @@ +package: + name: mindspore-gpu + version: "1.5.0" + +build: + number: 0 + string: py37_cuda10.1 + +requirements: + build: + - python>=3.7, <3.8 + - pip + run: + - python>=3.7, <3.8 + - numpy >=1.17.0 + - protobuf >=3.13.0 + - asttokens >=1.1.13 + - pillow >=6.2.0 + - scipy >=1.5.2 + - cffi >=1.12.3 + - wheel >=0.32.0 + - decorator >=4.4.0 + - setuptools >=40.8.0 + - astunparse >=1.6.3 + - packaging >=20.0 + - psutil >=5.7.0 + - cudatoolkit >=10.1, <10.2 + +about: + home: https://www.mindspore.cn/ + license: Apache 2.0 + summary: MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios. diff --git a/scripts/conda/mindspore-gpu/1.5.0/py37/cuda11.1/build.sh b/scripts/conda/mindspore-gpu/1.5.0/py37/cuda11.1/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..ac0e3c2dac492ba84e16752b8f0b4e3c2c37aa0d --- /dev/null +++ b/scripts/conda/mindspore-gpu/1.5.0/py37/cuda11.1/build.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# install MindSpore-GPU using pip +if [ "$(uname)" == Linux ]; then + if [ "$PY_VER" == "3.7" ]; then + echo "building conda package for python3.7" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/MindSpore/gpu/x86_64/cuda-11.1/mindspore_gpu-1.5.0-cp37-cp37m-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + elif [ "$PY_VER" == "3.9" ]; then + echo "building conda package for python3.9" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/MindSpore/gpu/x86_64/cuda-11.1/mindspore_gpu-1.5.0-cp39-cp39-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + else + echo "ERROR: you are trying to build MindSpore conda package on a unsupported python environment, try python 3.7 or 3.9" + exit 1 + fi +fi diff --git a/scripts/conda/mindspore-gpu/1.5.0/py37/cuda11.1/meta.yaml b/scripts/conda/mindspore-gpu/1.5.0/py37/cuda11.1/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0f5d7a830786c1feace24c832a3c4e3cbe065a19 --- /dev/null +++ b/scripts/conda/mindspore-gpu/1.5.0/py37/cuda11.1/meta.yaml @@ -0,0 +1,32 @@ +package: + name: mindspore-gpu + version: "1.5.0" + +build: + number: 0 + string: py37_cuda11.1 + +requirements: + build: + - python>=3.7, <3.8 + - pip + run: + - python>=3.7, <3.8 + - numpy >=1.17.0 + - protobuf >=3.13.0 + - asttokens >=1.1.13 + - pillow >=6.2.0 + - scipy >=1.5.2 + - cffi >=1.12.3 + - wheel >=0.32.0 + - decorator >=4.4.0 + - setuptools >=40.8.0 + - astunparse >=1.6.3 + - packaging >=20.0 + - psutil >=5.7.0 + - cudatoolkit >=11.1, <11.2 + +about: + home: https://www.mindspore.cn/ + license: Apache 2.0 + summary: MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios. diff --git a/scripts/conda/mindspore-gpu/1.5.0/py39/cuda10.1/build.sh b/scripts/conda/mindspore-gpu/1.5.0/py39/cuda10.1/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..18002e7a03e62b811d4ffda3681afc430f273943 --- /dev/null +++ b/scripts/conda/mindspore-gpu/1.5.0/py39/cuda10.1/build.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# install MindSpore-GPU using pip +if [ "$(uname)" == Linux ]; then + if [ "$PY_VER" == "3.7" ]; then + echo "building conda package for python3.7" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/MindSpore/gpu/x86_64/cuda-10.1/mindspore_gpu-1.5.0-cp37-cp37m-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + elif [ "$PY_VER" == "3.9" ]; then + echo "building conda package for python3.9" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/MindSpore/gpu/x86_64/cuda-10.1/mindspore_gpu-1.5.0-cp39-cp39-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + else + echo "ERROR: you are trying to build MindSpore conda package on a unsupported python environment, try python 3.7 or 3.9" + exit 1 + fi +fi diff --git a/scripts/conda/mindspore-gpu/1.5.0/py39/cuda10.1/meta.yaml b/scripts/conda/mindspore-gpu/1.5.0/py39/cuda10.1/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7664b34aabf00fd9c62e8fbfba6a5c7dd0d6c622 --- /dev/null +++ b/scripts/conda/mindspore-gpu/1.5.0/py39/cuda10.1/meta.yaml @@ -0,0 +1,32 @@ +package: + name: mindspore-gpu + version: "1.5.0" + +build: + number: 0 + string: py39_cuda10.1 + +requirements: + build: + - python>=3.9, <3.10 + - pip + run: + - python>=3.9, <3.10 + - numpy >=1.17.0 + - protobuf >=3.13.0 + - asttokens >=1.1.13 + - pillow >=6.2.0 + - scipy >=1.5.2 + - cffi >=1.12.3 + - wheel >=0.32.0 + - decorator >=4.4.0 + - setuptools >=40.8.0 + - astunparse >=1.6.3 + - packaging >=20.0 + - psutil >=5.7.0 + - cudatoolkit >=10.1, <10.2 + +about: + home: https://www.mindspore.cn/ + license: Apache 2.0 + summary: MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios. diff --git a/scripts/conda/mindspore-gpu/1.5.0/py39/cuda11.1/build.sh b/scripts/conda/mindspore-gpu/1.5.0/py39/cuda11.1/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..ac0e3c2dac492ba84e16752b8f0b4e3c2c37aa0d --- /dev/null +++ b/scripts/conda/mindspore-gpu/1.5.0/py39/cuda11.1/build.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# install MindSpore-GPU using pip +if [ "$(uname)" == Linux ]; then + if [ "$PY_VER" == "3.7" ]; then + echo "building conda package for python3.7" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/MindSpore/gpu/x86_64/cuda-11.1/mindspore_gpu-1.5.0-cp37-cp37m-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + elif [ "$PY_VER" == "3.9" ]; then + echo "building conda package for python3.9" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/MindSpore/gpu/x86_64/cuda-11.1/mindspore_gpu-1.5.0-cp39-cp39-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + else + echo "ERROR: you are trying to build MindSpore conda package on a unsupported python environment, try python 3.7 or 3.9" + exit 1 + fi +fi diff --git a/scripts/conda/mindspore-gpu/1.5.0/py39/cuda11.1/meta.yaml b/scripts/conda/mindspore-gpu/1.5.0/py39/cuda11.1/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4544a4d5994e3d44c6a3c86b4076cae6e6cb55db --- /dev/null +++ b/scripts/conda/mindspore-gpu/1.5.0/py39/cuda11.1/meta.yaml @@ -0,0 +1,32 @@ +package: + name: mindspore-gpu + version: "1.5.0" + +build: + number: 0 + string: py39_cuda11.1 + +requirements: + build: + - python>=3.9, <3.10 + - pip + run: + - python>=3.9, <3.10 + - numpy >=1.17.0 + - protobuf >=3.13.0 + - asttokens >=1.1.13 + - pillow >=6.2.0 + - scipy >=1.5.2 + - cffi >=1.12.3 + - wheel >=0.32.0 + - decorator >=4.4.0 + - setuptools >=40.8.0 + - astunparse >=1.6.3 + - packaging >=20.0 + - psutil >=5.7.0 + - cudatoolkit >=11.1, <11.2 + +about: + home: https://www.mindspore.cn/ + license: Apache 2.0 + summary: MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios. diff --git a/scripts/conda/mindspore-gpu/1.5.0rc1/py37/cuda10.1/build.sh b/scripts/conda/mindspore-gpu/1.5.0rc1/py37/cuda10.1/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..d61385c281014749f575d018db483d3119435d64 --- /dev/null +++ b/scripts/conda/mindspore-gpu/1.5.0rc1/py37/cuda10.1/build.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# install MindSpore-GPU using pip +if [ "$(uname)" == Linux ]; then + if [ "$PY_VER" == "3.7" ]; then + echo "building conda package for python3.7" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0-rc1/MindSpore/gpu/x86_64/cuda-10.1/mindspore_gpu-1.5.0rc1-cp37-cp37m-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + elif [ "$PY_VER" == "3.9" ]; then + echo "building conda package for python3.9" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0-rc1/MindSpore/gpu/x86_64/cuda-10.1/mindspore_gpu-1.5.0rc1-cp39-cp39-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + else + echo "ERROR: you are trying to build MindSpore conda package on a unsupported python environment, try python 3.7 or 3.9" + exit 1 + fi +fi diff --git a/scripts/conda/mindspore-gpu/1.5.0rc1/py37/cuda10.1/meta.yaml b/scripts/conda/mindspore-gpu/1.5.0rc1/py37/cuda10.1/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0800382f14eedcd629e1123655f9515278b2d7dc --- /dev/null +++ b/scripts/conda/mindspore-gpu/1.5.0rc1/py37/cuda10.1/meta.yaml @@ -0,0 +1,32 @@ +package: + name: mindspore-gpu + version: "1.5.0rc1" + +build: + number: 0 + string: py37_cuda10.1 + +requirements: + build: + - python>=3.7, <3.8 + - pip + run: + - python>=3.7, <3.8 + - numpy >=1.17.0 + - protobuf >=3.13.0 + - asttokens >=1.1.13 + - pillow >=6.2.0 + - scipy >=1.5.2 + - cffi >=1.12.3 + - wheel >=0.32.0 + - decorator >=4.4.0 + - setuptools >=40.8.0 + - astunparse >=1.6.3 + - packaging >=20.0 + - psutil >=5.7.0 + - cudatoolkit >=10.1, <10.2 + +about: + home: https://www.mindspore.cn/ + license: Apache 2.0 + summary: MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios. diff --git a/scripts/conda/mindspore-gpu/1.5.0rc1/py37/cuda11.1/build.sh b/scripts/conda/mindspore-gpu/1.5.0rc1/py37/cuda11.1/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..d4aa7db18d4954262c66eb39a9cc7ac69b228b7d --- /dev/null +++ b/scripts/conda/mindspore-gpu/1.5.0rc1/py37/cuda11.1/build.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# install MindSpore-GPU using pip +if [ "$(uname)" == Linux ]; then + if [ "$PY_VER" == "3.7" ]; then + echo "building conda package for python3.7" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0-rc1/MindSpore/gpu/x86_64/cuda-11.1/mindspore_gpu-1.5.0rc1-cp37-cp37m-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + elif [ "$PY_VER" == "3.9" ]; then + echo "building conda package for python3.9" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0-rc1/MindSpore/gpu/x86_64/cuda-11.1/mindspore_gpu-1.5.0rc1-cp39-cp39-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + else + echo "ERROR: you are trying to build MindSpore conda package on a unsupported python environment, try python 3.7 or 3.9" + exit 1 + fi +fi diff --git a/scripts/conda/mindspore-gpu/1.5.0rc1/py37/cuda11.1/meta.yaml b/scripts/conda/mindspore-gpu/1.5.0rc1/py37/cuda11.1/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..19403ce148618662b005b9c9ea371526ef7293dd --- /dev/null +++ b/scripts/conda/mindspore-gpu/1.5.0rc1/py37/cuda11.1/meta.yaml @@ -0,0 +1,32 @@ +package: + name: mindspore-gpu + version: "1.5.0rc1" + +build: + number: 0 + string: py37_cuda11.1 + +requirements: + build: + - python>=3.7, <3.8 + - pip + run: + - python>=3.7, <3.8 + - numpy >=1.17.0 + - protobuf >=3.13.0 + - asttokens >=1.1.13 + - pillow >=6.2.0 + - scipy >=1.5.2 + - cffi >=1.12.3 + - wheel >=0.32.0 + - decorator >=4.4.0 + - setuptools >=40.8.0 + - astunparse >=1.6.3 + - packaging >=20.0 + - psutil >=5.7.0 + - cudatoolkit >=11.1, <11.2 + +about: + home: https://www.mindspore.cn/ + license: Apache 2.0 + summary: MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios. diff --git a/scripts/conda/mindspore-gpu/1.5.0rc1/py39/cuda10.1/build.sh b/scripts/conda/mindspore-gpu/1.5.0rc1/py39/cuda10.1/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..d61385c281014749f575d018db483d3119435d64 --- /dev/null +++ b/scripts/conda/mindspore-gpu/1.5.0rc1/py39/cuda10.1/build.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# install MindSpore-GPU using pip +if [ "$(uname)" == Linux ]; then + if [ "$PY_VER" == "3.7" ]; then + echo "building conda package for python3.7" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0-rc1/MindSpore/gpu/x86_64/cuda-10.1/mindspore_gpu-1.5.0rc1-cp37-cp37m-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + elif [ "$PY_VER" == "3.9" ]; then + echo "building conda package for python3.9" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0-rc1/MindSpore/gpu/x86_64/cuda-10.1/mindspore_gpu-1.5.0rc1-cp39-cp39-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + else + echo "ERROR: you are trying to build MindSpore conda package on a unsupported python environment, try python 3.7 or 3.9" + exit 1 + fi +fi diff --git a/scripts/conda/mindspore-gpu/1.5.0rc1/py39/cuda10.1/meta.yaml b/scripts/conda/mindspore-gpu/1.5.0rc1/py39/cuda10.1/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a35e047fe2226a85eb9e339b35d4bf65b712be03 --- /dev/null +++ b/scripts/conda/mindspore-gpu/1.5.0rc1/py39/cuda10.1/meta.yaml @@ -0,0 +1,32 @@ +package: + name: mindspore-gpu + version: "1.5.0rc1" + +build: + number: 0 + string: py39_cuda10.1 + +requirements: + build: + - python>=3.9, <3.10 + - pip + run: + - python>=3.9, <3.10 + - numpy >=1.17.0 + - protobuf >=3.13.0 + - asttokens >=1.1.13 + - pillow >=6.2.0 + - scipy >=1.5.2 + - cffi >=1.12.3 + - wheel >=0.32.0 + - decorator >=4.4.0 + - setuptools >=40.8.0 + - astunparse >=1.6.3 + - packaging >=20.0 + - psutil >=5.7.0 + - cudatoolkit >=10.1, <10.2 + +about: + home: https://www.mindspore.cn/ + license: Apache 2.0 + summary: MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios. diff --git a/scripts/conda/mindspore-gpu/1.5.0rc1/py39/cuda11.1/build.sh b/scripts/conda/mindspore-gpu/1.5.0rc1/py39/cuda11.1/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..d4aa7db18d4954262c66eb39a9cc7ac69b228b7d --- /dev/null +++ b/scripts/conda/mindspore-gpu/1.5.0rc1/py39/cuda11.1/build.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# install MindSpore-GPU using pip +if [ "$(uname)" == Linux ]; then + if [ "$PY_VER" == "3.7" ]; then + echo "building conda package for python3.7" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0-rc1/MindSpore/gpu/x86_64/cuda-11.1/mindspore_gpu-1.5.0rc1-cp37-cp37m-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + elif [ "$PY_VER" == "3.9" ]; then + echo "building conda package for python3.9" + pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0-rc1/MindSpore/gpu/x86_64/cuda-11.1/mindspore_gpu-1.5.0rc1-cp39-cp39-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + else + echo "ERROR: you are trying to build MindSpore conda package on a unsupported python environment, try python 3.7 or 3.9" + exit 1 + fi +fi diff --git a/scripts/conda/mindspore-gpu/1.5.0rc1/py39/cuda11.1/meta.yaml b/scripts/conda/mindspore-gpu/1.5.0rc1/py39/cuda11.1/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f0095aab3c56dcaa8f8ff0ee3ca5ed8d23c5e7da --- /dev/null +++ b/scripts/conda/mindspore-gpu/1.5.0rc1/py39/cuda11.1/meta.yaml @@ -0,0 +1,32 @@ +package: + name: mindspore-gpu + version: "1.5.0rc1" + +build: + number: 0 + string: py39_cuda11.1 + +requirements: + build: + - python>=3.9, <3.10 + - pip + run: + - python>=3.9, <3.10 + - numpy >=1.17.0 + - protobuf >=3.13.0 + - asttokens >=1.1.13 + - pillow >=6.2.0 + - scipy >=1.5.2 + - cffi >=1.12.3 + - wheel >=0.32.0 + - decorator >=4.4.0 + - setuptools >=40.8.0 + - astunparse >=1.6.3 + - packaging >=20.0 + - psutil >=5.7.0 + - cudatoolkit >=11.1, <11.2 + +about: + home: https://www.mindspore.cn/ + license: Apache 2.0 + summary: MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios. diff --git a/scripts/docker/OWNERS b/scripts/docker/OWNERS new file mode 100644 index 0000000000000000000000000000000000000000..bbace273463eb159a304547ed50fd20ad17e5271 --- /dev/null +++ b/scripts/docker/OWNERS @@ -0,0 +1,6 @@ +approvers: +- zhoufeng54 +- jjfeing +- kisnwang +reviewers: +- HW_KK \ No newline at end of file diff --git a/scripts/docker/README.md b/scripts/docker/README.md new file mode 100644 index 0000000000000000000000000000000000000000..bceeef0cae4020baf37f218bce4bdc15c5af6114 --- /dev/null +++ b/scripts/docker/README.md @@ -0,0 +1,16 @@ +## MindSpore Dockerfile Repository + +This folder hosts all the `Dockerfile` to build MindSpore container images with various hardware platforms. + +### MindSpore docker build command + +| Hardware Platform | Version | Build Command | +| :---------------- | :------ | :------------ | +| CPU | `x.y.z` | cd mindspore-cpu/x.y.z && docker build . -t mindspore/mindspore-cpu:x.y.z | +| | `devel` | cd mindspore-cpu/devel && docker build . -t mindspore/mindspore-cpu:devel | +| | `runtime` | cd mindspore-cpu/runtime && docker build . -t mindspore/mindspore-cpu:runtime | +| GPU | `x.y.z` | cd mindspore-gpu/x.y.z && docker build . -t mindspore/mindspore-gpu:x.y.z | +| | `devel` | cd mindspore-gpu/devel && docker build . -t mindspore/mindspore-gpu:devel | +| | `runtime` | cd mindspore-gpu/runtime && docker build . -t mindspore/mindspore-gpu:runtime | + +> **NOTICE:** The `x.y.z` version shown above should be replaced with the real version number. diff --git a/scripts/docker/mindspore-cpu/0.1.0-alpha/Dockerfile b/scripts/docker/mindspore-cpu/0.1.0-alpha/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..c9fb7c2b882ec5ffb75335b9e17136961577574c --- /dev/null +++ b/scripts/docker/mindspore-cpu/0.1.0-alpha/Dockerfile @@ -0,0 +1,67 @@ +FROM ubuntu:18.04 + +MAINTAINER leonwanghui + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV PATH /usr/local/bin:$PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install MindSpore cpu whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/0.1.0-alpha/MindSpore/cpu/ubuntu-x86/mindspore-0.1.0-cp37-cp37m-linux_x86_64.whl diff --git a/scripts/docker/mindspore-cpu/0.2.0-alpha/Dockerfile b/scripts/docker/mindspore-cpu/0.2.0-alpha/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..dc69d21326006e22e8e7e26c0eed88476c4b6f2e --- /dev/null +++ b/scripts/docker/mindspore-cpu/0.2.0-alpha/Dockerfile @@ -0,0 +1,67 @@ +FROM ubuntu:18.04 + +MAINTAINER leonwanghui + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV PATH /usr/local/bin:$PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install MindSpore cpu whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/0.2.0-alpha/MindSpore/cpu/x86_ubuntu/mindspore-0.2.0-cp37-cp37m-linux_x86_64.whl diff --git a/scripts/docker/mindspore-cpu/0.3.0-alpha/Dockerfile b/scripts/docker/mindspore-cpu/0.3.0-alpha/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..12ae433ffc407f4a06b1507b07342d79320714f3 --- /dev/null +++ b/scripts/docker/mindspore-cpu/0.3.0-alpha/Dockerfile @@ -0,0 +1,67 @@ +FROM ubuntu:18.04 + +MAINTAINER leonwanghui + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV PATH /usr/local/bin:$PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install MindSpore cpu whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/0.3.0-alpha/MindSpore/cpu/ubuntu_x86/mindspore-0.3.0-cp37-cp37m-linux_x86_64.whl diff --git a/scripts/docker/mindspore-cpu/0.5.0-beta/Dockerfile b/scripts/docker/mindspore-cpu/0.5.0-beta/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..4da6294296380e04493d8d0058b52ac781f7491a --- /dev/null +++ b/scripts/docker/mindspore-cpu/0.5.0-beta/Dockerfile @@ -0,0 +1,67 @@ +FROM ubuntu:18.04 + +MAINTAINER leonwanghui + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV PATH /usr/local/bin:$PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install MindSpore cpu whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/0.5.0-beta/MindSpore/cpu/ubuntu_x86/mindspore-0.5.0-cp37-cp37m-linux_x86_64.whl diff --git a/scripts/docker/mindspore-cpu/0.6.0-beta/Dockerfile b/scripts/docker/mindspore-cpu/0.6.0-beta/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..c203cf1721746a5259f960d2e02082808aa23b99 --- /dev/null +++ b/scripts/docker/mindspore-cpu/0.6.0-beta/Dockerfile @@ -0,0 +1,67 @@ +FROM ubuntu:18.04 + +MAINTAINER leonwanghui + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV PATH /usr/local/bin:$PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install MindSpore cpu whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/0.6.0-beta/MindSpore/cpu/ubuntu_x86/mindspore-0.6.0-cp37-cp37m-linux_x86_64.whl diff --git a/scripts/docker/mindspore-cpu/0.7.0-beta/Dockerfile b/scripts/docker/mindspore-cpu/0.7.0-beta/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..7b9d3e1778109f0ca8f84f0ad357ad6057f40b18 --- /dev/null +++ b/scripts/docker/mindspore-cpu/0.7.0-beta/Dockerfile @@ -0,0 +1,67 @@ +FROM ubuntu:18.04 + +MAINTAINER leonwanghui + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV PATH /usr/local/bin:$PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install MindSpore cpu whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/0.7.0-beta/MindSpore/cpu/ubuntu_x86/mindspore-0.7.0-cp37-cp37m-linux_x86_64.whl diff --git a/scripts/docker/mindspore-cpu/1.0.0/Dockerfile b/scripts/docker/mindspore-cpu/1.0.0/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..c210a4c881230b8ba73ab97d4f26e96e11dbb924 --- /dev/null +++ b/scripts/docker/mindspore-cpu/1.0.0/Dockerfile @@ -0,0 +1,67 @@ +FROM ubuntu:18.04 + +MAINTAINER leonwanghui + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV PATH /usr/local/bin:/root/.local/bin:$PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install MindSpore cpu whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.0.0/MindSpore/cpu/ubuntu_x86/mindspore-1.0.0-cp37-cp37m-linux_x86_64.whl diff --git a/scripts/docker/mindspore-cpu/1.1.0/Dockerfile b/scripts/docker/mindspore-cpu/1.1.0/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..f412c89996dad350dc194d747c89168177d23bbc --- /dev/null +++ b/scripts/docker/mindspore-cpu/1.1.0/Dockerfile @@ -0,0 +1,71 @@ +FROM ubuntu:18.04 + +MAINTAINER leonwanghui + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV PATH /usr/local/bin:/root/.local/bin:$PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex + +# Install the rest dependent tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + libnuma-dev + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install MindSpore cpu whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.1.0/MindSpore/cpu/ubuntu_x86/mindspore-1.1.0-cp37-cp37m-linux_x86_64.whl diff --git a/scripts/docker/mindspore-cpu/1.2.0/Dockerfile b/scripts/docker/mindspore-cpu/1.2.0/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..e9aceab48e07a28bf1a06a49190017d9a8821dd3 --- /dev/null +++ b/scripts/docker/mindspore-cpu/1.2.0/Dockerfile @@ -0,0 +1,71 @@ +FROM ubuntu:18.04 + +MAINTAINER leonwanghui + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV PATH /usr/local/bin:/root/.local/bin:$PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex + +# Install the rest dependent tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + libnuma-dev + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install MindSpore cpu whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.2.0/MindSpore/cpu/ubuntu_x86/mindspore-1.2.0-cp37-cp37m-linux_x86_64.whl diff --git a/scripts/docker/mindspore-cpu/1.2.1/Dockerfile b/scripts/docker/mindspore-cpu/1.2.1/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a1d59ca91d8de451218bf9f7881535794f9159a7 --- /dev/null +++ b/scripts/docker/mindspore-cpu/1.2.1/Dockerfile @@ -0,0 +1,71 @@ +FROM ubuntu:18.04 + +MAINTAINER leonwanghui + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV PATH /usr/local/bin:/root/.local/bin:$PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex + +# Install the rest dependent tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + libnuma-dev + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install MindSpore cpu whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.2.1/MindSpore/cpu/ubuntu_x86/mindspore-1.2.1-cp37-cp37m-linux_x86_64.whl diff --git a/scripts/docker/mindspore-cpu/1.3.0/Dockerfile b/scripts/docker/mindspore-cpu/1.3.0/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..25aeb966618c2a59f6798053d23c109d6b8a9d3c --- /dev/null +++ b/scripts/docker/mindspore-cpu/1.3.0/Dockerfile @@ -0,0 +1,74 @@ +FROM ubuntu:18.04 + +MAINTAINER leonwanghui + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV PATH /usr/local/bin:/root/.local/bin:$PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex + +# Install the rest dependent tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + libnuma-dev + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} --enable-shared \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && rm -f /usr/local/lib/libpython3.7m.so.1.0 \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/lib/libpython3.7m.so.1.0 /usr/local/lib/libpython3.7m.so.1.0 \ + && ldconfig \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install MindSpore cpu whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.3.0/MindSpore/cpu/x86_64/mindspore-1.3.0-cp37-cp37m-linux_x86_64.whl diff --git a/scripts/docker/mindspore-cpu/1.5.0/Dockerfile b/scripts/docker/mindspore-cpu/1.5.0/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..6c0bad5f4e77fad9c26762502317fc1fded16e2b --- /dev/null +++ b/scripts/docker/mindspore-cpu/1.5.0/Dockerfile @@ -0,0 +1,78 @@ +FROM ubuntu:18.04 + +MAINTAINER MindSpore Authors + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV PATH ${PYTHON_ROOT_PATH}/bin:/usr/local/bin:/root/.local/bin:$PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex \ + libjpeg8-dev + +# Install the rest dependent tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + libnuma-dev + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} --enable-shared \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && rm -f /usr/local/lib/libpython3.7m.so.1.0 \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/lib/libpython3.7m.so.1.0 /usr/local/lib/libpython3.7m.so.1.0 \ + && ldconfig \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install MindSpore cpu whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/MindSpore/cpu/x86_64/mindspore-1.5.0-cp37-cp37m-linux_x86_64.whl + +# Install MindInsight cpu whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/MindInsight/any/mindinsight-1.5.0-py3-none-any.whl diff --git a/scripts/docker/mindspore-cpu/1.5.0rc1/Dockerfile b/scripts/docker/mindspore-cpu/1.5.0rc1/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..bf6875ad1e64a3ed6aae5303a8c42241741c6828 --- /dev/null +++ b/scripts/docker/mindspore-cpu/1.5.0rc1/Dockerfile @@ -0,0 +1,78 @@ +FROM ubuntu:18.04 + +MAINTAINER MindSpore Authors + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV PATH ${PYTHON_ROOT_PATH}/bin:/usr/local/bin:/root/.local/bin:$PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex \ + libjpeg8-dev + +# Install the rest dependent tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + libnuma-dev + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} --enable-shared \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && rm -f /usr/local/lib/libpython3.7m.so.1.0 \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/lib/libpython3.7m.so.1.0 /usr/local/lib/libpython3.7m.so.1.0 \ + && ldconfig \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install MindSpore cpu whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0-rc1/MindSpore/cpu/x86_64/mindspore-1.5.0rc1-cp37-cp37m-linux_x86_64.whl + +# Install MindInsight cpu whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0-rc1/MindInsight/any/mindinsight-1.5.0rc1-py3-none-any.whl diff --git a/scripts/docker/mindspore-cpu/1.6.0/Dockerfile b/scripts/docker/mindspore-cpu/1.6.0/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..c6c23b515e74dc1fabf2ac32a32c3f46e6a12247 --- /dev/null +++ b/scripts/docker/mindspore-cpu/1.6.0/Dockerfile @@ -0,0 +1,78 @@ +FROM ubuntu:18.04 + +MAINTAINER MindSpore Authors + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV PATH ${PYTHON_ROOT_PATH}/bin:/usr/local/bin:/root/.local/bin:$PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex \ + libjpeg8-dev + +# Install the rest dependent tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + libnuma-dev + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} --enable-shared \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && rm -f /usr/local/lib/libpython3.7m.so.1.0 \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/lib/libpython3.7m.so.1.0 /usr/local/lib/libpython3.7m.so.1.0 \ + && ldconfig \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install MindSpore cpu whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.6.0/MindSpore/cpu/x86_64/mindspore-1.6.0-cp37-cp37m-linux_x86_64.whl + +# Install MindInsight cpu whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.6.0/MindInsight/any/mindinsight-1.6.0-py3-none-any.whl diff --git a/scripts/docker/mindspore-cpu/devel/Dockerfile b/scripts/docker/mindspore-cpu/devel/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..207d8232acd7419129c53456f70db3b673f7781c --- /dev/null +++ b/scripts/docker/mindspore-cpu/devel/Dockerfile @@ -0,0 +1,95 @@ +FROM ubuntu:18.04 + +MAINTAINER MindSpore Authors + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV CMAKE_ROOT_PATH /usr/local/cmake-3.14.1 +ENV PATH ${PYTHON_ROOT_PATH}/bin:${CMAKE_ROOT_PATH}/bin:/usr/local/bin:$PATH +ENV LD_LIBRARY_PATH ${PYTHON_ROOT_PATH}/lib + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex \ + libjpeg8-dev + +# Install the rest dependent tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + libnuma-dev + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} --enable-shared \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && rm -f /usr/local/lib/libpython3.7m.so.1.0 \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/lib/libpython3.7m.so.1.0 /usr/local/lib/libpython3.7m.so.1.0 \ + && ldconfig \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf \ + && pip install --no-cache-dir wheel + +# Install cmake (v3.14.1) +RUN cd /tmp \ + && wget https://github.com/Kitware/CMake/releases/download/v3.14.1/cmake-3.14.1-Linux-x86_64.sh \ + && mkdir -p ${CMAKE_ROOT_PATH} \ + && bash ./cmake-3.14.1-Linux-x86_64.sh --prefix=${CMAKE_ROOT_PATH} --exclude-subdir --skip-license \ + && rm -f /tmp/cmake-3.14.1-Linux-x86_64.sh + +# Install nodejs +RUN cd /tmp \ + && wget https://mirrors.huaweicloud.com/nodejs/v12.18.4/node-v12.18.4-linux-x64.tar.gz \ + && tar -zxf node-v12.18.4-linux-x64.tar.gz \ + && rm -rf /usr/local/nodejs \ + && mkdir -p /usr/local/nodejs \ + && mv /tmp/node-v12.18.4-linux-x64 /usr/local/nodejs/ \ + && chmod 755 -R /usr/local/nodejs \ + && ln -sf /usr/local/nodejs/node-v12.18.4-linux-x64/bin/node /usr/bin/node \ + && ln -sf /usr/local/nodejs/node-v12.18.4-linux-x64/bin/npm /usr/bin/npm \ + && npm config set registry https://registry.npm.taobao.org/ \ + && rm -f /tmp/node-v12.18.4-linux-x64.tar.gz \ No newline at end of file diff --git a/scripts/docker/mindspore-cpu/runtime/Dockerfile b/scripts/docker/mindspore-cpu/runtime/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..5403c3bc68c6c5d2b28de210056f3d62f4bb998e --- /dev/null +++ b/scripts/docker/mindspore-cpu/runtime/Dockerfile @@ -0,0 +1,72 @@ +FROM ubuntu:18.04 + +MAINTAINER MindSpore Authors + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV PATH /usr/local/bin:$PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex \ + libjpeg8-dev + +# Install the rest dependent tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + libnuma-dev + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} --enable-shared \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && rm -f /usr/local/lib/libpython3.7m.so.1.0 \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/lib/libpython3.7m.so.1.0 /usr/local/lib/libpython3.7m.so.1.0 \ + && ldconfig \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf diff --git a/scripts/docker/mindspore-gpu/0.1.0-alpha/Dockerfile b/scripts/docker/mindspore-gpu/0.1.0-alpha/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..50ca2b9f08a757fda91b5c02539c6c9b63a07394 --- /dev/null +++ b/scripts/docker/mindspore-gpu/0.1.0-alpha/Dockerfile @@ -0,0 +1,83 @@ +FROM nvidia/cuda:10.1-cudnn7-runtime-ubuntu18.04 + +MAINTAINER leonwanghui + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV OMPI_ROOT_PATH /usr/local/openmpi-3.1.5 +ENV PATH ${OMPI_ROOT_PATH}/bin:/usr/local/bin:$PATH +ENV LD_LIBRARY_PATH ${OMPI_ROOT_PATH}/lib:$LD_LIBRARY_PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex \ + libnccl2=2.4.8-1+cuda10.1 \ + libnccl-dev=2.4.8-1+cuda10.1 + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install openmpi (v3.1.5) +RUN cd /tmp \ + && wget https://download.open-mpi.org/release/open-mpi/v3.1/openmpi-3.1.5.tar.gz \ + && tar -xvf openmpi-3.1.5.tar.gz \ + && cd /tmp/openmpi-3.1.5 \ + && mkdir -p ${OMPI_ROOT_PATH} \ + && ./configure --prefix=${OMPI_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -rf /tmp/openmpi-3.1.5 \ + && rm -f /tmp/openmpi-3.1.5.tar.gz + +# Install MindSpore cuda-10.1 whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/0.1.0-alpha/MindSpore/gpu/cuda-10.1/mindspore-0.1.0-cp37-cp37m-linux_x86_64.whl diff --git a/scripts/docker/mindspore-gpu/0.2.0-alpha/Dockerfile b/scripts/docker/mindspore-gpu/0.2.0-alpha/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a6eaf8382afd59e2743ef1e3e6e19bbd885429ff --- /dev/null +++ b/scripts/docker/mindspore-gpu/0.2.0-alpha/Dockerfile @@ -0,0 +1,83 @@ +FROM nvidia/cuda:10.1-cudnn7-runtime-ubuntu18.04 + +MAINTAINER leonwanghui + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV OMPI_ROOT_PATH /usr/local/openmpi-3.1.5 +ENV PATH ${OMPI_ROOT_PATH}/bin:/usr/local/bin:$PATH +ENV LD_LIBRARY_PATH ${OMPI_ROOT_PATH}/lib:$LD_LIBRARY_PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex \ + libnccl2=2.4.8-1+cuda10.1 \ + libnccl-dev=2.4.8-1+cuda10.1 + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install openmpi (v3.1.5) +RUN cd /tmp \ + && wget https://download.open-mpi.org/release/open-mpi/v3.1/openmpi-3.1.5.tar.gz \ + && tar -xvf openmpi-3.1.5.tar.gz \ + && cd /tmp/openmpi-3.1.5 \ + && mkdir -p ${OMPI_ROOT_PATH} \ + && ./configure --prefix=${OMPI_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -rf /tmp/openmpi-3.1.5 \ + && rm -f /tmp/openmpi-3.1.5.tar.gz + +# Install MindSpore cuda-10.1 whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/0.2.0-alpha/MindSpore/gpu/cuda-10.1/mindspore_gpu-0.2.0-cp37-cp37m-linux_x86_64.whl diff --git a/scripts/docker/mindspore-gpu/0.3.0-alpha/Dockerfile b/scripts/docker/mindspore-gpu/0.3.0-alpha/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ef243aa77cc7e25e6e8d0902f60cfc072f21719e --- /dev/null +++ b/scripts/docker/mindspore-gpu/0.3.0-alpha/Dockerfile @@ -0,0 +1,83 @@ +FROM nvidia/cuda:10.1-cudnn7-runtime-ubuntu18.04 + +MAINTAINER leonwanghui + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV OMPI_ROOT_PATH /usr/local/openmpi-3.1.5 +ENV PATH ${OMPI_ROOT_PATH}/bin:/usr/local/bin:$PATH +ENV LD_LIBRARY_PATH ${OMPI_ROOT_PATH}/lib:$LD_LIBRARY_PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex \ + libnccl2=2.4.8-1+cuda10.1 \ + libnccl-dev=2.4.8-1+cuda10.1 + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install openmpi (v3.1.5) +RUN cd /tmp \ + && wget https://download.open-mpi.org/release/open-mpi/v3.1/openmpi-3.1.5.tar.gz \ + && tar -xvf openmpi-3.1.5.tar.gz \ + && cd /tmp/openmpi-3.1.5 \ + && mkdir -p ${OMPI_ROOT_PATH} \ + && ./configure --prefix=${OMPI_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -rf /tmp/openmpi-3.1.5 \ + && rm -f /tmp/openmpi-3.1.5.tar.gz + +# Install MindSpore cuda-10.1 whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/0.3.0-alpha/MindSpore/gpu/ubuntu_x86/cuda-10.1/mindspore_gpu-0.3.0-cp37-cp37m-linux_x86_64.whl diff --git a/scripts/docker/mindspore-gpu/0.5.0-beta/Dockerfile b/scripts/docker/mindspore-gpu/0.5.0-beta/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..dae6d163706aabb810706bf0c69b195c4d4acc77 --- /dev/null +++ b/scripts/docker/mindspore-gpu/0.5.0-beta/Dockerfile @@ -0,0 +1,83 @@ +FROM nvidia/cuda:10.1-cudnn7-runtime-ubuntu18.04 + +MAINTAINER leonwanghui + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV OMPI_ROOT_PATH /usr/local/openmpi-3.1.5 +ENV PATH ${OMPI_ROOT_PATH}/bin:/usr/local/bin:$PATH +ENV LD_LIBRARY_PATH ${OMPI_ROOT_PATH}/lib:$LD_LIBRARY_PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex \ + libnccl2=2.4.8-1+cuda10.1 \ + libnccl-dev=2.4.8-1+cuda10.1 + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install openmpi (v3.1.5) +RUN cd /tmp \ + && wget https://download.open-mpi.org/release/open-mpi/v3.1/openmpi-3.1.5.tar.gz \ + && tar -xvf openmpi-3.1.5.tar.gz \ + && cd /tmp/openmpi-3.1.5 \ + && mkdir -p ${OMPI_ROOT_PATH} \ + && ./configure --prefix=${OMPI_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -rf /tmp/openmpi-3.1.5 \ + && rm -f /tmp/openmpi-3.1.5.tar.gz + +# Install MindSpore cuda-10.1 whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/0.5.0-beta/MindSpore/gpu/ubuntu_x86/cuda-10.1/mindspore_gpu-0.5.0-cp37-cp37m-linux_x86_64.whl diff --git a/scripts/docker/mindspore-gpu/0.6.0-beta/Dockerfile b/scripts/docker/mindspore-gpu/0.6.0-beta/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..90d90a4e170f52905474d571cdb305bb1880cf0c --- /dev/null +++ b/scripts/docker/mindspore-gpu/0.6.0-beta/Dockerfile @@ -0,0 +1,83 @@ +FROM nvidia/cuda:10.1-cudnn7-runtime-ubuntu18.04 + +MAINTAINER leonwanghui + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV OMPI_ROOT_PATH /usr/local/openmpi-3.1.5 +ENV PATH ${OMPI_ROOT_PATH}/bin:/usr/local/bin:$PATH +ENV LD_LIBRARY_PATH ${OMPI_ROOT_PATH}/lib:$LD_LIBRARY_PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex \ + libnccl2=2.4.8-1+cuda10.1 \ + libnccl-dev=2.4.8-1+cuda10.1 + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install openmpi (v3.1.5) +RUN cd /tmp \ + && wget https://download.open-mpi.org/release/open-mpi/v3.1/openmpi-3.1.5.tar.gz \ + && tar -xvf openmpi-3.1.5.tar.gz \ + && cd /tmp/openmpi-3.1.5 \ + && mkdir -p ${OMPI_ROOT_PATH} \ + && ./configure --prefix=${OMPI_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -rf /tmp/openmpi-3.1.5 \ + && rm -f /tmp/openmpi-3.1.5.tar.gz + +# Install MindSpore cuda-10.1 whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/0.6.0-beta/MindSpore/gpu/ubuntu_x86/cuda-10.1/mindspore_gpu-0.6.0-cp37-cp37m-linux_x86_64.whl diff --git a/scripts/docker/mindspore-gpu/0.7.0-beta/Dockerfile b/scripts/docker/mindspore-gpu/0.7.0-beta/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ed32a8e6edbe0e100ab59268c1aeb3d726d80886 --- /dev/null +++ b/scripts/docker/mindspore-gpu/0.7.0-beta/Dockerfile @@ -0,0 +1,81 @@ +FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04 + +MAINTAINER leonwanghui + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV OMPI_ROOT_PATH /usr/local/openmpi-3.1.5 +ENV PATH ${OMPI_ROOT_PATH}/bin:/usr/local/bin:$PATH +ENV LD_LIBRARY_PATH ${OMPI_ROOT_PATH}/lib:$LD_LIBRARY_PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install openmpi (v3.1.5) +RUN cd /tmp \ + && wget https://download.open-mpi.org/release/open-mpi/v3.1/openmpi-3.1.5.tar.gz \ + && tar -xvf openmpi-3.1.5.tar.gz \ + && cd /tmp/openmpi-3.1.5 \ + && mkdir -p ${OMPI_ROOT_PATH} \ + && ./configure --prefix=${OMPI_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -rf /tmp/openmpi-3.1.5 \ + && rm -f /tmp/openmpi-3.1.5.tar.gz + +# Install MindSpore cuda-10.1 whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/0.7.0-beta/MindSpore/gpu/ubuntu_x86/cuda-10.1/mindspore_gpu-0.7.0-cp37-cp37m-linux_x86_64.whl diff --git a/scripts/docker/mindspore-gpu/1.0.0/Dockerfile b/scripts/docker/mindspore-gpu/1.0.0/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..cab190093bab5036dd2e6c2dc5722ea5b07cfb5a --- /dev/null +++ b/scripts/docker/mindspore-gpu/1.0.0/Dockerfile @@ -0,0 +1,81 @@ +FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04 + +MAINTAINER leonwanghui + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV OMPI_ROOT_PATH /usr/local/openmpi-3.1.5 +ENV PATH ${OMPI_ROOT_PATH}/bin:/usr/local/bin:$PATH +ENV LD_LIBRARY_PATH ${OMPI_ROOT_PATH}/lib:$LD_LIBRARY_PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install openmpi (v3.1.5) +RUN cd /tmp \ + && wget https://download.open-mpi.org/release/open-mpi/v3.1/openmpi-3.1.5.tar.gz \ + && tar -xvf openmpi-3.1.5.tar.gz \ + && cd /tmp/openmpi-3.1.5 \ + && mkdir -p ${OMPI_ROOT_PATH} \ + && ./configure --prefix=${OMPI_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -rf /tmp/openmpi-3.1.5 \ + && rm -f /tmp/openmpi-3.1.5.tar.gz + +# Install MindSpore cuda-10.1 whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.0.0/MindSpore/gpu/ubuntu_x86/cuda-10.1/mindspore_gpu-1.0.0-cp37-cp37m-linux_x86_64.whl diff --git a/scripts/docker/mindspore-gpu/1.1.0/Dockerfile b/scripts/docker/mindspore-gpu/1.1.0/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..9121a0bcb621d17c474f096de4e066f382b1ba5f --- /dev/null +++ b/scripts/docker/mindspore-gpu/1.1.0/Dockerfile @@ -0,0 +1,85 @@ +FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04 + +MAINTAINER leonwanghui + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV OMPI_ROOT_PATH /usr/local/openmpi-4.0.3 +ENV PATH ${OMPI_ROOT_PATH}/bin:/usr/local/bin:$PATH +ENV LD_LIBRARY_PATH ${OMPI_ROOT_PATH}/lib:$LD_LIBRARY_PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex + +# Install the rest dependent tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + libnuma-dev + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install openmpi (v4.0.3) +RUN cd /tmp \ + && wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.3.tar.gz \ + && tar -xvf openmpi-4.0.3.tar.gz \ + && cd /tmp/openmpi-4.0.3 \ + && mkdir -p ${OMPI_ROOT_PATH} \ + && ./configure --prefix=${OMPI_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -rf /tmp/openmpi-4.0.3 \ + && rm -f /tmp/openmpi-4.0.3.tar.gz + +# Install MindSpore cuda-10.1 whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.1.0/MindSpore/gpu/ubuntu_x86/cuda-10.1/mindspore_gpu-1.1.0-cp37-cp37m-linux_x86_64.whl diff --git a/scripts/docker/mindspore-gpu/1.2.0/Dockerfile b/scripts/docker/mindspore-gpu/1.2.0/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..31391fcb400786604cf457bb82be9dcbf82aec65 --- /dev/null +++ b/scripts/docker/mindspore-gpu/1.2.0/Dockerfile @@ -0,0 +1,88 @@ +FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04 + +MAINTAINER leonwanghui + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV OMPI_ROOT_PATH /usr/local/openmpi-4.0.3 +ENV PATH ${OMPI_ROOT_PATH}/bin:/usr/local/bin:$PATH +ENV LD_LIBRARY_PATH ${OMPI_ROOT_PATH}/lib:$LD_LIBRARY_PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex + +# Install the rest dependent tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + libnuma-dev + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install openmpi (v4.0.3) +RUN cd /tmp \ + && wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.3.tar.gz \ + && tar -xvf openmpi-4.0.3.tar.gz \ + && cd /tmp/openmpi-4.0.3 \ + && mkdir -p ${OMPI_ROOT_PATH} \ + && ./configure --prefix=${OMPI_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -rf /tmp/openmpi-4.0.3 \ + && rm -f /tmp/openmpi-4.0.3.tar.gz + +# Install MindSpore cuda-10.1 whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.2.0/MindSpore/gpu/ubuntu_x86/cuda-10.1/mindspore_gpu-1.2.0-cp37-cp37m-linux_x86_64.whl + +# Install MindInsight whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.2.0/MindInsight/ascend/ubuntu_x86/mindinsight-1.2.0-cp37-cp37m-linux_x86_64.whl \ No newline at end of file diff --git a/scripts/docker/mindspore-gpu/1.2.1/Dockerfile b/scripts/docker/mindspore-gpu/1.2.1/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..db1e8203b2603005f74d20dac1beee22742f6c66 --- /dev/null +++ b/scripts/docker/mindspore-gpu/1.2.1/Dockerfile @@ -0,0 +1,88 @@ +FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04 + +MAINTAINER leonwanghui + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV OMPI_ROOT_PATH /usr/local/openmpi-4.0.3 +ENV PATH ${PYTHON_ROOT_PATH}/bin:${OMPI_ROOT_PATH}/bin:/usr/local/bin:$PATH +ENV LD_LIBRARY_PATH ${OMPI_ROOT_PATH}/lib:$LD_LIBRARY_PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex + +# Install the rest dependent tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + libnuma-dev + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install openmpi (v4.0.3) +RUN cd /tmp \ + && wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.3.tar.gz \ + && tar -xvf openmpi-4.0.3.tar.gz \ + && cd /tmp/openmpi-4.0.3 \ + && mkdir -p ${OMPI_ROOT_PATH} \ + && ./configure --prefix=${OMPI_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -rf /tmp/openmpi-4.0.3 \ + && rm -f /tmp/openmpi-4.0.3.tar.gz + +# Install MindSpore cuda-10.1 whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.2.1/MindSpore/gpu/ubuntu_x86/cuda-10.1/mindspore_gpu-1.2.1-cp37-cp37m-linux_x86_64.whl + +# Install MindInsight whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.2.0/MindInsight/ascend/ubuntu_x86/mindinsight-1.2.0-cp37-cp37m-linux_x86_64.whl \ No newline at end of file diff --git a/scripts/docker/mindspore-gpu/1.3.0/Dockerfile b/scripts/docker/mindspore-gpu/1.3.0/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..897cbb487eb3b93d3395e579d905f0de51b5592d --- /dev/null +++ b/scripts/docker/mindspore-gpu/1.3.0/Dockerfile @@ -0,0 +1,91 @@ +FROM nvidia/cuda:11.1-cudnn8-devel-ubuntu18.04 + +MAINTAINER leonwanghui + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV OMPI_ROOT_PATH /usr/local/openmpi-4.0.3 +ENV PATH ${PYTHON_ROOT_PATH}/bin:${OMPI_ROOT_PATH}/bin:/usr/local/bin:$PATH +ENV LD_LIBRARY_PATH ${OMPI_ROOT_PATH}/lib:$LD_LIBRARY_PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex + +# Install the rest dependent tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + libnuma-dev + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} --enable-shared \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && rm -f /usr/local/lib/libpython3.7m.so.1.0 \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/lib/libpython3.7m.so.1.0 /usr/local/lib/libpython3.7m.so.1.0 \ + && ldconfig \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install openmpi (v4.0.3) +RUN cd /tmp \ + && wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.3.tar.gz \ + && tar -xvf openmpi-4.0.3.tar.gz \ + && cd /tmp/openmpi-4.0.3 \ + && mkdir -p ${OMPI_ROOT_PATH} \ + && ./configure --prefix=${OMPI_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -rf /tmp/openmpi-4.0.3 \ + && rm -f /tmp/openmpi-4.0.3.tar.gz + +# Install MindSpore cuda-11.1 whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.3.0/MindSpore/gpu/x86_64/cuda-11.1/mindspore_gpu-1.3.0-cp37-cp37m-linux_x86_64.whl + +# Install MindInsight whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.3.0/MindInsight/any/mindinsight-1.3.0-py3-none-any.whl \ No newline at end of file diff --git a/scripts/docker/mindspore-gpu/1.3.0/cuda10.1/Dockerfile b/scripts/docker/mindspore-gpu/1.3.0/cuda10.1/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..f2cc3d65014134a016f32eeebc59d729a8d5cc64 --- /dev/null +++ b/scripts/docker/mindspore-gpu/1.3.0/cuda10.1/Dockerfile @@ -0,0 +1,90 @@ +FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04 + +MAINTAINER leonwanghui + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV OMPI_ROOT_PATH /usr/local/openmpi-4.0.3 +ENV PATH ${PYTHON_ROOT_PATH}/bin:${OMPI_ROOT_PATH}/bin:/usr/local/bin:$PATH +ENV LD_LIBRARY_PATH ${OMPI_ROOT_PATH}/lib:$LD_LIBRARY_PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex + +# Install the rest dependent tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + libnuma-dev + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} --enable-shared \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && rm -f /usr/local/lib/libpython3.7m.so.1.0 \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/lib/libpython3.7m.so.1.0 /usr/local/lib/libpython3.7m.so.1.0 \ + && ldconfig \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install openmpi (v4.0.3) +RUN cd /tmp \ + && wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.3.tar.gz \ + && tar -xvf openmpi-4.0.3.tar.gz \ + && cd /tmp/openmpi-4.0.3 \ + && mkdir -p ${OMPI_ROOT_PATH} \ + && ./configure --prefix=${OMPI_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -rf /tmp/openmpi-4.0.3 \ + && rm -f /tmp/openmpi-4.0.3.tar.gz + +# Install MindSpore cuda-10.1, MindInsight, Serving whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.3.0/MindSpore/gpu/x86_64/cuda-10.1/mindspore_gpu-1.3.0-cp37-cp37m-linux_x86_64.whl \ + && pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.3.0/MindInsight/any/mindinsight-1.3.0-py3-none-any.whl \ + && pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.3.0/Serving/x86_64/mindspore_serving-1.3.0-cp37-cp37m-linux_x86_64.whl diff --git a/scripts/docker/mindspore-gpu/1.5.0/cuda10.1/Dockerfile b/scripts/docker/mindspore-gpu/1.5.0/cuda10.1/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..f02eada486dfbd8cb283d1a71222c96a3b7ca454 --- /dev/null +++ b/scripts/docker/mindspore-gpu/1.5.0/cuda10.1/Dockerfile @@ -0,0 +1,91 @@ +FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04 + +MAINTAINER MindSpore Authors + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV OMPI_ROOT_PATH /usr/local/openmpi-4.0.3 +ENV PATH ${PYTHON_ROOT_PATH}/bin:${OMPI_ROOT_PATH}/bin:/usr/local/bin:$PATH +ENV LD_LIBRARY_PATH ${OMPI_ROOT_PATH}/lib:$LD_LIBRARY_PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex \ + libjpeg8-dev + +# Install the rest dependent tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + libnuma-dev + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} --enable-shared \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && rm -f /usr/local/lib/libpython3.7m.so.1.0 \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/lib/libpython3.7m.so.1.0 /usr/local/lib/libpython3.7m.so.1.0 \ + && ldconfig \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install openmpi (v4.0.3) +RUN cd /tmp \ + && wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.3.tar.gz \ + && tar -xvf openmpi-4.0.3.tar.gz \ + && cd /tmp/openmpi-4.0.3 \ + && mkdir -p ${OMPI_ROOT_PATH} \ + && ./configure --prefix=${OMPI_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -rf /tmp/openmpi-4.0.3 \ + && rm -f /tmp/openmpi-4.0.3.tar.gz + +# Install MindSpore cuda-10.1, MindInsight, Serving whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/MindSpore/gpu/x86_64/cuda-10.1/mindspore_gpu-1.5.0-cp37-cp37m-linux_x86_64.whl \ + && pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/MindInsight/any/mindinsight-1.5.0-py3-none-any.whl \ + && pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/Serving/x86_64/mindspore_serving-1.5.0-cp37-cp37m-linux_x86_64.whl diff --git a/scripts/docker/mindspore-gpu/1.5.0/cuda11.1/Dockerfile b/scripts/docker/mindspore-gpu/1.5.0/cuda11.1/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..f8f308a92d9a2d6051b94139b40313b2b4abc2b6 --- /dev/null +++ b/scripts/docker/mindspore-gpu/1.5.0/cuda11.1/Dockerfile @@ -0,0 +1,91 @@ +FROM nvidia/cuda:11.1-cudnn8-devel-ubuntu18.04 + +MAINTAINER MindSpore Authors + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV OMPI_ROOT_PATH /usr/local/openmpi-4.0.3 +ENV PATH ${PYTHON_ROOT_PATH}/bin:${OMPI_ROOT_PATH}/bin:/usr/local/bin:$PATH +ENV LD_LIBRARY_PATH ${OMPI_ROOT_PATH}/lib:$LD_LIBRARY_PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex \ + libjpeg8-dev + +# Install the rest dependent tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + libnuma-dev + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} --enable-shared \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && rm -f /usr/local/lib/libpython3.7m.so.1.0 \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/lib/libpython3.7m.so.1.0 /usr/local/lib/libpython3.7m.so.1.0 \ + && ldconfig \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install openmpi (v4.0.3) +RUN cd /tmp \ + && wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.3.tar.gz \ + && tar -xvf openmpi-4.0.3.tar.gz \ + && cd /tmp/openmpi-4.0.3 \ + && mkdir -p ${OMPI_ROOT_PATH} \ + && ./configure --prefix=${OMPI_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -rf /tmp/openmpi-4.0.3 \ + && rm -f /tmp/openmpi-4.0.3.tar.gz + +# Install MindSpore cuda-11.1, MindInsight, Serving whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/MindSpore/gpu/x86_64/cuda-11.1/mindspore_gpu-1.5.0-cp37-cp37m-linux_x86_64.whl \ + && pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/MindInsight/any/mindinsight-1.5.0-py3-none-any.whl \ + && pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/Serving/x86_64/mindspore_serving-1.5.0-cp37-cp37m-linux_x86_64.whl diff --git a/scripts/docker/mindspore-gpu/1.5.0rc1/cuda10.1/Dockerfile b/scripts/docker/mindspore-gpu/1.5.0rc1/cuda10.1/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..409f812246b93f639efc3c23ff64acf9bcae48c0 --- /dev/null +++ b/scripts/docker/mindspore-gpu/1.5.0rc1/cuda10.1/Dockerfile @@ -0,0 +1,91 @@ +FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04 + +MAINTAINER MindSpore Authors + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV OMPI_ROOT_PATH /usr/local/openmpi-4.0.3 +ENV PATH ${PYTHON_ROOT_PATH}/bin:${OMPI_ROOT_PATH}/bin:/usr/local/bin:$PATH +ENV LD_LIBRARY_PATH ${OMPI_ROOT_PATH}/lib:$LD_LIBRARY_PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex \ + libjpeg8-dev + +# Install the rest dependent tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + libnuma-dev + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} --enable-shared \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && rm -f /usr/local/lib/libpython3.7m.so.1.0 \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/lib/libpython3.7m.so.1.0 /usr/local/lib/libpython3.7m.so.1.0 \ + && ldconfig \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install openmpi (v4.0.3) +RUN cd /tmp \ + && wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.3.tar.gz \ + && tar -xvf openmpi-4.0.3.tar.gz \ + && cd /tmp/openmpi-4.0.3 \ + && mkdir -p ${OMPI_ROOT_PATH} \ + && ./configure --prefix=${OMPI_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -rf /tmp/openmpi-4.0.3 \ + && rm -f /tmp/openmpi-4.0.3.tar.gz + +# Install MindSpore cuda-10.1, MindInsight, Serving whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0-rc1/MindSpore/gpu/x86_64/cuda-10.1/mindspore_gpu-1.5.0rc1-cp37-cp37m-linux_x86_64.whl \ + && pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0-rc1/MindInsight/any/mindinsight-1.5.0rc1-py3-none-any.whl \ + && pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0-rc1/Serving/x86_64/mindspore_serving-1.5.0rc1-cp37-cp37m-linux_x86_64.whl diff --git a/scripts/docker/mindspore-gpu/1.5.0rc1/cuda11.1/Dockerfile b/scripts/docker/mindspore-gpu/1.5.0rc1/cuda11.1/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..de02087fb367ffe70d552a2055aeafc380447382 --- /dev/null +++ b/scripts/docker/mindspore-gpu/1.5.0rc1/cuda11.1/Dockerfile @@ -0,0 +1,91 @@ +FROM nvidia/cuda:11.1-cudnn8-devel-ubuntu18.04 + +MAINTAINER MindSpore Authors + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV OMPI_ROOT_PATH /usr/local/openmpi-4.0.3 +ENV PATH ${PYTHON_ROOT_PATH}/bin:${OMPI_ROOT_PATH}/bin:/usr/local/bin:$PATH +ENV LD_LIBRARY_PATH ${OMPI_ROOT_PATH}/lib:$LD_LIBRARY_PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex \ + libjpeg8-dev + +# Install the rest dependent tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + libnuma-dev + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} --enable-shared \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && rm -f /usr/local/lib/libpython3.7m.so.1.0 \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/lib/libpython3.7m.so.1.0 /usr/local/lib/libpython3.7m.so.1.0 \ + && ldconfig \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install openmpi (v4.0.3) +RUN cd /tmp \ + && wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.3.tar.gz \ + && tar -xvf openmpi-4.0.3.tar.gz \ + && cd /tmp/openmpi-4.0.3 \ + && mkdir -p ${OMPI_ROOT_PATH} \ + && ./configure --prefix=${OMPI_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -rf /tmp/openmpi-4.0.3 \ + && rm -f /tmp/openmpi-4.0.3.tar.gz + +# Install MindSpore cuda-11.1, MindInsight, Serving whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0-rc1/MindSpore/gpu/x86_64/cuda-11.1/mindspore_gpu-1.5.0rc1-cp37-cp37m-linux_x86_64.whl \ + && pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0-rc1/MindInsight/any/mindinsight-1.5.0rc1-py3-none-any.whl \ + && pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0-rc1/Serving/x86_64/mindspore_serving-1.5.0rc1-cp37-cp37m-linux_x86_64.whl diff --git a/scripts/docker/mindspore-gpu/1.6.0/cuda10.1/Dockerfile b/scripts/docker/mindspore-gpu/1.6.0/cuda10.1/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..cc3fe3ba9d79aecc5a6d023a196291f5e124ab47 --- /dev/null +++ b/scripts/docker/mindspore-gpu/1.6.0/cuda10.1/Dockerfile @@ -0,0 +1,91 @@ +FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04 + +MAINTAINER MindSpore Authors + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV OMPI_ROOT_PATH /usr/local/openmpi-4.0.3 +ENV PATH ${PYTHON_ROOT_PATH}/bin:${OMPI_ROOT_PATH}/bin:/usr/local/bin:$PATH +ENV LD_LIBRARY_PATH ${OMPI_ROOT_PATH}/lib:$LD_LIBRARY_PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex \ + libjpeg8-dev + +# Install the rest dependent tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + libnuma-dev + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} --enable-shared \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && rm -f /usr/local/lib/libpython3.7m.so.1.0 \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/lib/libpython3.7m.so.1.0 /usr/local/lib/libpython3.7m.so.1.0 \ + && ldconfig \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install openmpi (v4.0.3) +RUN cd /tmp \ + && wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.3.tar.gz \ + && tar -xvf openmpi-4.0.3.tar.gz \ + && cd /tmp/openmpi-4.0.3 \ + && mkdir -p ${OMPI_ROOT_PATH} \ + && ./configure --prefix=${OMPI_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -rf /tmp/openmpi-4.0.3 \ + && rm -f /tmp/openmpi-4.0.3.tar.gz + +# Install MindSpore cuda-10.1, MindInsight, Serving whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.6.0/MindSpore/gpu/x86_64/cuda-10.1/mindspore_gpu-1.6.0-cp37-cp37m-linux_x86_64.whl \ + && pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.6.0/MindInsight/any/mindinsight-1.6.0-py3-none-any.whl \ + && pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.6.0/Serving/x86_64/mindspore_serving-1.6.0-cp37-cp37m-linux_x86_64.whl diff --git a/scripts/docker/mindspore-gpu/1.6.0/cuda11.1/Dockerfile b/scripts/docker/mindspore-gpu/1.6.0/cuda11.1/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..e1f5362ea312e963a2fb0a7f1ce6e31610e2179a --- /dev/null +++ b/scripts/docker/mindspore-gpu/1.6.0/cuda11.1/Dockerfile @@ -0,0 +1,91 @@ +FROM nvidia/cuda:11.1-cudnn8-devel-ubuntu18.04 + +MAINTAINER MindSpore Authors + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV OMPI_ROOT_PATH /usr/local/openmpi-4.0.3 +ENV PATH ${PYTHON_ROOT_PATH}/bin:${OMPI_ROOT_PATH}/bin:/usr/local/bin:$PATH +ENV LD_LIBRARY_PATH ${OMPI_ROOT_PATH}/lib:$LD_LIBRARY_PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex \ + libjpeg8-dev + +# Install the rest dependent tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + libnuma-dev + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} --enable-shared \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && rm -f /usr/local/lib/libpython3.7m.so.1.0 \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/lib/libpython3.7m.so.1.0 /usr/local/lib/libpython3.7m.so.1.0 \ + && ldconfig \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install openmpi (v4.0.3) +RUN cd /tmp \ + && wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.3.tar.gz \ + && tar -xvf openmpi-4.0.3.tar.gz \ + && cd /tmp/openmpi-4.0.3 \ + && mkdir -p ${OMPI_ROOT_PATH} \ + && ./configure --prefix=${OMPI_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -rf /tmp/openmpi-4.0.3 \ + && rm -f /tmp/openmpi-4.0.3.tar.gz + +# Install MindSpore cuda-11.1, MindInsight, Serving whl package +RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.6.0/MindSpore/gpu/x86_64/cuda-11.1/mindspore_gpu-1.6.0-cp37-cp37m-linux_x86_64.whl \ + && pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.6.0/MindInsight/any/mindinsight-1.6.0-py3-none-any.whl \ + && pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.6.0/Serving/x86_64/mindspore_serving-1.6.0-cp37-cp37m-linux_x86_64.whl diff --git a/scripts/docker/mindspore-gpu/devel/Dockerfile b/scripts/docker/mindspore-gpu/devel/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..2b80e70489678dc6824ef840f99c4a4319b3554d --- /dev/null +++ b/scripts/docker/mindspore-gpu/devel/Dockerfile @@ -0,0 +1,111 @@ +FROM nvidia/cuda:11.1-cudnn8-devel-ubuntu18.04 + +MAINTAINER MindSpore Authors + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV CMAKE_ROOT_PATH /usr/local/cmake-3.14.1 +ENV OMPI_ROOT_PATH /usr/local/openmpi-4.0.3 +ENV PATH ${OMPI_ROOT_PATH}/bin:${PYTHON_ROOT_PATH}/bin:${CMAKE_ROOT_PATH}/bin:/usr/local/bin:$PATH +ENV LD_LIBRARY_PATH ${OMPI_ROOT_PATH}/lib::${PYTHON_ROOT_PATH}/lib + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex \ + libjpeg8-dev + +# Install the rest dependent tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + libnuma-dev + +# Configure cuDNN (v7.6.5) +RUN ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so.8.0.5 /usr/local/cuda/lib64/libcudnn.so + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} --enable-shared \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && rm -f /usr/local/lib/libpython3.7m.so.1.0 \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/lib/libpython3.7m.so.1.0 /usr/local/lib/libpython3.7m.so.1.0 \ + && ldconfig \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf \ + && pip install --no-cache-dir wheel + +# Install cmake (v3.14.1) +RUN cd /tmp \ + && wget https://github.com/Kitware/CMake/releases/download/v3.14.1/cmake-3.14.1-Linux-x86_64.sh \ + && mkdir -p ${CMAKE_ROOT_PATH} \ + && bash ./cmake-3.14.1-Linux-x86_64.sh --prefix=${CMAKE_ROOT_PATH} --exclude-subdir --skip-license \ + && rm -f /tmp/cmake-3.14.1-Linux-x86_64.sh + +# Install openmpi (v4.0.3) +RUN cd /tmp \ + && wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.3.tar.gz \ + && tar -xvf openmpi-4.0.3.tar.gz \ + && cd /tmp/openmpi-4.0.3 \ + && mkdir -p ${OMPI_ROOT_PATH} \ + && ./configure --prefix=${OMPI_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -rf /tmp/openmpi-4.0.3 \ + && rm -f /tmp/openmpi-4.0.3.tar.gz + +# Install nodejs +RUN cd /tmp \ + && wget https://mirrors.huaweicloud.com/nodejs/v12.18.4/node-v12.18.4-linux-x64.tar.gz \ + && tar -zxf node-v12.18.4-linux-x64.tar.gz \ + && rm -rf /usr/local/nodejs \ + && mkdir -p /usr/local/nodejs \ + && mv /tmp/node-v12.18.4-linux-x64 /usr/local/nodejs/ \ + && chmod 755 -R /usr/local/nodejs \ + && ln -sf /usr/local/nodejs/node-v12.18.4-linux-x64/bin/node /usr/bin/node \ + && ln -sf /usr/local/nodejs/node-v12.18.4-linux-x64/bin/npm /usr/bin/npm \ + && npm config set registry https://registry.npm.taobao.org/ \ + && rm -f /tmp/node-v12.18.4-linux-x64.tar.gz \ No newline at end of file diff --git a/scripts/docker/mindspore-gpu/runtime/Dockerfile b/scripts/docker/mindspore-gpu/runtime/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..e4dc4e67ddef7eb76ee80b72593d71656b21773f --- /dev/null +++ b/scripts/docker/mindspore-gpu/runtime/Dockerfile @@ -0,0 +1,86 @@ +FROM nvidia/cuda:11.1-cudnn8-devel-ubuntu18.04 + +MAINTAINER MindSpore Authors + +# Set env +ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 +ENV OMPI_ROOT_PATH /usr/local/openmpi-4.0.3 +ENV PATH ${OMPI_ROOT_PATH}/bin:/usr/local/bin:$PATH +ENV LD_LIBRARY_PATH ${OMPI_ROOT_PATH}/lib:$LD_LIBRARY_PATH + +# Install base tools +RUN apt update \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + vim \ + wget \ + curl \ + xz-utils \ + net-tools \ + openssh-client \ + git \ + ntpdate \ + tzdata \ + tcl \ + sudo \ + bash-completion + +# Install compile tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + gcc \ + g++ \ + zlibc \ + make \ + libgmp-dev \ + patch \ + autoconf \ + libtool \ + automake \ + flex \ + libjpeg8-dev + +# Install the rest dependent tools +RUN DEBIAN_FRONTEND=noninteractive apt install -y \ + libnuma-dev + +# Set bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# Install python (v3.7.5) +RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ + libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ + && cd /tmp \ + && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ + && tar -xvf v3.7.5.tar.gz \ + && cd /tmp/cpython-3.7.5 \ + && mkdir -p ${PYTHON_ROOT_PATH} \ + && ./configure --prefix=${PYTHON_ROOT_PATH} --enable-shared \ + && make -j4 \ + && make install -j4 \ + && rm -f /usr/local/bin/python \ + && rm -f /usr/local/bin/pip \ + && rm -f /usr/local/lib/libpython3.7m.so.1.0 \ + && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ + && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ + && ln -s ${PYTHON_ROOT_PATH}/lib/libpython3.7m.so.1.0 /usr/local/lib/libpython3.7m.so.1.0 \ + && ldconfig \ + && rm -rf /tmp/cpython-3.7.5 \ + && rm -f /tmp/v3.7.5.tar.gz + +# Set pip source +RUN mkdir -pv /root/.pip \ + && echo "[global]" > /root/.pip/pip.conf \ + && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ + && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf + +# Install openmpi (v4.0.3) +RUN cd /tmp \ + && wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.3.tar.gz \ + && tar -xvf openmpi-4.0.3.tar.gz \ + && cd /tmp/openmpi-4.0.3 \ + && mkdir -p ${OMPI_ROOT_PATH} \ + && ./configure --prefix=${OMPI_ROOT_PATH} \ + && make -j4 \ + && make install -j4 \ + && rm -rf /tmp/openmpi-4.0.3 \ + && rm -f /tmp/openmpi-4.0.3.tar.gz diff --git a/scripts/dot2svg.sh b/scripts/dot2svg.sh new file mode 100755 index 0000000000000000000000000000000000000000..efa37e766dfb06a3e7c6ebf1704068b8db8404de --- /dev/null +++ b/scripts/dot2svg.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# Copyright 2019 Huawei Technologies Co., Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================ + +set -e +# set -x +# Usage: ./scripts/dot2svg.sh [search_path] +if [[ -z "$1" ]] + then + DIR="." + else + DIR="$1" +fi + +for f in "${DIR}"/*.dot +do +dot -Tsvg -o "${DIR}/$(basename "${f}").svg" "${DIR}/$(basename "${f}")" +done diff --git a/scripts/format_source_code.sh b/scripts/format_source_code.sh new file mode 100755 index 0000000000000000000000000000000000000000..bb9227470feb849d91d85d86aa18abb6e291e423 --- /dev/null +++ b/scripts/format_source_code.sh @@ -0,0 +1,105 @@ +#!/bin/bash +# Copyright 2019 Huawei Technologies Co., Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================ + +set -e + +CLANG_FORMAT=$(which clang-format) || (echo "Please install 'clang-format' tool first"; exit 1) + +version=$("${CLANG_FORMAT}" --version | sed -n "s/.*\ \([0-9]*\)\.[0-9]*\.[0-9]*.*/\1/p") +if [[ "${version}" -lt "8" ]]; then + echo "clang-format's version must be at least 8.0.0" + exit 1 +fi + +CURRENT_PATH=$(pwd) +SCRIPTS_PATH=$(dirname "$0") + +echo "CURRENT_PATH=${CURRENT_PATH}" +echo "SCRIPTS_PATH=${SCRIPTS_PATH}" + +# print usage message +function usage() +{ + echo "Format the specified source files to conform the code style." + echo "Usage:" + echo "bash $0 [-a] [-c] [-l] [-h]" + echo "e.g. $0 -c" + echo "" + echo "Options:" + echo " -a format of all files" + echo " -c format of the files changed compared to last commit, default case" + echo " -l format of the files changed in last commit" + echo " -h Print usage" +} + +# check and set options +function checkopts() +{ + # init variable + mode="changed" # default format changed files + + # Process the options + while getopts 'aclh' opt + do + case "${opt}" in + a) + mode="all" + ;; + c) + mode="changed" + ;; + l) + mode="lastcommit" + ;; + h) + usage + exit 0 + ;; + *) + echo "Unknown option ${opt}!" + usage + exit 1 + esac + done +} + +# init variable +# check options +checkopts "$@" + +# switch to project root path, which contains clang-format config file '.clang-format' +cd "${SCRIPTS_PATH}/.." || exit 1 + +FMT_FILE_LIST='__format_files_list__' + +if [[ "X${mode}" == "Xall" ]]; then + find mindspore/{ccsrc,core,lite} -type f -name "*" | grep -E "(\.h$|\.cc$|\.c$)" > "${FMT_FILE_LIST}" || true +elif [[ "X${mode}" == "Xchanged" ]]; then + git diff --name-only | grep "mindspore/ccsrc\|mindspore/core\|mindspore/lite\|include" | grep -E "(\.h$|\.cc$|\.c$)" > "${FMT_FILE_LIST}" || true +else # "X${mode}" == "Xlastcommit" + git diff --name-only HEAD~ HEAD | grep "mindspore/ccsrc\|mindspore/core\|mindspore/lite\|include" | grep -E "(\.h$|\.cc$|\.c$)" > "${FMT_FILE_LIST}" || true +fi + +while read line; do + if [ -f "${line}" ]; then + "${CLANG_FORMAT}" -i "${line}" + fi +done < "${FMT_FILE_LIST}" + +rm "${FMT_FILE_LIST}" +cd "${CURRENT_PATH}" || exit 1 + +echo "Specified cpp source files have been format successfully." diff --git a/scripts/get_bert_shape_from_pytest.sh b/scripts/get_bert_shape_from_pytest.sh new file mode 100755 index 0000000000000000000000000000000000000000..944170d92d7c8c17ff614b63c99d7a1396aa29af --- /dev/null +++ b/scripts/get_bert_shape_from_pytest.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# Copyright 2019 Huawei Technologies Co., Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================ + +set -e + +CURRPATH=$(cd "$(dirname $0)"; pwd) +PROJECT_PATH="${CURRPATH}/.." +SHP_BASENAME="test_bert_train" +BUILD_PATH="${PROJECT_PATH}/build" + +cd "${PROJECT_PATH}"; sh build.sh -t off -l none -r -T; cd - + +export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${BUILD_PATH}/third_party/gtest/lib" +export PYTHONPATH="${PYTHONPATH}:${PROJECT_PATH}:${PROJECT_PATH}/tests/ut/python_input" + +test_bert_train="${PROJECT_PATH}/tests/perf_test/test_bert_train.py" + +export SAVE_GRAPHS='YES' +export SAVE_GRAPHS_PATH="${PROJECT_PATH}" +for version in base large +do + for batch_size in 1 2 4 8 16 32 64 128 256 512 1024 + do + export VERSION="${version}" + export BATCH_SIZE="${batch_size}" + target_file="${PROJECT_PATH}/${SHP_BASENAME}.${VERSION}.${BATCH_SIZE}.shp" + pytest "${test_bert_train}" + cp "${SAVE_GRAPHS_PATH}/9_validate.dat" "${target_file}" + done +done diff --git a/scripts/get_op_use_count.sh b/scripts/get_op_use_count.sh new file mode 100755 index 0000000000000000000000000000000000000000..91789a03298e9f69835e3be6df4d3dfbd501b8e5 --- /dev/null +++ b/scripts/get_op_use_count.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Copyright 2019 Huawei Technologies Co., Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================ + +./scripts/get_shape_from_ir.sh "$1" |awk -F'\t' '{print $2}' | sort |uniq -c |sort -r diff --git a/scripts/get_shape_from_ir.sh b/scripts/get_shape_from_ir.sh new file mode 100755 index 0000000000000000000000000000000000000000..739ffca56e3137f4b1cec0d7a093c86e12ce8fa6 --- /dev/null +++ b/scripts/get_shape_from_ir.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Copyright 2019 Huawei Technologies Co., Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================ + +set -e + +# Usage : get_shape_from_ir.sh ir_file + +cat "$1" | perl -p -e 's/\n/NEWLINE/' \ + | sed 's/NEWLINE :/:/g' \ + | sed 's/Tensor NEWLINEshape//g' \ + | perl -p -e 's/NEWLINE/\n/g' \ + | perl -p -e 's//\2/g' \ + | perl -p -e 's//Tuple/g' \ + | perl -p -e 's/ \%(\d+)\(.*= /\1\t/g' \ + | perl -p -e 's/\(.*\)( \{.*\})*:/\t\1\t/g' \ + | tr -d '()' \ + | awk '/subgraph/{p=1;next}{if(p){print}}'\ + | awk '/return/{p=1;next}{if(!p){print}}' \ + | sed '/^$/d' \ + | awk -F'\t' '{print $1"\t"$2"\t"$4}' diff --git a/scripts/install/euleros-ascend-conda.sh b/scripts/install/euleros-ascend-conda.sh new file mode 100644 index 0000000000000000000000000000000000000000..fed9f3f5e72b7f24f902b2476b4ec2595c417ca7 --- /dev/null +++ b/scripts/install/euleros-ascend-conda.sh @@ -0,0 +1,42 @@ +#!/bin/bash +set -ex + +MINDSPORE_VERSION=${MINDSPORE_VERSION:-1.5.0} +PYTHON_VERSION=${PYTHON_VERSION:-3.7.5} +MINDSPORE_VERSION=${MINDSPORE_VERSION:-1.5.0} + +cd /tmp +curl -O https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py37_4.10.3-Linux-aarch64.sh +bash Miniconda3-py37_4.10.3-Linux-aarch64.sh -b + +# add conda to PATH +echo -e 'export PATH=~/miniconda3/bin/:$PATH' >> ~/.bash_profile +echo -e '. ~/miniconda3/etc/profile.d/conda.sh' >> ~/.bash_profile +source ~/.bash_profile +conda init bash +# setting up conda mirror +cat >~/.condarc < ${repo_path} << END +[base] +name=EulerOS-2.0SP8 base +baseurl=http://repo.huaweicloud.com/euler/2.8/os/${ARCH} +enabled=1 +gpgcheck=1 +gpgkey=http://repo.huaweicloud.com/euler/2.8/os/RPM-GPG-KEY-EulerOS +END +cat ${repo_path} + +yum clean all +yum makecache + +yum install gmp-devel +yum install + +# install python 3.7 +cd /tmp +wget https://github.com/python/cpython/archive/v3.7.5.tar.gz +tar -xvf v3.7.5.tar.gz +cd /tmp/cpython-3.7.5 +mkdir -p ${PYTHON_ROOT_PATH} +./configure --prefix=${PYTHON_ROOT_PATH} --enable-shared +make -j4 +make install -j4 +rm -f /usr/local/bin/python +rm -f /usr/local/bin/pip +rm -f /usr/local/lib/libpython3.7m.so.1.0 +ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python +ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip +ln -s ${PYTHON_ROOT_PATH}/lib/libpython3.7m.so.1.0 /usr/local/lib/libpython3.7m.so.1.0 +ldconfig +rm -rf /tmp/cpython-3.7.5 +rm -f /tmp/v3.7.5.tar.gz + +pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/${MINDSPORE_VERSION}/MindSpore/ascend/${ARCH}/mindspore-${VERSION}-linux_${ARCH}.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple \ No newline at end of file diff --git a/scripts/install/purge-cuda.sh b/scripts/install/purge-cuda.sh new file mode 100644 index 0000000000000000000000000000000000000000..caaabed5c376146783a40f48c01b6c6bf5994402 --- /dev/null +++ b/scripts/install/purge-cuda.sh @@ -0,0 +1,8 @@ +#!/bin/bash +sudo apt-get --purge remove nvidia-* +sudo apt-get --purge remove cuda-* +sudo apt-get --purge remove cudnn-* +sudo apt-get --purge remove libnvidia-* +sudo apt-get --purge remove libcuda-* +sudo apt-get --purge remove libcudnn-* +sudo apt-get autoremove \ No newline at end of file diff --git a/scripts/install/ubuntu-conda.sh b/scripts/install/ubuntu-conda.sh new file mode 100644 index 0000000000000000000000000000000000000000..10744381ac578706b9b9c28b03fee1a933060d38 --- /dev/null +++ b/scripts/install/ubuntu-conda.sh @@ -0,0 +1,67 @@ +#!/bin/bash +set -ex + +MINDSPORE_VERSION=${MINDSPORE_VERSION:-1.5.0} +PYTHON_VERSION=${PYTHON_VERSION:-3.7.5} + +#use huaweicloud mirror in China +sudo sed -i "s@http://.*archive.ubuntu.com@http://repo.huaweicloud.com@g" /etc/apt/sources.list +sudo sed -i "s@http://.*security.ubuntu.com@http://repo.huaweicloud.com@g" /etc/apt/sources.list +sudo apt-get update + +# install python 3.7 and make it default +sudo apt-get install gcc-7 libgmp-dev curl python3.7 -y +sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 100 + +cd /tmp +curl -O https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py37_4.10.3-Linux-x86_64.sh +bash Miniconda3-py37_4.10.3-Linux-x86_64.sh -b + +# add conda to PATH + echo -e 'export PATH=~/miniconda3/bin/:$PATH' >> ~/.bash_profile + echo -e '. ~/miniconda3/etc/profile.d/conda.sh' >> ~/.bash_profile + source ~/.bash_profile +conda init bash +# setting up conda mirror with qinghua source +cat >~/.condarc < example.py <> ~/.bash_profile +echo -e '. ~/miniconda3/etc/profile.d/conda.sh' >> ~/.bash_profile +source ~/.bash_profile +conda init bash +# setting up conda mirror +cat >~/.condarc <> ~/.bash_profile + +# install mindspore-gpu with conda +conda install mindspore-gpu=${MINDSPORE_VERSION} cudatoolkit=${CUDATOOLKIT_VERSION} -c mindspore -c conda-forge -y + +# check if it is the right mindspore version +python -c "import mindspore;mindspore.run_check()" + +# check if it can be run with GPU + +cat > example.py < ~/.pip/pip.conf <> ~/.bash_profile <> ~/.bash_profile +# echo 'export PATH=$PATH:/usr/local/openmpi/bin' >> ~/.bash_profile +# source ~/.bash_profile +# reference this to install tensorrt https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html#downloading + +echo "install mindspore gpu ${MINDSPORE_VERSION}" +pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/${MINDSPORE_VERSION}/MindSpore/gpu/${ARCH}/${CUDA_INSTALL_PATH}/mindspore_gpu-${version_map["$PYTHON_VERSION"]}-linux_${ARCH}.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple + + +# check if it is the right mindspore version +python -c "import mindspore;mindspore.run_check()" + +# check if it can be run with GPU + +cat > example.py < example.py < ${pkg_name}.tar.gz.sha256 +} + +function ios_release_package() +{ + mkdir -p ${output_path}/release/ios/ + cp ${input_path}/ios_aarch64/*.tar.gz* ${output_path}/release/ios/ + cp ${input_path}/ios_aarch32/*.tar.gz* ${output_path}/release/ios/ +} + +function linux_release_package() +{ + mkdir -p ${output_path}/release/linux/nnie/ + mkdir -p ${output_path}/release/linux/x86_64/ + mkdir -p ${output_path}/release/linux/aarch64/ + mkdir -p ${output_path}/release/linux/ascend/ + + cp ${input_path}/centos_x86/avx/*.tar.gz* ${output_path}/release/linux/x86_64/ + cp ${input_path}/linux_aarch64/*.tar.gz* ${output_path}/release/linux/aarch64/ + cp ${input_path}/centos_x86/ascend/*.tar.gz* ${output_path}/release/linux/ascend/ + + cp -r ${input_path}/linux_aarch32/nnie/Hi* ${output_path}/release/linux/nnie/ + cp -r ${input_path}/linux_aarch64/nnie/Hi* ${output_path}/release/linux/nnie/ + cp ${input_path}/centos_x86/nnie/Hi3516D/*.tar.gz* ${output_path}/release/linux/nnie/ +} + +function windows_release_package() +{ + mkdir -p ${output_path}/release/windows/ + cp ${input_path}/windows_x64/avx/*.zip* ${output_path}/release/windows/ + cp ${input_path}/windows_x32/sse/*.zip* ${output_path}/release/windows/ +} + +function openharmony_release_package() +{ + mkdir -p ${output_path}/release/openharmony/ + cp ${input_path}/ohos_aarch32/*.tar.gz* ${output_path}/release/openharmony/ +} + +echo "============================== begin ==============================" +echo "Usage: bash lite_release_package.sh input_path output_path" + +input_path=$1 +output_path=$2 +version=`ls ${input_path}/android_aarch64/npu/mindspore-lite-*-*.tar.gz | awk -F'/' '{print $NF}' | cut -d"-" -f3` + +android_release_package aarch32 npu +android_release_package aarch32 cpu +android_release_package aarch64 npu +android_release_package aarch64 gpu + +ios_release_package +linux_release_package +windows_release_package +openharmony_release_package + +echo "Create release package success!" +echo "=============================== end ===============================" diff --git a/scripts/map_dump_file_to_code/README_CN.md b/scripts/map_dump_file_to_code/README_CN.md new file mode 100644 index 0000000000000000000000000000000000000000..3881c54d4227ba124640511c7235a50cd24c50c3 --- /dev/null +++ b/scripts/map_dump_file_to_code/README_CN.md @@ -0,0 +1,99 @@ +# 映射数据文件到对应的脚本源码 + +## 文档功能与适用场景 + + 在MindSpore进行计算调试,怀疑遇到精度问题时可以选择dump文件进行对比。此时用户希望知道dump文件夹下的每个数据文件对应的Python源码。 + 本文的主要目的为指导用户使用该工具进行数据文件到python源码的映射。 + 此指导文档适合运行在 **Ascend硬件** 环境下的计算。 + +## 辅助工具使用 + + 1. 使用脚本的3步操作: + - 用户在训练脚本里设置context.set_context(mode=context.GRAPH_MODE, save_graphs=True),进行图文件的保存。 + - 用户开启dump数据功能,参考 + - 获取dump数据文件的op_num,然后通过辅助脚本进行解析。如数据文件:`Default--network-TrainOneStepCell--network-WithLossCell--_backbone- + ResNet--layer2-SequentialCell--0-ResidualBlock--conv2-Conv2d--Cast-op954_input_0_shape_128_128_3_3_kNumberTypeFloat32_DefaultFormat.bin`. + 可观察到Cast-op954,说明该算子的op_num为op954, 如下图所示。 + ![image](./images/op_image.png) + 脚本名: **[map_file_to_code.py](https://gitee.com/mindspore/mindspore/blob/master/scripts/map_dump_file_to_code/map_file_to_code.py)**;   执行方式: + + ```ruby + python3 map_file_to_code.py + --graph_path(-p) [the graph path, default is the current path](option) + --dump_op(-o) [Dump operator id, case insensitive, such as 'op954'.](required) + For example: + python3 map_file_to_code.py -p graph_path -o op954 + ``` + + 2. 解析效果 + 解析文件时通常有2种情况: + ① 匹配时会显示出调用栈过程,需要用户在调用栈中查找自己的源码: + + ```ruby + [INFO] Start to map the dump file to source code. + [INFO] Find operation 'Cast'. + In file /data1/jzg/mindspore/mindspore/nn/layer/conv.py(253)/ + output = self.conv2d(x, self.weight) + In file /data1/jzg/dump_to_code/resnet/scripts/train/src/resnet.py(166)/ + out = self.conv2(out) + In file /data1/jzg/mindspore/mindspore/nn/layer/container.py(173)/ + for cell in self.cell_list: + In file /data1/jzg/dump_to_code/resnet/scripts/train/src/resnet.py(323)/ # 用户代码行 + c3 = self.layer2(c2) + In file /data1/jzg/mindspore/mindspore/train/amp.py(101)/ + out = self._backbone(data) + In file /data1/jzg/mindspore/mindspore/nn/wrap/cell_wrapper.py(247)/ + loss = self.network(*inputs) + In file /data1/jzg/mindspore/mindspore/train/dataset_helper.py(87)/ + return self.network(*outputs) + ``` + + ② 未匹配,在图中未找对应节点的调用栈: + + ```ruby + [INFO] Start to map the dump file to source code. + [WARNING] Cannot find cast's source code in ir file. # 未找到cast算子的信息 + ``` + + 3. 手动代码查找 + 这里还会存在些特殊情况,需要用户进行自行查找。通过将dump的数据文件名中的'--'替换为'/'可获取到算子的full_name, 如下图所示: + ![image](./images/replace_symbol.png) + input和output文件名shape后面的数据为对应算子的输入输出shape信息。然后利用算子的full_name和输入输出信息回到源码中进行对应代码的查找。 + 举个例子说明如何手动在代码中查找指定full_name和shape的算子,例如full_name为: `Default/network/network/aspp/aspp_pooling/ResizeNearestNeighbor`,输入的shape为[8, 256, 1, 1], dtype为float32。 + 可以观察到其scope为: `Default/network/network/aspp/aspp_pooling`,算子名为: `ResizeNearestNeighbor`。注意:scope中会存在Default、network自动填充,Default表示正向,network为网络名。 + 查看以下用户定义的代码,首先我们先分析scope: `Default/network/network/aspp/aspp_pooling`。由network/aspp可定位到算子的定义与调用处分别为26行与31行,继续由`network/aspp/aspp_pooling`,可以定位到定义与调用处分别为4行与8行,然后通过算子名`ResizeNearestNeighbor`可以定位至定义与调用处分别为16行与19行。最后若存在相同scope下存在相同的算子名时,需要通过输入的shape进行进一步判断。 + + ```ruby + 1 class ASPP(nn.Cell): + 2 def __init__(self): + 3 super(ASPP, self).__init__() + 4 self.aspp_pooling = ASPPPooling() + 5 self.drop = nn.Dropout(0.3) + 6 + 7 def construct(self, x): + 8 x = self.aspp_pooling(x) + 9 x = self.drop(x) + 10 return x + 11 + 12 class ASPPPooling(nn.Cell): + 13 def __init__(self): + 14 super(ASPPPooling, self).__init__() + 15 self.shape = P.Shape() + 16 self.resizenearestneighbor = P.ResizeNearestNeighbor((size[2], size[3]), True) + 17 def construct(self, x): + 18 size = self.shape(x) + 19 out = self.resizenearestneighbor(x) + 20 return out + 21 + 22 # 主结构 + 23 class DeepLabV3(nn.Cell): + 24 def __init__(self, phase='train', num_classes=21, output_stride=16, freeze_bn=False): + 25 super(DeepLabV3, self).__init__() + 26 self.aspp = ASPP() + 27 self.shape = P.Shape() + 28 + 29 def construct(self, x): + 30 size = self.shape(x) + 31 out = self.aspp(x) + 32 return out + ``` diff --git a/scripts/map_dump_file_to_code/images/op_image.png b/scripts/map_dump_file_to_code/images/op_image.png new file mode 100644 index 0000000000000000000000000000000000000000..98744c65908e358fd58fef164842e1f3e5002050 Binary files /dev/null and b/scripts/map_dump_file_to_code/images/op_image.png differ diff --git a/scripts/map_dump_file_to_code/images/replace_symbol.png b/scripts/map_dump_file_to_code/images/replace_symbol.png new file mode 100644 index 0000000000000000000000000000000000000000..4af3840918cd17b0d4c0061e80b4ac60b2fc43b7 Binary files /dev/null and b/scripts/map_dump_file_to_code/images/replace_symbol.png differ diff --git a/scripts/map_dump_file_to_code/map_file_to_code.py b/scripts/map_dump_file_to_code/map_file_to_code.py new file mode 100644 index 0000000000000000000000000000000000000000..a81d682e542c24703333741345edc44a05cb92bd --- /dev/null +++ b/scripts/map_dump_file_to_code/map_file_to_code.py @@ -0,0 +1,156 @@ +# Copyright 2020 Huawei Technologies Co., Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================ +"""map_file_to_code""" + +import os +import argparse + + +class ParseIrInfo: + """ + Parse and return the operation info from ir file. + """ + + def __init__(self, ir_file): + self.no_in_file_operation = [] + self.ir_file_path = self.ir_path_parse(ir_file) + self.operation_info_dict = self.ir_info_parse() + + def __len__(self): + return len(self.operation_info_dict) + + def ir_path_parse(self, ir_file): + """ + parse the map file path. + """ + if ir_file == "": + print("[WARNING] No graph_path parameter, use current path as graph path.") + ir_file = os.path.abspath(os.path.dirname(__file__)) + + map_ir_file = "" + file_size = 0 + map_ir_filename = "trace_code_graph" + for filename in os.listdir(os.path.join(ir_file)): + if map_ir_filename not in filename: + continue + tmp_file = os.path.join(ir_file, filename) + tmp_file_size = os.path.getsize(tmp_file) + if tmp_file_size >= file_size: + file_size = tmp_file_size + map_ir_file = tmp_file + if map_ir_file == "": + exit("[ERROR] Please set \"save_graphs=True\" in context to save {} file!".format(map_ir_filename)) + return map_ir_file + + def ir_info_parse(self): + """ + parse the ir file and save code line corresponding to the operator + """ + + all_op_info_dict = {} # recode all operation info + single_op_info_dict = {} # recode single operation info + op_start_char_flag = False # Start operator fragment + op_end_char_flag = False # End of operator fragment + op_start_info_num = 0 # Accumulate the num to recode operation + operation_line = 0 # The line number of the operator + op_start_line_num = 0 # The line number of starting operator information + op_start_info_flag = False # Start operator information + + with open(self.ir_file_path, 'r+') as file: + txt_context_list = file.readlines() + + for line_num, txt_context in enumerate(txt_context_list): + txt_context = txt_context.strip() + # Start operator fragment + if txt_context.endswith(") {"): + op_start_char_flag = True + op_end_char_flag = False + + # End of operator fragment + if txt_context == "}": + op_end_char_flag = True + + # Determine whether it is operator information + if txt_context.startswith("%") and ") = " in txt_context and txt_context[1].isdigit(): + op_start_info_flag = True + op_start_line_num = line_num + op_start_info_num += 1 + single_op_info_dict = {"in_file": []} + + # Judge and start to recode operation info + if op_start_char_flag and not op_end_char_flag and op_start_info_flag and line_num != op_start_line_num: + if "-op" in txt_context and txt_context.split("-op")[-1].split(")")[0].isdigit(): + single_op_info_dict["origin_op_name"] = txt_context.split("-op")[0].split("/")[-1] + single_op_info_dict["op_name"] = txt_context.split("-op")[0].split("/")[-1].lower() + single_op_info_dict["op_num"] = "op" + txt_context.split("-op")[-1].split(")")[0] + operation_line = line_num + if "In file" in txt_context: + in_file_info = txt_context.split("#")[-1].strip().rstrip("/") + single_op_info_dict["in_file"].append(in_file_info) + if line_num - operation_line == 1 and "In file" not in txt_context and "op_num" in single_op_info_dict: + self.no_in_file_operation.append(single_op_info_dict["op_num"]) + op_start_info_flag = False + all_op_info_dict[op_start_info_num] = single_op_info_dict + + return all_op_info_dict + + +class MapOperationToLine: + """ + to show operation info + """ + def __init__(self, dump_op, ir_info_dict): + self.dump_op = dump_op + self.ir_info_dict = ir_info_dict + + def show_operator_info(self): + """ + find operator + """ + origin_dump_op_name = self.dump_op.split("-")[0] + dump_op_name = origin_dump_op_name.lower() + dump_op_num = self.dump_op.split("-")[-1] + for _, op_info in self.ir_info_dict.items(): + if op_info["op_num"] == dump_op_num and op_info["in_file"] is not None: + if dump_op_name in (dump_op_num, op_info["op_name"]): + if not op_info["in_file"]: + print("[WARNING] Cannot find {}'s source code in ir file.".format(op_info["origin_op_name"])) + return False + print("[INFO] Find operation '{}'.".format(op_info["origin_op_name"])) + for line in op_info["in_file"]: + print(" {}".format(line.split(" ")[0])) + print(" {}".format(line.split(" ")[-1])) + return True + print("[WARNING] Cannot find operation {}'s in ir file.".format(origin_dump_op_name)) + return False + + +def start_find(dump_op, map_code_file): + """ + start find error operation in code. + """ + + print("[INFO] Start to map the dump file to source code.") + ir_op_info_dict = ParseIrInfo(map_code_file).operation_info_dict + MapOperationToLine(dump_op, ir_op_info_dict).show_operator_info() + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description='Find the dump operator in the user code') + parser.add_argument('--graph_path', '-p', type=str, default="", help='Save graph files path (option)') + parser.add_argument('--dump_op', '-o', type=str, default="", required=True, + help="Dump operator id, case insensitive, such as 'op3352'.") + args_opt = parser.parse_args() + start_find(args_opt.dump_op, args_opt.graph_path) diff --git a/scripts/run_perf_test.sh b/scripts/run_perf_test.sh new file mode 100755 index 0000000000000000000000000000000000000000..db0b68e043de9e8e94c8d5fd611f80f656d75869 --- /dev/null +++ b/scripts/run_perf_test.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# Copyright 2019 Huawei Technologies Co., Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================ + +set -e + +CURRPATH=$(cd "$(dirname $0)"; pwd) +PROJECT_PATH="${CURRPATH}/.." +PYTHONTEST_DIR="${PROJECT_PATH}/tests/perf_test" +PERF_RESULT_DIR="${CURRPATH}/" +PERF_SUFFIX=".perf" +if [[ "${BUILD_PATH}" ]];then + echo "BUILD_PATH = ${BUILD_PATH}" +else + BUILD_PATH="${PROJECT_PATH}/build" + echo "BUILD_PATH = ${BUILD_PATH}" +fi + +cd "${PROJECT_PATH}"; sh build.sh -t off -l none -r -p on -j 20; cd - + +export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${BUILD_PATH}/third_party/gtest/lib" +export PYTHONPATH="${PYTHONPATH}:${PROJECT_PATH}:${PROJECT_PATH}/tests/ut/python_input" +echo "export PYTHONPATH=${PYTHONPATH}:${PROJECT_PATH}:${PROJECT_PATH}/tests/ut/python_input" + +for f in "${PYTHONTEST_DIR}"/test_*.py +do + target_file="${PERF_RESULT_DIR}$(basename ${f} .py)${PERF_SUFFIX}" + pytest -s "${f}" > "${target_file}" 2>&1 +done diff --git a/scripts/setdotlabelwidth b/scripts/setdotlabelwidth new file mode 100755 index 0000000000000000000000000000000000000000..6094615b059e62d25da38c428fa1a4400404143d --- /dev/null +++ b/scripts/setdotlabelwidth @@ -0,0 +1,102 @@ +#!/usr/bin/env python3 +# encoding: utf-8 +# Copyright 2020 Huawei Technologies Co., Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================ +import sys +import math + +MIN_CHARS_PER_ROW = 20 # minimal number of chars on one line +COLS_TO_ROWS_RATIO = 4 # ratio of # columns to # rows (unit is char) +MAX_LABEL_LENGTH = 1000 # maximal number of chars of a label + + +# for specified number of chars, calculate a suitable number for how many chars per row +# Num Total Chars : n +# Num Chars Per Row : m +# Num Rows : k +# (k - 1) * m < n <= k * m +# suppose: m / k = u +# ==> sqrt(u * n) <= m < u / 2 + sqrt(u * n + u * u / 4) +# m = max(20, m) +# parameters: +# @total_chars number of total chars +# @ratio ratio of # columns to # rows (unit is char) +def calc_num_chars_per_row(total_chars, ratio): + chars_per_row = math.ceil(math.sqrt(total_chars * ratio)) + return max(MIN_CHARS_PER_ROW, chars_per_row) + + +def process_label_text(text): + label_len = min(len(text), MAX_LABEL_LENGTH) + chars_per_row = calc_num_chars_per_row(label_len, COLS_TO_ROWS_RATIO) + if label_len <= MIN_CHARS_PER_ROW: + return text + beg_idx = 0 + texts = [] + while beg_idx < label_len: + end_idx = beg_idx + chars_per_row + if end_idx >= label_len: + texts.append(text[beg_idx:label_len]) + else: + texts.append(text[beg_idx:end_idx]) + beg_idx = end_idx + return "\\n".join(texts) + + +# insert '\n' to labels which are too long +def process_file(f): + line_text = f.readline() + beg_idx = -1 # label begin index, index of 'label="' + end_idx = -1 # label end index, index of '"' + label_text = "" + label_prefix = "" + label_postfix = "" + while line_text: + line_text = line_text.rstrip() + + if beg_idx < 0: + beg_idx = line_text.find('label="') + if beg_idx >= 0: + end_idx = line_text.find('"', beg_idx + len('label="')) + if end_idx >= 0: # the full label text is on one line + label = line_text[beg_idx + len('label="'):end_idx] + print('%slabel="%s"%s' % (line_text[0:beg_idx], process_label_text(label), line_text[end_idx + 1:])) + beg_idx = -1 # reset to initial conditions + else: # the label text is distributed on multiple lines + label_prefix = line_text[0:beg_idx] + label_text = line_text[beg_idx + len('label="'):] + else: + print(line_text) + else: + end_idx = line_text.find('"') + if end_idx >= 0: + label_text = label_text + line_text[0:end_idx] + label_postfix = line_text[end_idx + 1:] + print('%slabel="%s"%s' % (label_prefix, process_label_text(label_text), label_postfix)) + beg_idx = -1 # reset to initial conditions + else: + label_text += line_text + + # print(f'{len(line_text)} - {line_text}') + line_text = f.readline() + + +if __name__ == "__main__": + if len(sys.argv) > 1 and sys.argv[1] == "--help": + print("Usage: %s < dotfile | dot -Tpng -o filename.png" % sys.argv[0]) + sys.exit() + + # read text from stdin + process_file(sys.stdin) diff --git a/scripts/update_onnx_weight.py b/scripts/update_onnx_weight.py new file mode 100755 index 0000000000000000000000000000000000000000..eaff46f61b3bafc13431d6b903dee7bce0b5030e --- /dev/null +++ b/scripts/update_onnx_weight.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python3 +# coding=UTF-8 +# Copyright 2020 Huawei Technologies Co., Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================ +""" +Function: + Use checkpoint file and onnx file as inputs, create a new onnx with Initializer's value from checkpoint file +Usage: + python update_onnx_weight.py onnx_file checkpoint_file [output_file] +""" +import sys +from onnx import onnx_pb +from mindspore.train.serialization import load_checkpoint + + +def update_onnx_initializer(onnx_file, ckpt_file, output_file): + "Update onnx initializer." + with open(onnx_file, 'rb') as f: + data = f.read() + model = onnx_pb.ModelProto() + model.ParseFromString(data) + initializer = model.graph.initializer + param_dict = load_checkpoint(ckpt_file) + + for i, _ in enumerate(initializer): + item = initializer[i] + if not item.name in param_dict: + print(f"Warning: Can not find '{item.name}' in checkpoint parameters dictionary") + continue + weight = param_dict[item.name].data.asnumpy() + bin_data = weight.tobytes() + if len(item.raw_data) != len(bin_data): + print(f"Warning: Size of weight from checkpoint is different from original size, ignore it") + continue + item.raw_data = bin_data + + pb_msg = model.SerializeToString() + with open(output_file, 'wb') as f: + f.write(pb_msg) + + print(f'Graph name: {model.graph.name}') + print(f'Initializer length: {len(initializer)}') + print(f'Checkpoint dict length: {len(param_dict)}') + print(f'The new weights have been written to file {output_file} successfully') + + +def main(): + if len(sys.argv) < 3: + print(f'Usage: {sys.argv[0]} onnx_file checkpoint_file [output_file]') + sys.exit(1) + onnx_file = sys.argv[1] + ckpt_file = sys.argv[2] + output_file = f'new_{onnx_file}' if len(sys.argv) == 3 else sys.argv[3] + update_onnx_initializer(onnx_file, ckpt_file, output_file) + + +if __name__ == '__main__': + main()