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

Fixed MakeHelperModel test nondeterminism by disabling AVX512 with a Docker environment variable. #26

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

samuelklee
Copy link
Collaborator

@samuelklee samuelklee commented Feb 7, 2024

Tracked intermittent failures of the MakeHelperModel test to a dependence on whether the GitHub Actions runner CPU used AVX512 instructions. This caused inconsistent behavior in a floating-point comparison of scores in the find_best_helper method. Interestingly, the behavior was consistent across non-AVX512 CPUs; in contrast, I observed different results across different AVX512 CPUs (although I don't believe I saw nonreproducibility across runs on any given AVX512 CPU, I can't confirm this).

Fixed by appropriately setting the NPY_DISABLE_CPU_FEATURES environment variable in the Docker. Not sure if this causes any performance regressions across the board, but I'm not too worried.

This is a known issue, see e.g. icecube/skymap_scanner#200 and numpy/numpy#23523.

Went ahead and set some dtypes to np.int64 and np.float64 as well, although this doesn't introduce any additional changes. Also did some cleanup and fixed debug logging.

@samuelklee samuelklee changed the title print statements Fix MakeHelperModel test nondeterminism. Feb 7, 2024
@samuelklee samuelklee changed the title Fix MakeHelperModel test nondeterminism. Fixed MakeHelperModel test nondeterminism. Feb 7, 2024
@samuelklee samuelklee force-pushed the sl_fix_helper_model_test branch 4 times, most recently from c05ad3e to 7942690 Compare February 7, 2024 04:50
@samuelklee samuelklee force-pushed the sl_fix_helper_model_test branch from 56ecaa8 to 5eacb2f Compare February 8, 2024 18:41
@samuelklee samuelklee marked this pull request as ready for review February 8, 2024 18:54
@samuelklee samuelklee changed the title Fixed MakeHelperModel test nondeterminism. Fixed MakeHelperModel test nondeterminism by disabling AVX512 with a Docker environment variable. Feb 8, 2024
@samuelklee samuelklee merged commit e667e40 into master Feb 8, 2024
1 check passed
@samuelklee samuelklee deleted the sl_fix_helper_model_test branch February 8, 2024 18:55
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.

1 participant