We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
insert_deferred_runtime_asserts operates by symbolic tracing through the PythonReferenceAnalysis. However, the implementation of mod is not traceable:
@staticmethod def mod(x, y): ret = abs(x) % abs(y) if x < 0: ret *= -1 return ret
due to the conditional on x.
This is related to @lezcano complaining about how C and Python modulus semantics are not the same.
main
The text was updated successfully, but these errors were encountered:
Minimal repro:
import torch import torch._dynamo torch._dynamo.config.capture_scalar_outputs = True @torch.compile(fullgraph=True) def f(x, w): y = x.item() torch._check(y % 4 == 0) return x * w print(f(torch.tensor(20), torch.randn(3)))
Sorry, something went wrong.
We need to implement our own C-modulus SymPy class to fix this one.
No branches or pull requests
馃悰 Describe the bug
insert_deferred_runtime_asserts operates by symbolic tracing through the PythonReferenceAnalysis. However, the implementation of mod is not traceable:
due to the conditional on x.
This is related to @lezcano complaining about how C and Python modulus semantics are not the same.
Versions
main
The text was updated successfully, but these errors were encountered: