Skip to content

Avoid float32 overflow when ranking paired MSA rows. - #719

Open
shubhxho wants to merge 1 commit into
google-deepmind:mainfrom
shubhxho:msa-pairing-rank-overflow
Open

Avoid float32 overflow when ranking paired MSA rows.#719
shubhxho wants to merge 1 commit into
google-deepmind:mainfrom
shubhxho:msa-pairing-rank-overflow

Conversation

@shubhxho

Copy link
Copy Markdown

The rank metric multiplies one MSA row index per chain in float32. With a dozen chains and deep MSAs that product is well past 3.4e38, so every row comes out as inf and argsort no longer orders anything - the pairing keeps an arbitrary 8192 rows instead of the ones highest up the input MSAs. It also produces the "overflow encountered in reduce" warning in issue 236.

Sum the logs instead, which gives the same order without the overflow.

The rank metric multiplies one MSA row index per chain in float32. With a
dozen chains and deep MSAs that product is well past 3.4e38, so every row
comes out as inf and argsort no longer orders anything - the pairing keeps an
arbitrary 8192 rows instead of the ones highest up the input MSAs. It also
produces the "overflow encountered in reduce" warning in issue 236.

Sum the logs instead, which gives the same order without the overflow.

Signed-off-by: Shubh <shubh@shubhxho.com>
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