Skip to content
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

Add defensive EMMS instructions to each SIMD sort function #183

Merged
merged 1 commit into from
Feb 25, 2025

Conversation

sterrettm2
Copy link
Contributor

Due to some compiler bug, some GCC versions, specifically GCC 9, generate MMX instructions without the required EMMS instruction. This can cause strange and obscure crashes.

A previous version of this problem caused #154, and it now seems to be causing issues with Pytorch. Out of an abundance of caution, this adds defensive EMMS intrinsics to the end of each of the SIMD sorting functions whenever MMX is enabled, to try and make sure this issue never shows up ever again.

Copy link
Contributor

@r-devulap r-devulap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Excellent work tracking down the tricky PyTorch crash!

@r-devulap r-devulap merged commit 7604f9e into intel:main Feb 25, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants