MSAdapter
简体中文 | [English]
Introduction
MSAdapter is MindSpore tool for adapting the PyTorch interface, which is designed to make PyTorch code perform efficiently on Ascend without changing the habits of the original PyTorch users.
- PyTorch interface support: MSAdapter aims to support the original expression of PyTorch syntax, users just need to replace
import torch
in PyTorch source code with import msadapter.pytorch
to realize that the model can support training on ascending. The support status of the higher-order APIs used in the model can be found here Supported List.
- PyTorch interface support scope: MSAdapter is currently mainly adapted to PyTorch data processing and model structure part of the code, currently fully supports MindSpore's PYNATIVE mode training, part of the network structure support GRAPH mode training.
- TorchVision interface support: MSAdapter TorchVision is a computer vision tool library migrated from PyTorch's official implementation. It continues to use PyTorch's official api design, and calls
MindSpore
operators for calculations to achieve the same functions as the original torchvision
library. Users only need to replace import torchvision
in the PyTorch source code with import msadapter.torchvision
.
TorchVision support status can be found from here TorchVision Supported List
Install
Please check the Version Description to select the required version of MSAdapter and MindSpore.
Install MindSpore
Please install MindSpore according to the Installation Guide on MindSpore official website.
Install MSAdapter
via pip
pip install msadapter
via source code
git clone https://git.openi.org.cn/OpenI/MSAdapter.git
cd MSAdapter
python setup.py install
If there is an insufficient permissions message, install as follows
python setup.py install --user || exit 1
User guide
Refer to the User Guide, you will quickly get started and complete the transformation from PyTorch code, as well as get started with various advanced optimization skills; More over, if you have requirements for precision and performance tuning, please refer to the Debugging and Tuning Guide.
Resources
- Model library: MSAdapter supports rich deep learning applications, migration to MSAdapter models from the official PyTorch code is given here. Model Resources.
Version Description
On Going and Future Work
- More APIs of torch will be supported.
- Datasets APIs of torchaudio will be supported.
- Performance optimization.
Contributing
Developers are welcome to contribute. For more details, please see our Contribution Guidelines.
License
Apache License 2.0