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

Fix cache offset casting with low precision policies #299

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

jonatanklosko
Copy link
Member

@jonatanklosko jonatanklosko commented Dec 8, 2023

Currently running bf16 llama with long left-padded sequences produces wrong results. This is because we have an integer cache.offset and casting to bf16 causes overflows for large values.

Axon used to cast integers according to model policy, but that's no longer the case as of elixir-nx/axon#547, so we can keep offset as an integer and it's all good.

@jonatanklosko jonatanklosko merged commit e726e26 into main Dec 8, 2023
2 checks passed
@jonatanklosko jonatanklosko deleted the jk-cache-types branch December 8, 2023 16:32
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.

None yet

1 participant