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 np.sum overflows on windows #270

Merged
merged 1 commit into from
Jun 14, 2023
Merged

fix np.sum overflows on windows #270

merged 1 commit into from
Jun 14, 2023

Conversation

LaihoE
Copy link
Contributor

@LaihoE LaihoE commented May 9, 2023

Fixes this problem on windows: #232

Was able to reproduce on windows and fix with this.

It breaks because on windows the default value for the output of np.sum is an int32 causing overflow, while default is 64 bit on linux/mac. Same behavior with np.cumsum (the first implementation of prepare.py), so it seems like it has been overflowing from day 1 on windows, but only now people have noticed?

Tbh this just seems like stupid default behavior from numpy? Why not just force it to int64 on windows and avoid this, while letting people manually change it if needed.

@karpathy
Copy link
Owner

fascinating ty

@karpathy karpathy merged commit ed7887c into karpathy:master Jun 14, 2023
kw1jjang pushed a commit to kw1jjang/nanoGPT-BVV that referenced this pull request Jun 15, 2023
fix np.sum overflows on windows
carmocca added a commit to Lightning-AI/litgpt that referenced this pull request Jun 21, 2023
ken-viper added a commit to ken-viper/litgpt that referenced this pull request Sep 5, 2024
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