Merge branch 'dev/onnx-version' into dev/dataset-generator
This commit is contained in:
Коммит
da8f02e3ae
|
@ -28,14 +28,14 @@ jobs:
|
|||
path: |
|
||||
~/.nn_meter
|
||||
/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
|
||||
run: |
|
||||
pip install onnx==1.9.0
|
||||
pip install torch==1.9.0
|
||||
pip install torchvision==0.10.0
|
||||
pip install onnx-simplifier
|
||||
pip install onnx-simplifier==0.3.6
|
||||
|
||||
- name: Install nn-Meter
|
||||
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 |
|
||||
| :----------------: | :-----------------------------------------------------------------------------------------------------------------------: |
|
||||
| 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` |
|
||||
| nn-Meter IR graph | --- |
|
||||
| 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
|
||||
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
|
||||
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
|
||||
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
|
||||
model_type == 'torch'
|
||||
"""
|
||||
|
|
|
@ -5,7 +5,7 @@ from packaging import version
|
|||
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):
|
||||
require_version = [require_version]
|
||||
try:
|
||||
|
|
Загрузка…
Ссылка в новой задаче