You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So the optional decomposition was removed during this period of time. It would be useful to have a method to test the memory changes. It is possible the decomposition was benefiting and these regressions are unrelated to TOSA/TFLite specific work.
the new -iree-scheduling-dump-statistics-format=pretty flag can be used on iree-translate to see the transient memory usage (for these simple static models) - may be useful for these kind of things as no need to run
Awesome! I thought we couldn't discover the runtime hal buffer usage in the codegen time. It would be fantastic to know ahead of time to see if we blow heap or not.
It's a different number than what the runtime can give - the runtime gives you the peak memory usage while the compiler can only give you an estimated cumulative sum of transients that could be allocated, so if you had this:
if (cond) { run_model_subgraph_a(alloca(1000)); }
else { run_model_subgraph_b(alloca(3000)); }
The runtime would give you 1000 or 3000 depending on cond while the compiler stats will give you 4000 (1000+3000). Loops and other things will make it skew even further.
It can be useful, though, for relative comparisons: so something like "the cumsum of the transient allocations at revision T was 4000 and at revision T+1 was 6000, so we are probably allocating more memory in some cases" - it may not even change the peak consumption at runtime but does indicate that we have more live transients in the program (what all of these regressions have been).
We could refine the statistic in some cases but it's a halting problem situation: at the point that we have to effectively run the program within the compiler it's better just to run the program, and having a robust number that won't break if an if or for shows up in the model is nice.
TLDR: it'll let you compare transient memory growth revision to revision but to get the actual memory consumption you'll need to still run the model. Should still be a useful signal, though, and something we could track on a dashboard (so long as we didn't put units next to it and claim it was the actual memory consumption :)
We can close this issue for now. There are extra efforts to track the memory usage in the benchmark framework (#7972) so hopefully we can catch the regression sooner once it is landed.
Activity
hcindyl commentedon Jan 11, 2022
Since snapshot 731, the hal memory for this model further grows to 241kB
rsuderman commentedon Jan 11, 2022
So the optional decomposition was removed during this period of time. It would be useful to have a method to test the memory changes. It is possible the decomposition was benefiting and these regressions are unrelated to TOSA/TFLite specific work.
rsuderman commentedon Jan 22, 2022
Reopened until we can validate
rsuderman commentedon Jan 27, 2022
Validated that its in. Assigning back to @hcindyl to validate whether memory usage is reasonable.
benvanik commentedon Jan 27, 2022
the new
-iree-scheduling-dump-statistics-format=prettyflag can be used on iree-translate to see the transient memory usage (for these simple static models) - may be useful for these kind of things as no need to runhcindyl commentedon Jan 27, 2022
Awesome! I thought we couldn't discover the runtime hal buffer usage in the codegen time. It would be fantastic to know ahead of time to see if we blow heap or not.
benvanik commentedon Jan 27, 2022
It's a different number than what the runtime can give - the runtime gives you the peak memory usage while the compiler can only give you an estimated cumulative sum of transients that could be allocated, so if you had this:
The runtime would give you 1000 or 3000 depending on cond while the compiler stats will give you 4000 (1000+3000). Loops and other things will make it skew even further.
It can be useful, though, for relative comparisons: so something like "the cumsum of the transient allocations at revision T was 4000 and at revision T+1 was 6000, so we are probably allocating more memory in some cases" - it may not even change the peak consumption at runtime but does indicate that we have more live transients in the program (what all of these regressions have been).
We could refine the statistic in some cases but it's a halting problem situation: at the point that we have to effectively run the program within the compiler it's better just to run the program, and having a robust number that won't break if an if or for shows up in the model is nice.
TLDR: it'll let you compare transient memory growth revision to revision but to get the actual memory consumption you'll need to still run the model. Should still be a useful signal, though, and something we could track on a dashboard (so long as we didn't put units next to it and claim it was the actual memory consumption :)
jpienaar commentedon Jul 1, 2022
Was this triaged? Still issue?
hcindyl commentedon Jul 1, 2022
There are major compiler and runtime changes since January. With the latest release
candidate-20220630.189We can close this issue for now. There are extra efforts to track the memory usage in the benchmark framework (#7972) so hopefully we can catch the regression sooner once it is landed.
jpienaar commentedon Jul 1, 2022
Great, thanks