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

CI: Build LFortran to WASM and Upload Fails Often #1790

Closed
Shaikh-Ubaid opened this issue Jun 9, 2023 · 5 comments · Fixed by #1805
Closed

CI: Build LFortran to WASM and Upload Fails Often #1790

Shaikh-Ubaid opened this issue Jun 9, 2023 · 5 comments · Fixed by #1805
Assignees

Comments

@Shaikh-Ubaid
Copy link
Member

Examples:

The error we receive is This operation was cancelled. The previous discussion related to this is here emscripten-core/emsdk#829. It seems that the failure happens because on running node src/lfortran/tests/test_lfortran.js, it occupies the whole memory/ram available, there by leading to a termination of the job.

@certik
Copy link
Contributor

certik commented Jun 9, 2023

Thanks. Let's assume that node test_lfortran.js runs out of memory. How much memory is there? Is there a Node JS command that prints it? Let's print it at the beginning. Is there a way to tell how much memory the process uses, say locally?

Let's investigate the memory requirement and how much memory is available, and see if this is the problem.

@Shaikh-Ubaid
Copy link
Member Author

How much memory is there? Is there a Node JS command that prints it? Let's print it at the beginning. Is there a way to tell how much memory the process uses, say locally?

Please see emscripten-core/emsdk#829 (comment) and emscripten-core/emsdk#829 (comment).

@certik
Copy link
Contributor

certik commented Jun 9, 2023

How much memory does the test_lfortran executable use when run as a native binary? It looks like in Node it takes about 20GB, and it might be too much for the Action runner. I think 20GB is way too much. I would expect 1GB to be reasonable (even that seems a lot). It could be that memory is not deallocated between tests, or we have some large test that takes a lot of memory.

TODO:

  • How much memory does the native binary use (below 4GB)?
  • Ensure it is below 1GB
  • Then get the node based program run under 1GB

@Shaikh-Ubaid
Copy link
Member Author

How much memory does the test_lfortran executable use when run as a native binary?

I think it does not use much memory when run as a native binary. My ram usage stays (almost) the same despite multiple runs. I am (parallelly) checking my memory usage in Activity Monitor App in the Memory tab. I am using MacOS.

I previously checked it on Ubuntu as well emscripten-core/emsdk#829 (comment).

@certik
Copy link
Contributor

certik commented Jun 12, 2023

Let's make progress on this, it seems we are now frequently hitting this bug at our PRs. I tried to measure the memory consumption of the Clang compiled test on macOS by running:

while true; do; ./src/lfortran/tests/test_lfortran; done

And checking total memory usage in htop and "Activity Monitor" and I can't see any change at all. It might not be the best test, I don't now how to properly measure memory usage.

Then we need to do the same for node locally.

Is there a way to print these numbers from node js, so that we can see the usage at the CI?

Can we run a subset of tests reliably? Is there one test that is somehow large in memory usage?

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 a pull request may close this issue.

2 participants