From 7d56ef27ee2ee1bd3ca80f313ece9bed334564c0 Mon Sep 17 00:00:00 2001 From: Mike Ruberry Date: Thu, 4 Jun 2020 19:32:09 -0700 Subject: [PATCH] Bumps supported file format in anticipate of torch.div changes (#39529) Summary: See https://github.com/pytorch/pytorch/pull/38620 for additional context. When PyTorch begins producing file format 4 with the updated div behavior it's safe for older PyTorch versions to consume it, since file format 4 only prohibits functionality. Bumping the supported file format version now gives PyTorch users on Master some leeway on updating their services that consume vs. produce PyTorch. Pull Request resolved: https://github.com/pytorch/pytorch/pull/39529 Differential Revision: D21886790 Pulled By: mruberry fbshipit-source-id: d6098eff06c26f18c3fac5cc85e5db298ba86e27 --- caffe2/serialize/inline_container.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/caffe2/serialize/inline_container.h b/caffe2/serialize/inline_container.h index f9ff35db428..d7a2a7ceb23 100644 --- a/caffe2/serialize/inline_container.h +++ b/caffe2/serialize/inline_container.h @@ -91,12 +91,16 @@ namespace caffe2 { namespace serialize { constexpr uint64_t kMinSupportedFileFormatVersion = 0x1L; -constexpr uint64_t kMaxSupportedFileFormatVersion = 0x3L; +constexpr uint64_t kMaxSupportedFileFormatVersion = 0x4L; // Versions (i.e. why was the version number bumped?) // 1. Initial version // 2. Removed op_version_set version numbers // 3. Added type tags to pickle serialization of container types +// 4. (Currently read-only) Will change torch.div to throw a runtime error +// when it would have performed floor division. Bumping the version counter +// will let us presever torch.div's historic behavior for programs +// serialized with file formats 1--3. constexpr uint64_t kProducedFileFormatVersion = 0x3L; // Writer-specific constants