Skip to content

Commit

Permalink
[#65152] optimizers: tvm: Minify model JSON
Browse files Browse the repository at this point in the history
Signed-off-by: Maciej Torhan <[email protected]>
  • Loading branch information
m-torhan committed Sep 4, 2024
1 parent 630a23c commit 224e9d3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion kenning/optimizers/tvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Wrapper for TVM deep learning compiler.
"""

import json
import re
from typing import Dict, List, Literal, Optional, Tuple, Union

Expand Down Expand Up @@ -658,7 +659,13 @@ def generator():
)

if self.target_microtvm_board:
graph_json = lib.get_graph_json().encode()
graph_json = lib.get_graph_json()
# minify JSON
graph_json = json.dumps(
json.loads(graph_json), separators=(",", ":")
)
graph_json = graph_json.encode()

params = tvm.runtime.params.save_param_dict(lib.get_params())

graph_data = b""
Expand Down

0 comments on commit 224e9d3

Please sign in to comment.