Closed abishekmuthian closed 10 months ago
Hey @abishekmuthian
after this change, we experimented that the memory usage is 2 times Python for the same model.
We've probably found a way to reduce further, I'll keep you posted!
That's good news! Bringing the memory consumption on-par with python would definitely motive more to adopt spago for their ML workflow.
With the new release the memory usage is close to PyTorch version.
I ran memory profiling for the code https://github.com/nlpodyssey/spago/issues/103 and spago version uses 3.9 GB when compared to 1.2 GB of python. The model sizes are similar
valhalla/distilbart-mnli-12-3
, it is 2.5 GB after transforming (hf-importer) to spago and where as upstream python version is 2.1 GB.Memory profiling in spago
Memory profiling in Python
Is this expected? Spago can be very useful in low memory environments like ARM SBC to conducted CPU bound inference, But the memory usage needs to optimized.
Python version seems to be faster in overall operation timing as well because loading of configuration, model weights takes variable timing in spago.