-
Notifications
You must be signed in to change notification settings - Fork 63
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
Major memory leak in the C target #2027
Comments
Some memory leak issues have been solved in the recent past. Did you use the latest version of the runtime and compiler? |
I used the 0.5.1. release. I don't think we had any fixes for memory usage since then. |
Looks like something with the initialization of banks and multiports which doesn't scale. We have the following for loops: for i=0 to 1000: That is 1e12 iterations which all uses the mixed_radix stuff. Then there is another 1e9 iterations in a loop that initializes a trigger_array. This is probably what is crashing the program. Unfortunately I never understood how banks and multiports are implemented in the C target with "src ranges", "dst ranges" and "mixed radix" so I cannot immedietaly look at the generated files and see what is the issue... |
Maybe @petervdonovan can shed some light on it? We have a bank of 1000 Account Reactors, each has a 1000-wide multiport input, and a 1000-wide multiport output. It seems that we are allocating memory for every possible connection (1e3*1e3*1e3) |
I have used the mixed-radix stuff before but mostly I prefer not to touch it unless this issue is a blocker for an actual user or a blocker for someone's research project. Is this an issue that we need to prioritize? |
I am a bit confused by the mixed radix stuff too. I thought that is done in the LF compiler. Don't we use the instance graph in the C target, precisely so that we can statically code generate all the connections? 1e12 iterations is really a lot Why |
Well, yes, but generating code corresponding to every single individual connection is not a scalable design, so the design using mixed-radix integers was sort of a compromise I guess. I think that the design for the C target is stuck |
It means that we cannot run the C banking benchmark and that we have a serious scaling issue in the C target. As far as I know, this is not blocking anyone. From my side, it is Ok to add this to the backlog. |
@edwardalee and @erlingrj, since you guys are working heavily on the C runtime, you might want to take this in consideration. |
This is because there are some uses of interleaved connections that I never figured out how to handle with the mixed radix solution. I suspect there is a way, but I’m focused on federated and enclaves right now, so this will have to wait.
|
I tried today to compile and execute the Banking C benchmark. Executing the benchmark very quickly eats up all my memory (I have 32 GiB RAM + 32 GiB swap). I am not sure if this is due to a memory leak or due to extensive memory usage in the C target.
The text was updated successfully, but these errors were encountered: