You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 18, 2024. It is now read-only.
A dummy_input argument for the export_model in Compressor.
Allow using opset_version=10 or higher when calling torch.onnx.export inside the export_model in Compressor.
Why is this needed:
Some models need a tuple instead of a tensor as the model input. For example, transformer models require both input and input mask as the model input. In these cases, it seems that the original input_shape argument is not enough to specify the dummy input.
Some models that use dynamic indexing (e.g., transformers) does not work with the default opset_version (9) of torch.onnx.export. The reported error looks like RuntimeError: Unsupported: ONNX export of Slice with dynamic inputs. DynamicSlice is a deprecated experimental op. The error disappears when opset_version=10 is used.
Without this feature, how does current nni work:
It does not work for exporting transformers to ONNX.
Components that may involve changes:
export_model function in Compressor
Model Speedup may be affected
Brief description of your proposal if any:
Allow a dummy_input argument and possibly an opset_version argument.