You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some functions in the code base are incompatible with certain versions of Torch such as 1.13.1. Adding a general-purpose utility decorator which detects whether the Torch version is incompatible with certain key functions could be helpful in notifying the user when such mismatches occur.
Desired Solution
A decorator of the form:
@req_torch_version(2)deff(...):
This decorator would throw a clear error when the detected Torch version differs from that required to use the decorated function.
Temporary Alternative
A temporary alternative, which is already in use in PR #1731, is to add logic to each function with compatibility issues, raising an error if any versioning issues are detected. While this is a functional solution, it is difficult to scale and can lead to repetitive code.
Additional Context
Certain imports are also not compatible across Torch versions (as in import torchdynamo in Torch 1.13 versus import torch._dynamo in 2.0). To resolve this issue, the imports can be moved inside the functions using them so as to encapsulate all version-specific code within one area.
The text was updated successfully, but these errors were encountered:
@gs-olive I was thinking about this, probably something to bring up with @ncomly-nvidia but spanning 1.13 and 2.0 makes dependencies complicated for dyanmo.
Also we could add some functionality to the @tensorrt_converter decorators similar to what is already there for TRT.
Context
Some functions in the code base are incompatible with certain versions of Torch such as 1.13.1. Adding a general-purpose utility decorator which detects whether the Torch version is incompatible with certain key functions could be helpful in notifying the user when such mismatches occur.
Desired Solution
A decorator of the form:
This decorator would throw a clear error when the detected Torch version differs from that required to use the decorated function.
Temporary Alternative
A temporary alternative, which is already in use in PR #1731, is to add logic to each function with compatibility issues, raising an error if any versioning issues are detected. While this is a functional solution, it is difficult to scale and can lead to repetitive code.
Additional Context
Certain imports are also not compatible across Torch versions (as in
import torchdynamo
in Torch 1.13 versusimport torch._dynamo
in 2.0). To resolve this issue, the imports can be moved inside the functions using them so as to encapsulate all version-specific code within one area.The text was updated successfully, but these errors were encountered: