Skip to content

Commit

Permalink
[TVMC] enable dumping imported modules too (#15779)
Browse files Browse the repository at this point in the history
Now we can dump the imported modules source too like device code.
  • Loading branch information
srkreddy1238 authored Sep 25, 2023
1 parent ae89c1e commit cde83e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/tvm/driver/tvmc/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,8 @@ def compile_model(
# TODO lib.get_source call have inconsistent behavior for unsupported
# formats (@leandron).
dumps[source_type] = lib.get_source(source_type)
for smod in lib.imported_modules:
dumps[smod.type_key] = smod.get_source()

# Create a new tvmc model package object from the graph definition.
package_path = tvmc_model.export_package(
Expand Down
1 change: 1 addition & 0 deletions tests/python/driver/tvmc/test_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,7 @@ def test_compile_opencl(tflite_mobilenet_v1_0_25_128):
assert type(tvmc_package.lib_path) is str
assert type(tvmc_package.params) is bytearray
assert os.path.exists(dumps_path)
assert path.exists("{}.{}".format(tvmc_package.package_path, "opencl"))


@tvm.testing.requires_cmsisnn
Expand Down

0 comments on commit cde83e1

Please sign in to comment.