onnxruntime/onnxruntime
Ted Themistokleous dadd0c451a
[MIGraphX EP] Fix MIGraphX mixed precision run input parameters (#20982)
See #20643

### Description

Changes order of how we perform quantization to better support mixed
precision and fixes a bug found with parameters of inputs for int8
quantization not being correctly handled.

We now perform int8 quantization first on a full precision input model,
before then quantizing the model to fp16 for remain ops that aren't
quantized. The former case was causing us to use a low precision input
which could cause larger values to be inserted than intended to the
model when int8 quantization is perform. The symptom of this was a
failure during quantization steps.

Similar to the above input parameters were being uninitialized and
resulting in similar failure during int8 quantization.

GPU faults were intermittent but present as using uninitialized memory
created undefined behavior when we started testing more complex models
during mixed precision.

### Motivation and Context

In some cases we've seen random data and/or invalid values entering into
compiled onnx graphs. This is due to input parameters to the MIGraphX
Graph not being set correctly when mixed precision (int8 + fp16) is used
and ordering of quantization steps is causes a lower precision model to
be used to perform int8 quantization. In most cases the failure is
silent/intermittent. In some cases we've observed gpu faults due to out
of bounds values being set.

This change is required as a large input parameter to the MIGraphX graph
is initialized to a large random value, and the next operator is using
that for indexing, we get undefined behavior and a GPU fault.
2024-06-18 11:18:13 +08:00
..
contrib_ops Add helper functions to dump 4d tensors in CPU for debugging (#21043) 2024-06-14 17:32:27 -07:00
core [MIGraphX EP] Fix MIGraphX mixed precision run input parameters (#20982) 2024-06-18 11:18:13 +08:00
python [MIGraphX EP] Add migraphx ep save load compiles (#20643) 2024-06-17 11:24:31 +08:00
test [QNN EP] Add quantization axis checks for Conv/ConvTranspose/Q/DQ ops (#21016) 2024-06-17 09:46:14 -07:00
tool/etw
wasm [js/web] optimize module export and deployment (#20165) 2024-05-20 09:51:16 -07:00
__init__.py Bump up version in main from 1.18.0 to 1.19.0 (#20489) 2024-04-29 20:21:41 -07:00
ReformatSource.ps1
ReformatSourcePython.bat
VSCodeCoverage.runsettings