ThanatosShinji / onnx-tool

A parser, editor and profiler tool for ONNX models.
https://pypi.org/project/onnx-tool/
MIT License
383 stars 51 forks source link

memory compression question #28

Closed wangxdgg closed 1 year ago

wangxdgg commented 1 year ago

I have some questions when looking at the memory compression section, is the middle layer memory compressed here, or weight memory? How did you achieve such a high compression ratio.

ThanatosShinji commented 1 year ago

It's the activation compression, no weight memory here. When one activation tensor is consumed by all its consumers, its memory can be freed to the next layer's activation tensor.

wangxdgg commented 1 year ago

So can it be interpreted as peak activation memory usage?

ThanatosShinji commented 1 year ago

You can say it's the peak activation memory usage with dynamic activation allocation.

wangxdgg commented 1 year ago

OK,I got you, thanks a lot !