近日,Facebook发布了PyTorch 1.8新版本。自1.7版以来,此版本包含3,000多次提交。它包括众多更新和优化:编译,代码优化,用于科学计算的前端API,以及通过pytorch.org提供的二进制文件对AMD ROCm的支持。它还为管道和模型并行性以及梯度压缩的大规模训练提供了改进的功能。几个重大更新包括:
- torch.fx:一个可以用于操作 nn.Module实例的工具,它可以改变其中的operations,比如新增一个op, FX包含三个重要部分:a symbolic tracer, an intermediate representation, and Python code generation。更多内容可以阅读文档:https://pytorch.org/docs/stable/fx.html。
- torch.fft:支持FFTs,torch.linalg:支持和numpy类似的线性代数库;
- 分布式训练优化:Improved NCCL reliability; Pipeline parallelism support; RPC profiling; and support for communication hooks adding gradient compression.
更多更新详情见:https://pytorch.org/blog/pytorch-1.8-released/,目前官方1.8版本支持cuda10.2和cuda11.1两个版本,默认是cuda10.2:
伴随着PyTorch1.8版本的更新,同步更新的还有其它Torch库:
- TorchVision - Added support for PyTorch Mobile including Detectron2Go (D2Go), auto-augmentation of data during training, on the fly type conversion, and AMP autocasting.
- TorchAudio - Major improvements to I/O, including defaulting to sox_io backend and file-like object support. Added Kaldi Pitch feature and support for CMake based build allowing TorchAudio to better support no-Python environments.
- TorchText - Updated the dataset loading API to be compatible with standard PyTorch data loading utilities.
- TorchCSPRNG - Support for cryptographically secure pseudorandom number generators for PyTorch is now stable with new APIs for AES128 ECB/CTR and CUDA support on Windows.
其中torchvision最新版本为0.9.0,新增了MobileNetV3 模型,支持数据增强
AutoAugment,支持on-the-fly image type conversions,还有最重要的更新是对移动端的支持,重点发布了Detectron2Go (D2Go)库,其支持目标检测库落地到移动端,比如发布到安卓app上:
https://github.com/pytorch/android-demo-app/tree/master/D2Go
D2GO库继承了detectron2的风格,但是更多的是推动目标检测在移动端的落地,目前的D2GO的backbone是FB提出的fbnet,在D2GO项目中也给出了训练DETR和Deformable DETR,更多见github仓库:
https://github.com/facebookresearch/d2go/tree/master/projects_oss/detr
[ 完 ]