@@ -8,10 +8,13 @@ If you are experiencing issues with TorchScript, or the generated model code by
...
@@ -8,10 +8,13 @@ If you are experiencing issues with TorchScript, or the generated model code by
This will come as the default execution engine in future version of Retiarii.
This will come as the default execution engine in future version of Retiarii.
Two steps are needed to enable this engine now.
Three steps are needed to enable this engine now.
1. Add ``@nni.retiarii.model_wrapper`` decorator outside the whole PyTorch model.
1. Add ``@nni.retiarii.model_wrapper`` decorator outside the whole PyTorch model.
2. Add ``config.execution_engine = 'py'`` to ``RetiariiExeConfig``.
2. Add ``config.execution_engine = 'py'`` to ``RetiariiExeConfig``.
3. If you need to export top models, formatter needs to be set to ``dict``. Exporting ``code`` won't work with this engine.
.. note:: You should always use ``super().__init__()` instead of ``super(MyNetwork, self).__init__()`` in the PyTorch model, because the latter one has issues with model wrapper.