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

[TVMC] Bug fix #17522

Closed
wants to merge 2 commits into from
Closed
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
14 changes: 12 additions & 2 deletions python/tvm/driver/tvmc/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,19 @@ def compile_model(
lib = graph_module.lib if use_vm else graph_module.get_lib()
# TODO lib.get_source call have inconsistent behavior for unsupported
# formats (@leandron).
dumps[source_type] = lib.get_source(source_type)
try:
dumps[source_type] = lib.get_source(source_type)
except tvm.TVMError:
pass
srkreddy1238 marked this conversation as resolved.
Show resolved Hide resolved
for smod in lib.imported_modules:
dumps[smod.type_key] = smod.get_source()
try:
if smod.type_key not in dumps:
dumps[smod.type_key] = ""
else:
dumps[smod.type_key] += "\n"
dumps[smod.type_key] += smod.get_source()
except tvm.TVMError:
print(f"Imported module {smod.type_key} doesn't support source dump")

# Create a new tvmc model package object from the graph definition.
package_path = tvmc_model.export_package(
Expand Down
Loading