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

[BUG] Excessive memory usage during compilation of large StaticIntTuble #2424

Closed
MoSafi2 opened this issue Apr 27, 2024 · 2 comments
Closed
Labels
bug Something isn't working mojo Issues that are related to mojo mojo-repo Tag all issues with this label

Comments

@MoSafi2
Copy link
Contributor

MoSafi2 commented Apr 27, 2024

Bug description

As per title, compilation of code requiring initilizatio of large StaticIntTuble is associated with excessive memory consumption.

var x = StaticIntTuple[30_000]()
print(x[0])

When running mojo build <file_name.mojo> mojo would allocate 28 GB during compilation but the resulting binary would consume trivial resources.
The resouce consumption during compilation is also proprotional to the StaticIntTuple size with size 50_000 not compiling on my system and size 20_000 associated with only 10GB memory usage.

Steps to reproduce

  • Include relevant code snippet or link to code that did not work as expected.
  • If applicable, add screenshots to help explain the problem.
  • If using the Playground, name the pre-existing notebook that failed and the steps that led to failure.
  • Include anything else that might help us debug the issue.

System information

- What OS did you do install Mojo on ? Ubuntu 24.04 LTS, also reproducible on Ubuntu 22.04 LTS running in a VM
- Provide version information for Mojo by pasting the output of `mojo -v`  Mojo nightly mojo 2024.4.2621 (6dff3016)
- Provide Modular CLI version by pasting the output of `modular -v` modular 0.7.2 (d0adc668)
@MoSafi2 MoSafi2 added bug Something isn't working mojo Issues that are related to mojo labels Apr 27, 2024
@VMois
Copy link

VMois commented Apr 27, 2024

I can reproduce with mojo 24.2.1 (2f0dcf11). I can see a spike to 22GB and it will probably go even more.

@VMois
Copy link

VMois commented Apr 27, 2024

The size of the binary for size 20k on MacOS was 577KB.

@ematejska ematejska added the mojo-repo Tag all issues with this label label Apr 29, 2024
@linear linear bot closed this as not planned Won't fix, can't repro, duplicate, stale May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mojo Issues that are related to mojo mojo-repo Tag all issues with this label
Projects
None yet
Development

No branches or pull requests

3 participants