Skip to content

Commit c9945de

Browse files
authored
set dynamic=False when extracting in single_device_runner.py (#95)
* support checking model redundancy * revert change of vision_model_test * reformat python code. * reformat bert_model_test.py and utils.py * minor fix * fix failed check by comparing directories after os.path.realpath() * fix bugs in check_validate.sh * set dynamic=False in single_device_runner.py
1 parent 482d0df commit c9945de

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

graph_net/torch/single_device_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def main(args):
5858
print(f"{model_path=}")
5959
if args.enable_extract:
6060
assert args.extract_name is not None
61-
kwargs = dict(name=args.extract_name, **dump_graph_options)
61+
kwargs = dict(name=args.extract_name, dynamic=False, **dump_graph_options)
6262
model = extract(**kwargs)(model)
6363

6464
inputs_params = utils.load_converted_from_text(f"{model_path}")

graph_net/torch/validate.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ def temp_workspace():
1818
def main(args):
1919
model_path = args.model_path
2020
with temp_workspace() as tmp_dir_name:
21-
extract_name = "temp"
2221
print("Check extractability ...")
22+
cmd = f"{sys.executable} -m graph_net.torch.single_device_runner --model-path {model_path}"
23+
cmd_ret = os.system(cmd)
24+
assert cmd_ret == 0, f"{cmd_ret=}, {cmd=}"
25+
extract_name = "temp"
2326
cmd = f"{sys.executable} -m graph_net.torch.single_device_runner --model-path {model_path} --enable-extract True --extract-name {extract_name} --dump-graph-hash-key"
2427
cmd_ret = os.system(cmd)
2528
assert cmd_ret == 0, f"{cmd_ret=}, {cmd=}"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9d1568d6617d5b2d5d3762b24b3c296f63fe423cfecdc27d6ecd425c0290de74
1+
6307f5cae7a727aa9c38f51c1b38fc303106c8d7d9f318a74039249efe87f3d4

0 commit comments

Comments
 (0)