Switch keys to be sequential and stable in pickle serialization
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/23280
Test Plan: Imported from OSS
Differential Revision: D16452816
Pulled By: zdevito
fbshipit-source-id: e143780b8e834298a575ac76d49576df94fbe27b