-
Notifications
You must be signed in to change notification settings - Fork 325
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
Output of roberta models varies between NNPA compiles #2789
Comments
I tried to track this down some. I don't have an exact commit but it becomes much worse (and easily reproducible) somewhere after ebac513. At ebac513 I got it to happen twice out of 70 tests. The next four commits had an issue that caused the model to not compile. The next commit to compile, b7e981d, the issue is readily reproducible and values shift slightly almost every test iteration. I'm still tracking down the first commit to show the issue. This is what I've tested so far b7e981d - almost every iteration different |
…s and some rules in zhigh-to-onnx pass The onnx-to-zhigh pass has two phases: 1) converting multiple onnx ops into a single zhigh op, and 2) converting a single onnx op to a single zhigh op, where the second phase uses DimAnalysis (Patterns in the 1st phase at this moment does not use DimAnalysis) The problem is DimAnalysis is currently called before the 1st phase, which is not good because the 1st phase may change the IR so the information from DimAnalysis is obsoleted to the 2nd phase. Correct position for DimAnalysis would be just before the 2nd phase. Other than that, this PR changes slightly the rules in zhigh-to-onnx pass so that for binary ops, only one input (instead of two) that is from stick would be enough to trigger the rule to convert a zhigh op back to an onnx op. Resolves onnx#2789 --------- Signed-off-by: Tung D. Le <[email protected]> (cherry picked from commit 80a63f2) Signed-off-by: Charles Volzka <[email protected]>
…s and some rules in zhigh-to-onnx pass (#2797) The onnx-to-zhigh pass has two phases: 1) converting multiple onnx ops into a single zhigh op, and 2) converting a single onnx op to a single zhigh op, where the second phase uses DimAnalysis (Patterns in the 1st phase at this moment does not use DimAnalysis) The problem is DimAnalysis is currently called before the 1st phase, which is not good because the 1st phase may change the IR so the information from DimAnalysis is obsoleted to the 2nd phase. Correct position for DimAnalysis would be just before the 2nd phase. Other than that, this PR changes slightly the rules in zhigh-to-onnx pass so that for binary ops, only one input (instead of two) that is from stick would be enough to trigger the rule to convert a zhigh op back to an onnx op. Resolves #2789 --------- (cherry picked from commit 80a63f2) Signed-off-by: Tung D. Le <[email protected]> Signed-off-by: Charles Volzka <[email protected]> Co-authored-by: Tung D. Le <[email protected]>
After compiling roberta-sequence-classification-9.onnx and roberta-base-11.onnx for NNPA and running the generate .so. The model output can vary slightly.
For example, compiling and running roberta-sequence-classification-9 twice may yield
The values are always very close but I wouldn't expect any differences at all.
Notes:
./test-roberta.sh roberta-sequence-classification-9
actual
column's output varies between compile and run cycles. (Note:exp
column are the CPU expected values based on the example values in the onnx-model-zoo )./test-roberta.sh roberta-base-11
Min passing r_tol:
andMax absolute difference (Min passing a_tol for r_tol to be 0)
and notice it keeps shifting. Those are the minimum a_tol and r_tol values for the test to pass that run.The text was updated successfully, but these errors were encountered: