This commit is contained in:
Jiahang Xu 2022-09-09 18:08:33 +08:00 коммит произвёл GitHub
Родитель 66e2f93855
Коммит 28af7704b5
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -28,14 +28,14 @@ jobs:
path: | path: |
~/.nn_meter ~/.nn_meter
/home/runner/work/nn-Meter/data/testmodels /home/runner/work/nn-Meter/data/testmodels
key: ${{hashFiles('nn_meter/configs/predictors.yaml')}}-${{hashFiles('tests/integration_test/test_latency_predictor.py')}} key: ${{hashFiles('nn_meter/configs/predictors.yaml')}}--${{hashFiles('tests/integration_test/test_latency_predictor.py')}}
- name: Install dependencies - name: Install dependencies
run: | run: |
pip install onnx==1.9.0 pip install onnx==1.9.0
pip install torch==1.9.0 pip install torch==1.9.0
pip install torchvision==0.10.0 pip install torchvision==0.10.0
pip install onnx-simplifier pip install onnx-simplifier==0.3.6
- name: Install nn-Meter - name: Install nn-Meter
run: pip install -U . run: pip install -U .

Просмотреть файл

@ -48,7 +48,7 @@ nn-Meter is a latency predictor of models with type of Tensorflow, PyTorch, Onnx
| Testing Model Type | Requirements | | Testing Model Type | Requirements |
| :----------------: | :-----------------------------------------------------------------------------------------------------------------------: | | :----------------: | :-----------------------------------------------------------------------------------------------------------------------: |
| Tensorflow | `tensorflow==2.6.0` | | Tensorflow | `tensorflow==2.6.0` |
| Torch | `torch==1.9.0`, `torchvision==0.10.0`, (alternative)[`onnx==1.9.0`, `onnx-simplifier==0.3.6`] or [`nni>=2.4`][1] | | Torch | `torch==1.9.0`, `torchvision==0.10.0`, (alternative)[`onnx>=1.9.0`, `onnx-simplifier==0.3.6`] or [`nni>=2.4`][1] |
| Onnx | `onnx==1.9.0` | | Onnx | `onnx==1.9.0` |
| nn-Meter IR graph | --- | | nn-Meter IR graph | --- |
| NNI IR graph | `nni>=2.4` | | NNI IR graph | `nni>=2.4` |

Просмотреть файл

@ -29,7 +29,7 @@ def model_file_to_graph(filename: str, model_type: str, input_shape=(1, 3, 224,
apply_nni: switch the torch converter used for torch model parsing. If apply_nni==True, NNI-based converter is used for torch model conversion, which requires apply_nni: switch the torch converter used for torch model parsing. If apply_nni==True, NNI-based converter is used for torch model conversion, which requires
nni>=2.4 installation and should use nn interface from NNI `import nni.retiarii.nn.pytorch as nn` to define the PyTorch modules. Otherwise Onnx-based torch nni>=2.4 installation and should use nn interface from NNI `import nni.retiarii.nn.pytorch as nn` to define the PyTorch modules. Otherwise Onnx-based torch
converter is used, which requires onnx installation (well tested version is onnx==1.9.0). NNI-based converter is much faster while the conversion is unstable converter is used, which requires onnx installation (well tested version is onnx>=1.9.0). NNI-based converter is much faster while the conversion is unstable
as it could fail in some case. Onnx-based converter is much slower but stable compared to NNI-based converter. This parameter is only accessed when as it could fail in some case. Onnx-based converter is much slower but stable compared to NNI-based converter. This parameter is only accessed when
model_type == 'torch' model_type == 'torch'
""" """

Просмотреть файл

@ -97,7 +97,7 @@ class nnMeterPredictor:
apply_nni: switch the torch converter used for torch model parsing. If apply_nni==True, NNI-based converter is used for torch model conversion, which requires apply_nni: switch the torch converter used for torch model parsing. If apply_nni==True, NNI-based converter is used for torch model conversion, which requires
nni>=2.4 installation and should use nn interface from NNI `import nni.retiarii.nn.pytorch as nn` to define the PyTorch modules. Otherwise Onnx-based torch nni>=2.4 installation and should use nn interface from NNI `import nni.retiarii.nn.pytorch as nn` to define the PyTorch modules. Otherwise Onnx-based torch
converter is used, which requires onnx installation (well tested version is onnx==1.9.0). NNI-based converter is much faster while the conversion is unstable converter is used, which requires onnx installation (well tested version is onnx>=1.9.0). NNI-based converter is much faster while the conversion is unstable
as it could fail in some case. Onnx-based converter is much slower but stable compared to NNI-based converter. This parameter is only accessed when as it could fail in some case. Onnx-based converter is much slower but stable compared to NNI-based converter. This parameter is only accessed when
model_type == 'torch' model_type == 'torch'
""" """

Просмотреть файл

@ -5,7 +5,7 @@ from packaging import version
logging = logging.getLogger("nn-Meter") logging = logging.getLogger("nn-Meter")
def try_import_onnx(require_version = ["1.10.0", "1.9.0"]): def try_import_onnx(require_version = ["1.12.0", "1.10.0", "1.9.0"]):
if isinstance(require_version, str): if isinstance(require_version, str):
require_version = [require_version] require_version = [require_version]
try: try: