Impact of distribution strategy on keras SavedModel variables size on disk

16 views
Skip to first unread message

Jason Brancazio

unread,
Mar 11, 2022, 1:34:22 AM3/11/22
to Discuss
Hi Tensorflow-discuss,

When I save a tf.keras model compiled with a MirroredStrategy on a Vertex AI workbench instance with 4 T4 GPUs attached, the resulting SavedModel variables are 3x the size on disk (1.3GB) of a model compiled on the same instance with the default strategy and then saved (430MB).

If I reload the 1.3GB saved model with the default strategy, then resave it, the variables remain at 1.3GB, instead of shrinking to 430MB.

I don't even have to train the compiled model to see these differences.

I've read the guides and tutorials about model saving and loading, and I'm still struggling to understand why this happens. Can anyone shed some light? Is this known behavior?

Sayak Paul

unread,
Mar 11, 2022, 1:40:19 AM3/11/22
to Jason Brancazio, Discuss
Hi Jason,

This mailist is quite inactive. I would suggest posting this on discuss.tensorflow.org. This issue seems to be an important one to address.

Sayak Paul | sayak.dev



--
You received this message because you are subscribed to the Google Groups "Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss+u...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/discuss/8fb251ea-3b00-4aae-bbf6-bce6f42459can%40tensorflow.org.
Reply all
Reply to author
Forward
0 new messages