forked from microsoft/onnxruntime
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix mixed and input parameters to MIGraphX EP #38
Merged
TedThemistokleous
merged 3 commits into
ROCm:rocm6.1_internal_testing
from
TedThemistokleous:fix_mixed_parameters
Jun 11, 2024
Merged
Fix mixed and input parameters to MIGraphX EP #38
TedThemistokleous
merged 3 commits into
ROCm:rocm6.1_internal_testing
from
TedThemistokleous:fix_mixed_parameters
Jun 11, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TedThemistokleous
force-pushed
the
fix_mixed_parameters
branch
from
June 8, 2024 17:02
e83dbec
to
b56389b
Compare
Fixes GPU faults Seen when running Mixed Precision inferences workloads with Bert v1.1 (fp16 + int8 Quant of Conv + MatMul) Was hitting an edge case with mixed precision where the input parameters were not being populated and using uninitizlied values for the parameters which would "work" silently as no issue in inference arise. For bert though, segment_ids is pushed through a gather onnx operator which uses these as an index. Using uninitialized memory made this error such that it was non obvious why we were getting failures between our runs and we saw the issue intermittently between machines/cards/etc. Fixes here are as follows to the MIGraphX Execution Provider -Fp16 quantization after int8 -Additional debug logging for workflow of loading/quantization - Set input/output parameters as seperate run prior to int8 calibration - Set all dynamic data as input parameters for int8 static calibration to be performed with MIGraphX Without these changes models will fail to copy input parameters on mixed precision runs when we decided to quantize as MIGraphX assumes all inputs will be used for calibration not just the input data read in from a calibration table.
TedThemistokleous
force-pushed
the
fix_mixed_parameters
branch
from
June 8, 2024 17:22
b56389b
to
98d0ccc
Compare
jeffdaily
reviewed
Jun 10, 2024
onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Split the logging up a little to reduce output when logging is on as a matter of preference but nothing technically incorrect other than what Jeff has noted.
onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc
Outdated
Show resolved
Hide resolved
groenenboomj
approved these changes
Jun 11, 2024
TedThemistokleous
merged commit Jun 11, 2024
d5697e5
into
ROCm:rocm6.1_internal_testing
7 of 17 checks passed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fix Mixed precision (int8 + fp16) during calibration GPU segfault. Found input params which weren't set with both int8 and fp16 as the calibration was never setting this as part of the run.
The order of quantization on the model was also changed so that we use a non quantized model for the calibration before we finally apply an fp16 quantization.
Motivation and Context
This was causing a failure in QA as part of our testing. This bug was rather intermittent as the operation without these changes would periodically fail due to the input parameters to MIGraphX being uninitialized memory. This wasn't an issue until we had an input parameter used as an index for one of our Onnx operators (Gather) which would cause the GPU fault observed.
Due to the random nature of uninitialized memory, this would actually appear differently on a few different servers/cards. We were able to find one machine that consistently reproduced the issue where others were able to run example code upto batch size 256 without fault.