Skip to content

Commit

Permalink
Fix (notebooks): make requirements clearer for dynamic export
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianandresgrob committed Mar 6, 2024
1 parent 1c7c530 commit 0fb2ea2
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions notebooks/ONNX_export_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x7f2a6afb6f50>"
"<IPython.lib.display.IFrame at 0x7fb62ae3fe50>"
]
},
"execution_count": 4,
Expand Down Expand Up @@ -331,7 +331,7 @@
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x7f2a6afa9e90>"
"<IPython.lib.display.IFrame at 0x7fb734383710>"
]
},
"execution_count": 6,
Expand Down Expand Up @@ -460,7 +460,7 @@
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x7f2a69d7ff10>"
"<IPython.lib.display.IFrame at 0x7fb629e8a010>"
]
},
"execution_count": 8,
Expand Down Expand Up @@ -605,7 +605,7 @@
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x7f2a69d2e710>"
"<IPython.lib.display.IFrame at 0x7fb62ae37190>"
]
},
"execution_count": 10,
Expand Down Expand Up @@ -704,7 +704,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"2024-03-01 03:24:07.215804006 [W:onnxruntime:, graph.cc:1283 Graph] Initializer linear.bias appears in graph inputs and will not be treated as constant value/weight. This may prevent some of the graph optimizations, like const folding. Move it out of graph inputs if there is no need to override it, by either re-generating the model with latest exporter/converter or with the tool onnxruntime/tools/python/remove_initializer_from_input.py.\n"
"2024-03-06 02:12:47.492497092 [W:onnxruntime:, graph.cc:1283 Graph] Initializer linear.bias appears in graph inputs and will not be treated as constant value/weight. This may prevent some of the graph optimizations, like const folding. Move it out of graph inputs if there is no need to override it, by either re-generating the model with latest exporter/converter or with the tool onnxruntime/tools/python/remove_initializer_from_input.py.\n"
]
}
],
Expand Down Expand Up @@ -842,18 +842,18 @@
},
"outputs": [
{
"name": "stdout",
"name": "stderr",
"output_type": "stream",
"text": [
"True\n"
"/scratch/fabian/brevitas/src/brevitas/export/onnx/standard/manager.py:26: UserWarning: ONNX opset version set to 13, override with opset_version=\n",
" warnings.warn(f\"ONNX opset version set to {DEFAULT_OPSET}, override with {ka}=\")\n"
]
},
{
"name": "stderr",
"name": "stdout",
"output_type": "stream",
"text": [
"/scratch/fabian/brevitas/src/brevitas/export/onnx/standard/manager.py:26: UserWarning: ONNX opset version set to 13, override with opset_version=\n",
" warnings.warn(f\"ONNX opset version set to {DEFAULT_OPSET}, override with {ka}=\")\n"
"True\n"
]
}
],
Expand Down Expand Up @@ -924,14 +924,14 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"You can also export dynamically quantized models to ONNX, but there are some limitations. Supported exports include:\n",
"You can also export dynamically quantized models to ONNX, but there are some limitations. The ONNX DynamicQuantizeLinear requires the following settings:\n",
"- Asymmetric quantization (and therefore *unsigned*)\n",
"- Min-max scaling\n",
"- Rounding to nearest\n",
"- Per tensor scaling\n",
"- Bit width set to 8\n",
"\n",
"Note that ONNX DynamicQuantizeLinear requires these specific requirements for quantizers. This is shown in the following example:"
"This is shown in the following example:"
]
},
{
Expand Down Expand Up @@ -993,7 +993,7 @@
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x7efe085d8ad0>"
"<IPython.lib.display.IFrame at 0x7fb62856ccd0>"
]
},
"execution_count": 15,
Expand Down

0 comments on commit 0fb2ea2

Please sign in to comment.