Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert onnx sim._export_encodings API #3388

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading