Fix generic integer alignment#218
Open
orebas wants to merge 1 commit into
Open
Conversation
Author
|
Full disclosure: the above PR, including the text, was authored by Codex. It was in response to a crash related to something I was trying, related to the biohydrogenation system. Below is an MWE for the crash. Obviously, the coefficients are quite large, and you should know that the bug does not surface with "normal" sized coefficients. I (human Oren) do not understand the bug or the fix. |
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.
Fixes align_up and align_down for non-power-of-two alignments.
The previous bit-mask implementation only works when the alignment is a power of two, but get_next_batch calls align_up(new_batch, composite * tasks). With non-power-of-two task counts, this can produce a batch size that is not divisible by composite * tasks, which can under-allocate task-local primes in the QQ learn-and-apply modular path.
Changes:
Tested with: