mirror of https://github.com/Jittor/Jittor
Merge branch 'master' of https://github.com/Jittor/jittor
This commit is contained in:
commit
6c08f24cff
10
README.cn.md
10
README.cn.md
|
@ -81,9 +81,9 @@ Jittor使用Python和C++编写。 它需要用于即时编译的编译器。当
|
|||
|
||||
* CPU 编译器 (需要下列至少一个)
|
||||
- g++ (>=5.4.0)
|
||||
- clang (>=8.0)推荐
|
||||
- clang (>=8.0)
|
||||
* GPU 编译器(可选)
|
||||
- nvcc(>=10.0)
|
||||
- nvcc (>=10.0 for g++ 或者 >=10.2 for clang)
|
||||
|
||||
Jittor的环境要求如下:
|
||||
|
||||
|
@ -108,10 +108,6 @@ Jittor 一共提供三种方式安装: pip安装, 一键脚本安装 和 手动
|
|||
```bash
|
||||
sudo apt install python3.7-dev libomp-dev
|
||||
sudo python3.7 -m pip install git+https://github.com/Jittor/jittor.git
|
||||
# if you cannot access github, please download code from our website:
|
||||
# wget https://cg.cs.tsinghua.edu.cn/jittor/assets/build/jittor.tgz
|
||||
# mkdir -p jittor && tar -xvf ./jittor.tgz -C jittor
|
||||
# sudo pip install ./jittor
|
||||
python3.7 -m jittor.test.test_example
|
||||
```
|
||||
|
||||
|
@ -155,7 +151,7 @@ wget -O - https://raw.githubusercontent.com/Jittor/jittor/master/script/install.
|
|||
sudo apt install g++ build-essential libomp-dev
|
||||
|
||||
# OR clang++-8
|
||||
wget -O - https://apt.llvm.org/llvm.sh > /tmp/llvm.sh
|
||||
wget -O - https://raw.githubusercontent.com/Jittor/jittor/master/script/install_llvm.sh > /tmp/llvm.sh
|
||||
bash /tmp/llvm.sh 8
|
||||
```
|
||||
|
||||
|
|
10
README.md
10
README.md
|
@ -81,9 +81,9 @@ Jittor is written in Python and C++. It requires a compiler for JIT compilation,
|
|||
|
||||
* CPU compiler (require at least one of the following)
|
||||
* g++ (>=5.4.0)
|
||||
* clang (>=8.0) recommend
|
||||
* clang (>=8.0)
|
||||
* GPU compiler (optional)
|
||||
* nvcc (>=10.0)
|
||||
* nvcc (>=10.0 for g++ or >=10.2 for clang)
|
||||
|
||||
|
||||
|
||||
|
@ -106,10 +106,6 @@ Jittor offers three ways to install: pip, script or manual.
|
|||
```bash
|
||||
sudo apt install python3.7-dev libomp-dev
|
||||
sudo python3.7 -m pip install git+https://github.com/Jittor/jittor.git
|
||||
# if you cannot access github, please download code from our website:
|
||||
# wget https://cg.cs.tsinghua.edu.cn/jittor/assets/build/jittor.tgz
|
||||
# mkdir -p jittor && tar -xvf ./jittor.tgz -C jittor
|
||||
# sudo pip install ./jittor
|
||||
python3.7 -m jittor.test.test_example
|
||||
```
|
||||
|
||||
|
@ -150,7 +146,7 @@ We will show how to install Jittor in Ubuntu 16.04 step by step, Other Linux dis
|
|||
sudo apt install g++ build-essential libomp-dev
|
||||
|
||||
# OR clang++-8
|
||||
wget -O - https://apt.llvm.org/llvm.sh > /tmp/llvm.sh
|
||||
wget -O - https://raw.githubusercontent.com/Jittor/jittor/master/script/install_llvm.sh > /tmp/llvm.sh
|
||||
bash /tmp/llvm.sh 8
|
||||
```
|
||||
### Step 2: Install Python and python-dev
|
||||
|
|
|
@ -100,14 +100,14 @@ Jittor使用Python和C++编写。 它需要用于即时编译的编译器。当
|
|||
|
||||
* CPU compiler (require at least one of the following)
|
||||
* g++ (>=5.4.0)
|
||||
* clang (>=8.0) recommend
|
||||
* clang (>=8.0)
|
||||
* CPU 编译器 (需要下列至少一个)
|
||||
- g++ (>=5.4.0)
|
||||
- clang (>=8.0)推荐
|
||||
- clang (>=8.0)
|
||||
* GPU compiler (optional)
|
||||
* nvcc (>=10.0)
|
||||
* nvcc (>=10.0 for g++ or >=10.2 for clang)
|
||||
* GPU 编译器(可选)
|
||||
- nvcc(>=10.0)
|
||||
- nvcc (>=10.0 for g++ 或者 >=10.2 for clang)
|
||||
|
||||
Jittor的环境要求如下:
|
||||
|
||||
|
@ -139,10 +139,6 @@ Jittor 一共提供三种方式安装: pip安装, 一键脚本安装 和 手动
|
|||
```bash
|
||||
sudo apt install python3.7-dev libomp-dev
|
||||
sudo python3.7 -m pip install git+https://github.com/Jittor/jittor.git
|
||||
# if you cannot access github, please download code from our website:
|
||||
# wget https://cg.cs.tsinghua.edu.cn/jittor/assets/build/jittor.tgz
|
||||
# mkdir -p jittor && tar -xvf ./jittor.tgz -C jittor
|
||||
# sudo pip install ./jittor
|
||||
python3.7 -m jittor.test.test_example
|
||||
```
|
||||
|
||||
|
@ -193,7 +189,7 @@ We will show how to install Jittor in Ubuntu 16.04 step by step, Other Linux dis
|
|||
sudo apt install g++ build-essential libomp-dev
|
||||
|
||||
# OR clang++-8
|
||||
wget -O - https://apt.llvm.org/llvm.sh > /tmp/llvm.sh
|
||||
wget -O - https://raw.githubusercontent.com/Jittor/jittor/master/script/install_llvm.sh > /tmp/llvm.sh
|
||||
bash /tmp/llvm.sh 8
|
||||
```
|
||||
### Step 2: Install Python and python-dev
|
||||
|
|
|
@ -113,6 +113,18 @@ pjmap = {
|
|||
'links': {},
|
||||
'extras': {},
|
||||
},
|
||||
'Dropout2d': {
|
||||
'pytorch': {
|
||||
'args': 'p=0.5, inplace=False',
|
||||
},
|
||||
'jittor': {
|
||||
'module': 'nn',
|
||||
'name': 'Dropout',
|
||||
'args': 'p=0.5, is_train=False'
|
||||
},
|
||||
'links': {},
|
||||
'extras': {},
|
||||
},
|
||||
'kaiming_normal_': {
|
||||
'pytorch': {
|
||||
'args': "tensor, a=0, mode='fan_in', nonlinearity='leaky_relu'",
|
||||
|
@ -240,7 +252,7 @@ unsupport_ops = [
|
|||
'Conv1d', 'Conv3d', 'ConvTranspose1d', 'ConvTranspose3d', 'Unfold', 'Fold',
|
||||
'MaxPool1d', 'MaxPool3d', 'MaxUnpool1d', 'MaxUnpool2d', 'MaxUnpool3d', 'AvgPool1d', 'AvgPool3d', 'FractionalMaxPool2d', 'LPPool1d', 'LPPool2d', 'AdaptiveMaxPool1d', 'AdaptiveMaxPool2d', 'AdaptiveMaxPool3d', 'AdaptiveAvgPool1d', 'AdaptiveAvgPool3d',
|
||||
'ReflectionPad1d', 'ReflectionPad2d', 'ReplicationPad1d', 'ReplicationPad2d', 'ReplicationPad3d', 'ZeroPad2d', 'ConstantPad1d', 'ConstantPad2d', 'ConstantPad3d', 'ELU', 'Hardshrink', 'Hardtanh', 'LogSigmoid', 'MultiheadAttention',
|
||||
'PReLU', 'RReLU', 'SELU', 'CELU', 'GELU', 'Softplus', 'Softshrink', 'Softsign', 'Tanhshrink', 'Threshold', 'Softmin', 'Softmax2d', 'LogSoftmax', 'AdaptiveLogSoftmaxWithLoss', 'BatchNorm1d', 'BatchNorm3d', 'GroupNorm', 'SyncBatchNorm', 'InstanceNorm1d', 'InstanceNorm2d', 'InstanceNorm3d', 'LayerNorm', 'LocalResponseNorm', 'RNNBase', 'RNN', 'LSTM', 'GRU', 'RNNCell', 'LSTMCell', 'GRUCell', 'Transformer', 'TransformerEncoder', 'TransformerDecoder', 'TransformerEncoderLayer', 'TransformerDecoderLayer', 'Identity', 'Bilinear', 'Dropout2d', 'Dropout3d', 'AlphaDropout', 'Embedding', 'EmbeddingBag', 'CosineSimilarity', 'PairwiseDistance', 'L1Loss', 'MSELoss', 'CTCLoss', 'NLLLoss', 'PoissonNLLLoss', 'KLDivLoss', 'BCELoss', 'BCEWithLogitsLoss', 'MarginRankingLoss', 'HingeEmbeddingLoss', 'MultiLabelMarginLoss', 'SmoothL1Loss', 'SoftMarginLoss', 'MultiLabelSoftMarginLoss', 'CosineEmbeddingLoss', 'MultiMarginLoss', 'TripletMarginLoss', 'PixelShuffle', 'Upsample', 'UpsamplingNearest2d', 'UpsamplingBilinear2d', 'DataParallel', 'DistributedDataParallel', 'clip_grad_norm_', 'clip_grad_value_', 'parameters_to_vector', 'vector_to_parameters', 'BasePruningMethod', 'PruningContainer', 'Identity', 'RandomUnstructured', 'L1Unstructured', 'RandomStructured', 'LnStructured', 'CustomFromMask', 'identity', 'random_unstructured', 'l1_unstructured', 'random_structured', 'ln_structured', 'global_unstructured', 'custom_from_mask', 'remove', 'is_pruned', 'weight_norm', 'remove_weight_norm', 'spectral_norm', 'remove_spectral_norm', 'PackedSequence', 'pack_padded_sequence', 'pad_packed_sequence', 'pad_sequence', 'pack_sequence'
|
||||
'PReLU', 'RReLU', 'SELU', 'CELU', 'GELU', 'Softplus', 'Softshrink', 'Softsign', 'Tanhshrink', 'Threshold', 'Softmin', 'Softmax2d', 'LogSoftmax', 'AdaptiveLogSoftmaxWithLoss', 'BatchNorm1d', 'BatchNorm3d', 'GroupNorm', 'SyncBatchNorm', 'InstanceNorm1d', 'InstanceNorm2d', 'InstanceNorm3d', 'LayerNorm', 'LocalResponseNorm', 'RNNBase', 'RNN', 'LSTM', 'GRU', 'RNNCell', 'LSTMCell', 'GRUCell', 'Transformer', 'TransformerEncoder', 'TransformerDecoder', 'TransformerEncoderLayer', 'TransformerDecoderLayer', 'Identity', 'Bilinear', 'Dropout3d', 'AlphaDropout', 'Embedding', 'EmbeddingBag', 'CosineSimilarity', 'PairwiseDistance', 'L1Loss', 'MSELoss', 'CTCLoss', 'NLLLoss', 'PoissonNLLLoss', 'KLDivLoss', 'BCELoss', 'BCEWithLogitsLoss', 'MarginRankingLoss', 'HingeEmbeddingLoss', 'MultiLabelMarginLoss', 'SmoothL1Loss', 'SoftMarginLoss', 'MultiLabelSoftMarginLoss', 'CosineEmbeddingLoss', 'MultiMarginLoss', 'TripletMarginLoss', 'PixelShuffle', 'Upsample', 'UpsamplingNearest2d', 'UpsamplingBilinear2d', 'DataParallel', 'DistributedDataParallel', 'clip_grad_norm_', 'clip_grad_value_', 'parameters_to_vector', 'vector_to_parameters', 'BasePruningMethod', 'PruningContainer', 'Identity', 'RandomUnstructured', 'L1Unstructured', 'RandomStructured', 'LnStructured', 'CustomFromMask', 'identity', 'random_unstructured', 'l1_unstructured', 'random_structured', 'ln_structured', 'global_unstructured', 'custom_from_mask', 'remove', 'is_pruned', 'weight_norm', 'remove_weight_norm', 'spectral_norm', 'remove_spectral_norm', 'PackedSequence', 'pack_padded_sequence', 'pad_packed_sequence', 'pad_sequence', 'pack_sequence'
|
||||
]
|
||||
|
||||
support_ops = {}
|
||||
|
@ -251,7 +263,7 @@ for key in pjmap.keys():
|
|||
support_ops[key] = name
|
||||
|
||||
def raise_unsupport(name):
|
||||
raise RuntimeError(f'{name} is not supported in Jittor yet. We will appreciate it if you provide an implementation of {a.attr} and make pull request at https://github.com/Jittor/jittor.')
|
||||
raise RuntimeError(f'{name} is not supported in Jittor yet. We will appreciate it if you provide an implementation of {name} and make pull request at https://github.com/Jittor/jittor.')
|
||||
|
||||
def replace(a):
|
||||
if hasattr(a, "attr") and a.attr in unsupport_ops:
|
||||
|
|
|
@ -19,7 +19,7 @@ fi
|
|||
|
||||
if [ "$with_clang" = "1" ]; then
|
||||
sudo apt install wget lsb-release software-properties-common -y
|
||||
wget -O - https://apt.llvm.org/llvm.sh > /tmp/llvm.sh
|
||||
wget -O - https://raw.githubusercontent.com/Jittor/jittor/master/script/install_llvm.sh > /tmp/llvm.sh
|
||||
sudo bash /tmp/llvm.sh 8
|
||||
sudo apt-get install libc++-8-dev libc++abi-8-dev -y
|
||||
sudo apt-get install libomp-8-dev -y
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
#!/bin/bash
|
||||
################################################################################
|
||||
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
# See https://llvm.org/LICENSE.txt for license information.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
################################################################################
|
||||
#
|
||||
# This script will install the llvm toolchain on the different
|
||||
# Debian and Ubuntu versions
|
||||
|
||||
set -eux
|
||||
|
||||
# read optional command line argument
|
||||
LLVM_VERSION=8
|
||||
if [ "$#" -eq 1 ]; then
|
||||
LLVM_VERSION=$1
|
||||
fi
|
||||
|
||||
DISTRO=$(lsb_release -is)
|
||||
VERSION=$(lsb_release -sr)
|
||||
DIST_VERSION="${DISTRO}_${VERSION}"
|
||||
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
echo "This script must be run as root!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
declare -A LLVM_VERSION_PATTERNS
|
||||
LLVM_VERSION_PATTERNS[8]="-8"
|
||||
LLVM_VERSION_PATTERNS[9]="-9"
|
||||
LLVM_VERSION_PATTERNS[10]=""
|
||||
|
||||
if [ ! ${LLVM_VERSION_PATTERNS[$LLVM_VERSION]+_} ]; then
|
||||
echo "This script does not support LLVM version $LLVM_VERSION"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
LLVM_VERSION_STRING=${LLVM_VERSION_PATTERNS[$LLVM_VERSION]}
|
||||
|
||||
# find the right repository name for the distro and version
|
||||
case "$DIST_VERSION" in
|
||||
Debian_9* ) REPO_NAME="deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch$LLVM_VERSION_STRING main" ;;
|
||||
Debian_10* ) REPO_NAME="deb http://apt.llvm.org/buster/ llvm-toolchain-buster$LLVM_VERSION_STRING main" ;;
|
||||
Debian_unstable ) REPO_NAME="deb http://apt.llvm.org/unstable/ llvm-toolchain$LLVM_VERSION_STRING main" ;;
|
||||
Debian_testing ) REPO_NAME="deb http://apt.llvm.org/unstable/ llvm-toolchain$LLVM_VERSION_STRING main" ;;
|
||||
Ubuntu_16.04 ) REPO_NAME="deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial$LLVM_VERSION_STRING main" ;;
|
||||
Ubuntu_18.04 ) REPO_NAME="deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic$LLVM_VERSION_STRING main" ;;
|
||||
Ubuntu_18.10 ) REPO_NAME="deb http://apt.llvm.org/cosmic/ llvm-toolchain-cosmic$LLVM_VERSION_STRING main" ;;
|
||||
Ubuntu_19.04 ) REPO_NAME="deb http://apt.llvm.org/disco/ llvm-toolchain-disco$LLVM_VERSION_STRING main" ;;
|
||||
* )
|
||||
echo "Distribution '$DISTRO' in version '$VERSION' is not supported by this script (${DIST_VERSION})."
|
||||
exit 2
|
||||
esac
|
||||
|
||||
|
||||
cat /etc/apt/sources.list
|
||||
# install everything
|
||||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
|
||||
add-apt-repository "${REPO_NAME}"
|
||||
cat /etc/apt/sources.list
|
||||
apt-get update
|
||||
apt-get install -y clang-$LLVM_VERSION lldb-$LLVM_VERSION lld-$LLVM_VERSION clangd-$LLVM_VERSION
|
Loading…
Reference in New Issue