Skip to content

Commit

Permalink
Revert sim._export_encodings API to fix acceptance test
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Tuttle <[email protected]>
  • Loading branch information
quic-mtuttle committed Oct 10, 2024
1 parent 815dfc2 commit 6c154ef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions TrainingExtensions/onnx/src/python/aimet_onnx/quantsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,12 +718,13 @@ def _get_encodings(self, quantizer_names, enc_version):
encoding["name"] = name
return list(encoding_dict.values())

def _export_encodings(self, encoding_file_path, enc_version):
def _export_encodings(self, encoding_file_path):
"""
Export encodings to json and yaml file
:param encoding_file_path: path to save the encoding files
"""
enc_version = quantsim.encoding_version
if enc_version not in VALID_ENCODING_VERSIONS:
raise NotImplementedError(f'Encoding version {enc_version} not in set of valid encoding '
f'versions {VALID_ENCODING_VERSIONS}.')
Expand Down Expand Up @@ -770,7 +771,7 @@ def export(self, path: str, filename_prefix: str):
:param path: dir to save encoding files
:param filename_prefix: filename to save encoding files
"""
self._export_encodings(os.path.join(path, filename_prefix) + '.encodings', quantsim.encoding_version)
self._export_encodings(os.path.join(path, filename_prefix) + '.encodings')
self.remove_quantization_nodes()
if self.model.model.ByteSize() >= onnx.checker.MAXIMUM_PROTOBUF:
# Note: Saving as external data mutates the saved model, removing all initializer data
Expand Down

0 comments on commit 6c154ef

Please sign in to comment.