mirror of https://github.com/Jittor/Jittor
polish readme and add test
This commit is contained in:
parent
2e6c6079cb
commit
752a5c62ed
41
README.cn.md
41
README.cn.md
|
@ -88,21 +88,23 @@ for i,(x,y) in enumerate(get_data(n)):
|
|||
|
||||
Jittor框架对环境要求如下:
|
||||
|
||||
|
||||
* 操作系统: **Linux**(e.g. Ubuntu/CentOS/Arch), **macOS**(x86_64)或 **Windows Subsystem of Linux(WSL)**
|
||||
Jittor 支持**Linux**(e.g. Ubuntu/CentOS/Arch), **macOS**,**Windows**, 其中**Linux**和**macOS**的依赖如下:
|
||||
* Python:版本 >= 3.7
|
||||
* C++编译器 (需要下列至少一个)
|
||||
- g++ (>=5.4.0)
|
||||
- clang (>=8.0)
|
||||
- g++ (>=5.4.0 for linux)
|
||||
- clang (>=8.0 for mac)
|
||||
* GPU 编译器(可选):nvcc >=10.0
|
||||
* GPU 加速库(可选):cudnn-dev (cudnn开发版, 推荐使用tar安装方法,[参考链接](https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html#installlinux-tar))
|
||||
|
||||
**Windows**对环境的要求为:
|
||||
* Python:版本 >= 3.8
|
||||
* x86_64处理器
|
||||
* Windows 10及以上。
|
||||
|
||||
如果您不希望手动配置环境,我们推荐使用 Docker 进行安装。
|
||||
除此之外,您还可以使用 pip 安装和手动安装。
|
||||
|
||||
注意1:目前Jittor通过WSL的方式在Windows操作系统上运行,WSL的安装方法请参考[微软官网](https://docs.microsoft.com/en-us/windows/wsl/install-win10),WSL版本目前尚不支持CUDA。
|
||||
|
||||
注意2:macOS 用户需要安装额外依赖,请参考 [macOS 安装](#macOS-安装)。
|
||||
注意1:macOS 用户需要安装额外依赖,请参考 [macOS 安装](#macOS-安装)。
|
||||
|
||||
Jittor 提供了三种安装方法:docker,pip和手动安装:
|
||||
|
||||
|
@ -115,6 +117,8 @@ Jittor 提供了三种安装方法:docker,pip和手动安装:
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
## Docker 安装
|
||||
|
||||
我们提供了Docker安装方式,免去您配置环境,Docker安装方法如下:
|
||||
|
@ -169,6 +173,27 @@ python3.7 -m jittor.test.test_example
|
|||
目前在macOS中,jittor 只支持 CPU 计算。
|
||||
|
||||
|
||||
## Windows安装
|
||||
|
||||
Windows 请准备好Python>=3.8,安装方法如下(conda安装需要额外命令):
|
||||
|
||||
Windows user please prepare Python>=3.8, install instructions are list below(conda needs extra instructions):
|
||||
|
||||
```bash
|
||||
# check your python version(>=3.8)
|
||||
python --version
|
||||
python -m pip install jittor
|
||||
# if conda is used
|
||||
conda install pywin32
|
||||
```
|
||||
|
||||
Windows 下,jittor会自动检测显卡并安装对应的 CUDA, 请确保您的NVIDIA驱动支持CUDA 10.2 以上,您还可以使用如下命令手动为Jittor安装CUDA:
|
||||
|
||||
|
||||
```bash
|
||||
python -m jittor_utils.install_cuda
|
||||
```
|
||||
|
||||
## 手动安装
|
||||
|
||||
|
||||
|
@ -395,7 +420,7 @@ Jittor目前由[清华大学计算机图形学组](https://cg.cs.tsinghua.edu.cn
|
|||
@article{hu2020jittor,
|
||||
title={Jittor: a novel deep learning framework with meta-operators and unified graph execution},
|
||||
author={Hu, Shi-Min and Liang, Dun and Yang, Guo-Ye and Yang, Guo-Wei and Zhou, Wen-Yang},
|
||||
journal={Information Sciences},
|
||||
journal={Science China Information Sciences},
|
||||
volume={63},
|
||||
number={222103},
|
||||
pages={1--21},
|
||||
|
|
30
README.md
30
README.md
|
@ -92,10 +92,10 @@ We provide some jupyter notebooks to help you quick start with Jittor.
|
|||
|
||||
|
||||
|
||||
|
||||
Jittor environment requirements:
|
||||
|
||||
* System: **Linux**(e.g. Ubuntu/CentOS/Arch), **macOS**, or **Windows Subsystem of Linux (WSL)**
|
||||
* System: **Linux**(e.g. Ubuntu/CentOS/Arch), **macOS**, or **Windows**, enviroment requirements of **Linux** and **Mac** are list below:
|
||||
|
||||
* Python version >= 3.7
|
||||
* CPU compiler (require at least one of the following)
|
||||
* g++ (>=5.4.0)
|
||||
|
@ -105,10 +105,14 @@ Jittor environment requirements:
|
|||
* GPU library: cudnn-dev (recommend tar file installation, [reference link](https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html#installlinux-tar))
|
||||
|
||||
|
||||
**Windows** requirements atr:
|
||||
|
||||
Note#1: Currently Jittor runs on the Windows operating system through WSL. For the installation method of WSL, please refer to [Microsoft official website](https://docs.microsoft.com/en-us/windows/wsl/install-win10). WSL does not yet support CUDA.
|
||||
* Python: version >= 3.8
|
||||
* x86_64 CPU processor
|
||||
* Windows 10 or above
|
||||
|
||||
Note#2: macOS users have to install additional dependencies, see [macOS install](#macOS-install).
|
||||
|
||||
Note#1: macOS users have to install additional dependencies, see [macOS install](#macOS-install).
|
||||
|
||||
Jittor offers three ways to install: docker, pip, or manual.
|
||||
|
||||
|
@ -163,6 +167,24 @@ python3.7 -m jittor.test.test_example
|
|||
|
||||
Currently jittor only supports CPU in macOS.
|
||||
|
||||
|
||||
|
||||
|
||||
```bash
|
||||
# check your python version(>=3.8)
|
||||
python --version
|
||||
python -m pip install jittor
|
||||
# if conda is used
|
||||
conda install pywin32
|
||||
```
|
||||
|
||||
|
||||
In Windows, jittor will automatically detect and install CUDA, please make sure your NVIDIA driver support CUDA 10.2 or above, or you can manually let jittor install CUDA for you:
|
||||
|
||||
```bash
|
||||
python -m jittor_utils.install_cuda
|
||||
```
|
||||
|
||||
## manual install
|
||||
|
||||
We will show how to install Jittor in Ubuntu 16.04 step by step, Other Linux distributions may have similar commands.
|
||||
|
|
|
@ -134,7 +134,8 @@ Jittor 提供了三种安装方法:docker,pip和手动安装:
|
|||
|
||||
Jittor environment requirements:
|
||||
|
||||
* System: **Linux**(e.g. Ubuntu/CentOS/Arch), **macOS**, or **Windows Subsystem of Linux (WSL)**
|
||||
* System: **Linux**(e.g. Ubuntu/CentOS/Arch), **macOS**, or **Windows**, enviroment requirements of **Linux** and **Mac** are list below:
|
||||
|
||||
* Python version >= 3.7
|
||||
* CPU compiler (require at least one of the following)
|
||||
* g++ (>=5.4.0)
|
||||
|
@ -144,6 +145,13 @@ Jittor environment requirements:
|
|||
* GPU library: cudnn-dev (recommend tar file installation, [reference link](https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html#installlinux-tar))
|
||||
|
||||
|
||||
**Windows** requirements atr:
|
||||
|
||||
* Python: version >= 3.8
|
||||
* x86_64 CPU processor
|
||||
* Windows 10 or above
|
||||
|
||||
|
||||
Note#1: macOS users have to install additional dependencies, see [macOS install](#macOS-install).
|
||||
|
||||
Jittor offers three ways to install: docker, pip, or manual.
|
||||
|
@ -215,6 +223,8 @@ Currently jittor only supports CPU in macOS.
|
|||
|
||||
Windows 请准备好Python>=3.8,安装方法如下(conda安装需要额外命令):
|
||||
|
||||
Windows user please prepare Python>=3.8, install instructions are list below(conda needs extra instructions):
|
||||
|
||||
```bash
|
||||
# check your python version(>=3.8)
|
||||
python --version
|
||||
|
@ -225,6 +235,8 @@ conda install pywin32
|
|||
|
||||
Windows 下,jittor会自动检测显卡并安装对应的 CUDA, 请确保您的NVIDIA驱动支持CUDA 10.2 以上,您还可以使用如下命令手动为Jittor安装CUDA:
|
||||
|
||||
In Windows, jittor will automatically detect and install CUDA, please make sure your NVIDIA driver support CUDA 10.2 or above, or you can manually let jittor install CUDA for you:
|
||||
|
||||
```bash
|
||||
python -m jittor_utils.install_cuda
|
||||
```
|
||||
|
@ -518,7 +530,7 @@ Jittor目前由[清华大学计算机图形学组](https://cg.cs.tsinghua.edu.cn
|
|||
@article{hu2020jittor,
|
||||
title={Jittor: a novel deep learning framework with meta-operators and unified graph execution},
|
||||
author={Hu, Shi-Min and Liang, Dun and Yang, Guo-Ye and Yang, Guo-Wei and Zhou, Wen-Yang},
|
||||
journal={Information Sciences},
|
||||
journal={Science China Information Sciences},
|
||||
volume={63},
|
||||
number={222103},
|
||||
pages={1--21},
|
||||
|
|
|
@ -36,7 +36,7 @@ template<class T> struct StackIniter {
|
|||
|
||||
#define STACK_ALLOC2(T, a, n) T* a = (T*)_alloca(sizeof(T)*(n)); StackIniter<T> __init_##a(a, n);
|
||||
#else
|
||||
#define STACK_ALLOC2(T, a, n) T* a = (T*)_alloca(sizeof(T)*(n))
|
||||
#define STACK_ALLOC2(T, a, n) T a[n]
|
||||
#endif
|
||||
|
||||
VarPtr make_grad(Op* op, Var* out, Var* dout, Var* x, int x_index) {
|
||||
|
|
|
@ -16,6 +16,18 @@ class TestFuser(unittest.TestCase):
|
|||
c = (a * b).sum() + (a + 1)
|
||||
print(c)
|
||||
|
||||
def test_wrong_fuse2(self):
|
||||
a = jt.array([1])
|
||||
b = jt.random([10,])
|
||||
c = jt.random([100,])
|
||||
bb = a*b
|
||||
cc = a*c
|
||||
jt.sync([bb,cc])
|
||||
np.testing.assert_allclose(b.data, bb.data)
|
||||
np.testing.assert_allclose(c.data, cc.data)
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
|
@ -4,6 +4,7 @@ from pathlib import Path
|
|||
dirname = os.path.dirname(__file__)
|
||||
|
||||
jittor_root = os.path.join(dirname, "..", "..")
|
||||
print(jittor_root)
|
||||
|
||||
all_src_md = []
|
||||
|
||||
|
|
Loading…
Reference in New Issue