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

support for torch 2.1 #104

Closed
gunsodo opened this issue Jul 16, 2024 · 0 comments · Fixed by #106
Closed

support for torch 2.1 #104

gunsodo opened this issue Jul 16, 2024 · 0 comments · Fixed by #106
Assignees

Comments

@gunsodo
Copy link

gunsodo commented Jul 16, 2024

As it is mentioned in the wiki, the package might not work well with torch<2.2. One can reproduce the problem with torch=2.1 when torch.export has been first released, following the tutorial provided in the guide.

Is it possible to limit the torch version to >=2.2 in the pyproject.toml so that the error will be raised during the installation? Or alternatively, is it reasonable to have torch.export.ExportGraphSignature converter (from 2.1 to >=2.2)? Below is the trace:

Traceback (most recent call last):
  File ".../test_torch21_model_explorer.py", line 11, in <module>
    model_explorer.visualize_pytorch('mobilenet', exported_program=ep)
  File ".../lib/python3.11/site-packages/model_explorer/apis.py", line 82, in visualize_pytorch
    cur_config.add_model_from_pytorch(
  File ".../lib/python3.11/site-packages/model_explorer/config.py", line 84, in add_model_from_pytorch
    adapter = PytorchExportedProgramAdapterImpl(exported_program, settings)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/model_explorer/pytorch_exported_program_adater_impl.py", line 33, in __init__
    self.inputs_map = self.get_inputs_map()
                      ^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/model_explorer/pytorch_exported_program_adater_impl.py", line 97, in get_inputs_map
    self.ep.graph_signature.input_specs, input_tensors
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ExportGraphSignature' object has no attribute 'input_specs'

I am happy to open a PR for either approach, but I am not confident with the latter approach as I am not a Torch expert and there may be other issues following this one as well.

Anyway, thank you very much for creating this wonderful package!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants