Repository navigation
Fix Sign and Clip operation on int64 tensors - #25280
Closed
Christian Bourjau (cbourjau) wants to merge 3 commits into
Closed
Christian Bourjau (cbourjau) wants to merge 3 commits into
Christian Bourjau (cbourjau) wants to merge 3 commits into
Conversation
Signed-off-by: Christian Bourjau <christian.bourjau@quantco.com>
Signed-off-by: Christian Bourjau <christian.bourjau@quantco.com>
Christian Bourjau (cbourjau)
marked this pull request as ready for review
July 4, 2025 15:06
| @@ -0,0 +1,33 @@ | |||
| import numpy as np | |||
| import onnx | |||
Check notice
Code scanning / CodeQL
Module is imported with 'import' and 'import from'
| @@ -0,0 +1,32 @@ | |||
| import numpy as np | |||
| import onnx | |||
Check notice
Code scanning / CodeQL
Module is imported with 'import' and 'import from'
Contributor
|
/azp run Linux QNN CI Pipeline, Win_TRT_Minimal_CUDA_Test_CI, Windows ARM64 QNN CI Pipeline, Windows GPU Doc Gen CI Pipeline, Windows x64 QNN CI Pipeline |
|
Azure Pipelines successfully started running 5 pipeline(s). |
Contributor
Author
|
Sorry, I lost sight of this PR. However, I was now able to fine the correct cause for this issue. The currenly-used Eigen version is buggy on SSE2 code paths. There is a fix upstream, but it is not part of any release, yet: https://gitlab.com/libeigen/eigen/-/merge_requests/2831 |
Contributor
Author
|
I'm closing this in favor of #32475 |
eserscor
pushed a commit
that referenced
this pull request
Nov 11, 2026
### Description onnxruntime is currently using an Eigen commit from somewhere in between Eigen 3.4.1 and Eigen 5.0.1 (despite the comment in deps.txt). This PR updates Eigen to the latest 5.0.1 release. Note that Eigen is a headers-only library, which should make this process smooth. One of the currently applied patches is no longer needed (it is part of the 5.0.1 release), and the other is simply disabling some warnings (still present after this PR). The new patch backports an [upstream fix](https://gitlab.com/libeigen/eigen/-/merge_requests/2831) for a bug which I had attempted to fix [here](#25280) somewhat incorrectly a long time ago. My proposed fix merely avoided the broken SSE2 code path. ### Motivation and Context The main motivation is to properly fix the Sign and Clip operators on installations that use the SSE2 path. Onnxruntime is currently using an outdated and odd Eigen version, which makes backporting awkward. It seems much easier and generally beneficial to update Eigen to a proper release, plus some well-defined patches. --------- Signed-off-by: Christian Bourjau <christian.bourjau@quantco.com>
This file contains hidden or 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
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
The Clip and sign operators exhibit buggy behavior for some int64 values on Linux and Windows (see added test cases). Using Eigen's Array-API appears to mitigate the issue. A failing test case on CI can be found here (uses the conda-forge toolchain).