Browse Source

[r1.7] [scripts] check mindspore version

r1.7
xulei 4 years ago
parent
commit
2ac31a9c80
7 changed files with 107 additions and 37 deletions
  1. +16
    -2
      scripts/install/euleros-ascend-conda.sh
  2. +12
    -8
      scripts/install/euleros-ascend-pip.sh
  3. +12
    -8
      scripts/install/euleros-ascend310-pip.sh
  4. +16
    -2
      scripts/install/ubuntu-cpu-conda.sh
  5. +17
    -8
      scripts/install/ubuntu-cpu-pip.sh
  6. +16
    -1
      scripts/install/ubuntu-gpu-conda.sh
  7. +18
    -8
      scripts/install/ubuntu-gpu-pip.sh

+ 16
- 2
scripts/install/euleros-ascend-conda.sh View File

@@ -22,12 +22,12 @@
#
# Augments:
# - PYTHON_VERSION: python version to set up. [3.7(default), 3.8, 3.9]
# - MINDSPORE_VERSION: mindspore version to install
# - MINDSPORE_VERSION: mindspore version to install, >=1.6.0
# - OPENMPI: whether to install optional package Open MPI for distributed training. [on, off(default)]
#
# Usage:
# Run script like `bash ./euleros-ascend-conda.sh`.
# To set augments, run it as `PYTHON_VERSION=3.9 MINDSPORE_VERSION=1.5.0 bash ./euleros-ascend-conda.sh`.
# To set augments, run it as `PYTHON_VERSION=3.9 MINDSPORE_VERSION=1.6.0 bash ./euleros-ascend-conda.sh`.

set -e

@@ -35,12 +35,26 @@ PYTHON_VERSION=${PYTHON_VERSION:-3.7}
MINDSPORE_VERSION=${MINDSPORE_VERSION:-EMPTY}
OPENMPI=${OPENMPI:-off}

version_less() {
test "$(echo "$@" | tr ' ' '\n' | sort -rV | head -n 1)" != "$1";
}

if version_less "${MINDSPORE_VERSION}" "1.6.0"; then
echo "MINDSPORE_VERSION should be >=1.6.0, please check available versions at https://www.mindspore.cn/versions."
exit 1
fi

available_py_version=(3.7 3.8 3.9)
if [[ " ${available_py_version[*]} " != *" $PYTHON_VERSION "* ]]; then
echo "PYTHON_VERSION is '$PYTHON_VERSION', but available versions are [${available_py_version[*]}]."
exit 1
fi

if [[ "$PYTHON_VERSION" == "3.8" && ${MINDSPORE_VERSION:0:3} == "1.6" ]]; then
echo "PYTHON_VERSION==3.8 is not compatible with MINDSPORE_VERSION==1.6.x, please use PYTHON_VERSION==3.7 or 3.9 for MINDSPORE_VERSION==1.6.x."
exit 1
fi

# add value to environment variable if value is not in it
add_env() {
local name=$1


+ 12
- 8
scripts/install/euleros-ascend-pip.sh View File

@@ -22,12 +22,12 @@
#
# Augments:
# - PYTHON_VERSION: python version to set up. [3.7(default), 3.8, 3.9]
# - MINDSPORE_VERSION: mindspore version to install, required
# - MINDSPORE_VERSION: mindspore version to install, >=1.6.0, required
# - OPENMPI: whether to install optional package Open MPI for distributed training. [on, off(default)]
#
# Usage:
# Run script like `MINDSPORE_VERSION=1.6.1 bash ./euleros-ascend-pip.sh`.
# To set augments, run it as `PYTHON_VERSION=3.9 MINDSPORE_VERSION=1.5.0 bash ./euleros-ascend-pip.sh`.
# Run script like `MINDSPORE_VERSION=1.7.0 bash ./euleros-ascend-pip.sh`.
# To set augments, run it as `PYTHON_VERSION=3.9 MINDSPORE_VERSION=1.6.0 bash ./euleros-ascend-pip.sh`.

set -e

@@ -35,8 +35,12 @@ PYTHON_VERSION=${PYTHON_VERSION:-3.7}
MINDSPORE_VERSION=${MINDSPORE_VERSION:-EMPTY}
OPENMPI=${OPENMPI:-off}

if [[ $MINDSPORE_VERSION == "EMPTY" ]]; then
echo "MINDSPORE_VERSION not set, please check available versions at https://www.mindspore.cn/versions."
version_less() {
test "$(echo "$@" | tr ' ' '\n' | sort -rV | head -n 1)" != "$1";
}

if [ $MINDSPORE_VERSION == "EMPTY" ] || version_less "${MINDSPORE_VERSION}" "1.6.0"; then
echo "MINDSPORE_VERSION should be >=1.6.0, please check available versions at https://www.mindspore.cn/versions."
exit 1
fi

@@ -47,9 +51,9 @@ if [[ " ${available_py_version[*]} " != *" $PYTHON_VERSION "* ]]; then
fi

declare -A version_map=()
version_map["3.7"]="${MINDSPORE_VERSION}-cp37-cp37m"
version_map["3.8"]="${MINDSPORE_VERSION}-cp38-cp38"
version_map["3.9"]="${MINDSPORE_VERSION}-cp39-cp39"
version_map["3.7"]="${MINDSPORE_VERSION/-/}-cp37-cp37m"
version_map["3.8"]="${MINDSPORE_VERSION/-/}-cp38-cp38"
version_map["3.9"]="${MINDSPORE_VERSION/-/}-cp39-cp39"

# add value to environment variable if value is not in it
add_env() {


+ 12
- 8
scripts/install/euleros-ascend310-pip.sh View File

@@ -22,11 +22,11 @@
#
# Augments:
# - PYTHON_VERSION: python version to set up. [3.7(default), 3.8, 3.9]
# - MINDSPORE_VERSION: mindspore version to install, required
# - MINDSPORE_VERSION: mindspore version to install, >=1.6.0, required
#
# Usage:
# Run script like `MINDSPORE_VERSION=1.6.1 bash ./euleros-ascend310-pip.sh`.
# To set augments, run it as `PYTHON_VERSION=3.9 MINDSPORE_VERSION=1.5.0 bash ./euleros-ascend310-pip.sh`.
# Run script like `MINDSPORE_VERSION=1.7.0 bash ./euleros-ascend310-pip.sh`.
# To set augments, run it as `PYTHON_VERSION=3.9 MINDSPORE_VERSION=1.6.0 bash ./euleros-ascend310-pip.sh`.

set -e

@@ -34,8 +34,12 @@ PYTHON_VERSION=${PYTHON_VERSION:-3.7}
MINDSPORE_VERSION=${MINDSPORE_VERSION:-EMPTY}
OPENMPI=${OPENMPI:-off}

if [[ $MINDSPORE_VERSION == "EMPTY" ]]; then
echo "MINDSPORE_VERSION not set, please check available versions at https://www.mindspore.cn/versions."
version_less() {
test "$(echo "$@" | tr ' ' '\n' | sort -rV | head -n 1)" != "$1";
}

if [ $MINDSPORE_VERSION == "EMPTY" ] || version_less "${MINDSPORE_VERSION}" "1.6.0"; then
echo "MINDSPORE_VERSION should be >=1.6.0, please check available versions at https://www.mindspore.cn/versions."
exit 1
fi

@@ -46,9 +50,9 @@ if [[ " ${available_py_version[*]} " != *" $PYTHON_VERSION "* ]]; then
fi

declare -A version_map=()
version_map["3.7"]="${MINDSPORE_VERSION}-cp37-cp37m"
version_map["3.8"]="${MINDSPORE_VERSION}-cp38-cp38"
version_map["3.9"]="${MINDSPORE_VERSION}-cp39-cp39"
version_map["3.7"]="${MINDSPORE_VERSION/-/}-cp37-cp37m"
version_map["3.8"]="${MINDSPORE_VERSION/-/}-cp38-cp38"
version_map["3.9"]="${MINDSPORE_VERSION/-/}-cp39-cp39"

# add value to environment variable if value is not in it
add_env() {


+ 16
- 2
scripts/install/ubuntu-cpu-conda.sh View File

@@ -24,23 +24,37 @@
#
# Augments:
# - PYTHON_VERSION: python version to set up. [3.7(default), 3.8, 3.9]
# - MINDSPORE_VERSION: mindspore version to install
# - MINDSPORE_VERSION: mindspore version to install, >=1.6.0
#
# Usage:
# Run script like `bash ./ubuntu-cpu-conda.sh`.
# To set augments, run it as `PYTHON_VERSION=3.9 MINDSPORE_VERSION=1.5.0 bash ./ubuntu-cpu-conda.sh`.
# To set augments, run it as `PYTHON_VERSION=3.9 MINDSPORE_VERSION=1.6.0 bash ./ubuntu-cpu-conda.sh`.

set -e

PYTHON_VERSION=${PYTHON_VERSION:-3.7}
MINDSPORE_VERSION=${MINDSPORE_VERSION:-EMPTY}

version_less() {
test "$(echo "$@" | tr ' ' '\n' | sort -rV | head -n 1)" != "$1";
}

if version_less "${MINDSPORE_VERSION}" "1.6.0"; then
echo "MINDSPORE_VERSION should be >=1.6.0, please check available versions at https://www.mindspore.cn/versions."
exit 1
fi

available_py_version=(3.7 3.8 3.9)
if [[ " ${available_py_version[*]} " != *" $PYTHON_VERSION "* ]]; then
echo "PYTHON_VERSION is '$PYTHON_VERSION', but available versions are [${available_py_version[*]}]."
exit 1
fi

if [[ "$PYTHON_VERSION" == "3.8" && ${MINDSPORE_VERSION:0:3} == "1.6" ]]; then
echo "PYTHON_VERSION==3.8 is not compatible with MINDSPORE_VERSION==1.6.x, please use PYTHON_VERSION==3.7 or 3.9 for MINDSPORE_VERSION==1.6.x."
exit 1
fi

install_conda() {
conda_file_name="Miniconda3-py3${PYTHON_VERSION##*.}_4.10.3-Linux-$(arch).sh"
cd /tmp


+ 17
- 8
scripts/install/ubuntu-cpu-pip.sh View File

@@ -24,19 +24,23 @@
#
# Augments:
# - PYTHON_VERSION: python version to install. [3.7(default), 3.8, 3.9]
# - MINDSPORE_VERSION: mindspore version to install, required
# - MINDSPORE_VERSION: mindspore version to install, >=1.6.0, required
#
# Usage:
# Run script like `MINDSPORE_VERSION=1.6.1 bash ./ubuntu-cpu-pip.sh`.
# To set augments, run it as `PYTHON_VERSION=3.9 MINDSPORE_VERSION=1.5.0 bash ./ubuntu-cpu-pip.sh`.
# Run script like `MINDSPORE_VERSION=1.7.0 bash ./ubuntu-cpu-pip.sh`.
# To set augments, run it as `PYTHON_VERSION=3.9 MINDSPORE_VERSION=1.6.0 bash ./ubuntu-cpu-pip.sh`.

set -e

PYTHON_VERSION=${PYTHON_VERSION:-3.7}
MINDSPORE_VERSION=${MINDSPORE_VERSION:-EMPTY}

if [[ $MINDSPORE_VERSION == "EMPTY" ]]; then
echo "MINDSPORE_VERSION not set, please check available versions at https://www.mindspore.cn/versions."
version_less() {
test "$(echo "$@" | tr ' ' '\n' | sort -rV | head -n 1)" != "$1";
}

if [ $MINDSPORE_VERSION == "EMPTY" ] || version_less "${MINDSPORE_VERSION}" "1.6.0"; then
echo "MINDSPORE_VERSION should be >=1.6.0, please check available versions at https://www.mindspore.cn/versions."
exit 1
fi

@@ -46,10 +50,15 @@ if [[ " ${available_py_version[*]} " != *" $PYTHON_VERSION "* ]]; then
exit 1
fi

if [[ "$PYTHON_VERSION" == "3.8" && ${MINDSPORE_VERSION:0:3} == "1.6" ]]; then
echo "PYTHON_VERSION==3.8 is not compatible with MINDSPORE_VERSION==1.6.x, please use PYTHON_VERSION==3.7 or 3.9 for MINDSPORE_VERSION==1.6.x."
exit 1
fi

declare -A version_map=()
version_map["3.7"]="${MINDSPORE_VERSION}-cp37-cp37m"
version_map["3.8"]="${MINDSPORE_VERSION}-cp38-cp38"
version_map["3.9"]="${MINDSPORE_VERSION}-cp39-cp39"
version_map["3.7"]="${MINDSPORE_VERSION/-/}-cp37-cp37m"
version_map["3.8"]="${MINDSPORE_VERSION/-/}-cp38-cp38"
version_map["3.9"]="${MINDSPORE_VERSION/-/}-cp39-cp39"

# use huaweicloud mirror in China
sudo sed -i "s@http://.*archive.ubuntu.com@http://repo.huaweicloud.com@g" /etc/apt/sources.list


+ 16
- 1
scripts/install/ubuntu-gpu-conda.sh View File

@@ -25,7 +25,7 @@
#
# Augments:
# - PYTHON_VERSION: python version to install. [3.7(default), 3.8, 3.9]
# - MINDSPORE_VERSION: mindspore version to install
# - MINDSPORE_VERSION: mindspore version to install, >=1.6.0
# - CUDA_VERSION: CUDA version to install. [10.1, 11.1(default)]
# - OPENMPI: whether to install optional package Open MPI for distributed training. [on, off(default)]
#
@@ -40,11 +40,26 @@ MINDSPORE_VERSION=${MINDSPORE_VERSION:-EMPTY}
CUDA_VERSION=${CUDA_VERSION:-11.1}
OPENMPI=${OPENMPI:-off}

version_less() {
test "$(echo "$@" | tr ' ' '\n' | sort -rV | head -n 1)" != "$1";
}

if version_less "${MINDSPORE_VERSION}" "1.6.0"; then
echo "MINDSPORE_VERSION should be >=1.6.0, please check available versions at https://www.mindspore.cn/versions."
exit 1
fi

available_py_version=(3.7 3.8 3.9)
if [[ " ${available_py_version[*]} " != *" $PYTHON_VERSION "* ]]; then
echo "PYTHON_VERSION is '$PYTHON_VERSION', but available versions are [${available_py_version[*]}]."
exit 1
fi

if [[ "$PYTHON_VERSION" == "3.8" && ${MINDSPORE_VERSION:0:3} == "1.6" ]]; then
echo "PYTHON_VERSION==3.8 is not compatible with MINDSPORE_VERSION==1.6.x, please use PYTHON_VERSION==3.7 or 3.9 for MINDSPORE_VERSION==1.6.x."
exit 1
fi

available_cuda_version=(10.1 11.1)
if [[ " ${available_cuda_version[*]} " != *" $CUDA_VERSION "* ]]; then
echo "CUDA_VERSION is '$CUDA_VERSION', but available versions are [${available_cuda_version[*]}]."


+ 18
- 8
scripts/install/ubuntu-gpu-pip.sh View File

@@ -26,13 +26,13 @@
#
# Augments:
# - PYTHON_VERSION: python version to install. [3.7(default), 3.8, 3.9]
# - MINDSPORE_VERSION: mindspore version to install, required
# - MINDSPORE_VERSION: mindspore version to install, >=1.6.0, required
# - CUDA_VERSION: CUDA version to install. [10.1, 11.1(default)]
# - OPENMPI: whether to install optional package Open MPI for distributed training. [on, off(default)]
#
# Usage:
# Run script like `MINDSPORE_VERSION=1.6.1 bash -i ./ubuntu-gpu-pip.sh`.
# To set augments, run it as `MINDSPORE_VERSION=1.5.0 CUDA_VERSION=10.1 OPENMPI=on bash -i ./ubuntu-gpu-pip.sh`.
# Run script like `MINDSPORE_VERSION=1.7.0 bash -i ./ubuntu-gpu-pip.sh`.
# To set augments, run it as `MINDSPORE_VERSION=1.6.0 CUDA_VERSION=10.1 OPENMPI=on bash -i ./ubuntu-gpu-pip.sh`.

set -e

@@ -41,8 +41,12 @@ MINDSPORE_VERSION=${MINDSPORE_VERSION:EMPTY}
CUDA_VERSION=${CUDA_VERSION:-11.1}
OPENMPI=${OPENMPI:-off}

if [[ $MINDSPORE_VERSION == "EMPTY" ]]; then
echo "MINDSPORE_VERSION not set, please check available versions at https://www.mindspore.cn/versions."
version_less() {
test "$(echo "$@" | tr ' ' '\n' | sort -rV | head -n 1)" != "$1";
}

if [ $MINDSPORE_VERSION == "EMPTY" ] || version_less "${MINDSPORE_VERSION}" "1.6.0"; then
echo "MINDSPORE_VERSION should be >=1.6.0, please check available versions at https://www.mindspore.cn/versions."
exit 1
fi

@@ -51,6 +55,12 @@ if [[ " ${available_py_version[*]} " != *" $PYTHON_VERSION "* ]]; then
echo "PYTHON_VERSION is '$PYTHON_VERSION', but available versions are [${available_py_version[*]}]."
exit 1
fi

if [[ "$PYTHON_VERSION" == "3.8" && ${MINDSPORE_VERSION:0:3} == "1.6" ]]; then
echo "PYTHON_VERSION==3.8 is not compatible with MINDSPORE_VERSION==1.6.x, please use PYTHON_VERSION==3.7 or 3.9 for MINDSPORE_VERSION==1.6.x."
exit 1
fi

available_cuda_version=(10.1 11.1)
if [[ " ${available_cuda_version[*]} " != *" $CUDA_VERSION "* ]]; then
echo "CUDA_VERSION is '$CUDA_VERSION', but available versions are [${available_cuda_version[*]}]."
@@ -68,9 +78,9 @@ fi
cuda_name="cuda-$CUDA_VERSION"

declare -A version_map=()
version_map["3.7"]="${MINDSPORE_VERSION}-cp37-cp37m"
version_map["3.8"]="${MINDSPORE_VERSION}-cp38-cp38"
version_map["3.9"]="${MINDSPORE_VERSION}-cp39-cp39"
version_map["3.7"]="${MINDSPORE_VERSION/-/}-cp37-cp37m"
version_map["3.8"]="${MINDSPORE_VERSION/-/}-cp38-cp38"
version_map["3.9"]="${MINDSPORE_VERSION/-/}-cp39-cp39"

# add value to environment variable if value is not in it
add_env() {


Loading…
Cancel
Save