Skip to content

Commit 056019e

Browse files
Add tosa_spec and et-version info to .tosa files
output_tag<N>.tosa is not very informative. Output files will now be named as output_tag<N>_<tosa_spec>_<et-version>.tosa instead. Signed-off-by: Oscar Andersson <[email protected]> Change-Id: I13d75f0c35a023a315283bc14e6de38e932d4f10
1 parent 82f3381 commit 056019e

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

backends/arm/test/misc/test_debug_feats.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import shutil
1010
import tempfile
1111
import unittest
12+
from importlib.metadata import version
1213

1314
import torch
1415
from executorch.backends.arm.test import common
@@ -192,15 +193,16 @@ def test_collate_tosa_BI_tests(self):
192193
.to_edge_transform_and_lower()
193194
.to_executorch()
194195
)
196+
et_version = version("executorch")
195197
# test that the output directory is created and contains the expected files
196198
assert os.path.exists(
197199
"test_collate_tosa_tests/tosa-bi/TestCollateTosaTests/test_collate_tosa_BI_tests"
198200
)
199201
assert os.path.exists(
200-
"test_collate_tosa_tests/tosa-bi/TestCollateTosaTests/test_collate_tosa_BI_tests/output_tag6.tosa"
202+
f"test_collate_tosa_tests/tosa-bi/TestCollateTosaTests/test_collate_tosa_BI_tests/output_tag6_TOSA-0.80+BI_{et_version}.tosa"
201203
)
202204
assert os.path.exists(
203-
"test_collate_tosa_tests/tosa-bi/TestCollateTosaTests/test_collate_tosa_BI_tests/desc_tag6.json"
205+
f"test_collate_tosa_tests/tosa-bi/TestCollateTosaTests/test_collate_tosa_BI_tests/desc_tag6_TOSA-0.80+BI_{et_version}.json"
204206
)
205207

206208
os.environ.pop("TOSA_TESTCASES_BASE_PATH")

backends/arm/tosa_backend.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#
1313
import logging
1414
import os
15+
from importlib.metadata import version
1516
from typing import cast, final, List
1617

1718
import serializer.tosa_serializer as ts # type: ignore
@@ -122,10 +123,12 @@ def preprocess( # noqa: C901
122123

123124
if artifact_path:
124125
tag = _get_first_delegation_tag(graph_module)
126+
et_version = version("executorch")
125127
dbg_tosa_dump(
126128
tosa_graph,
127129
artifact_path,
128-
suffix="{}".format(f"_{tag}" if tag else ""),
130+
suffix="{}".format(f"_{tag}" if tag else "")
131+
+ (f"_{tosa_spec}" + (f"_{et_version}")),
129132
)
130133

131134
# Serialize and return the TOSA flatbuffer.

0 commit comments

Comments
 (0)