-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Guard Symbol and ShapeGuardPrinter behind HAS_SYMPY #90704
Conversation
Signed-off-by: Eli Uriegas <eliuriegas@meta.com>
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/90704
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 FailuresAs of commit a6cd8e2: The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
assert isinstance(expr, Symbol), str(type(expr)) | ||
assert expr in self.symbol_to_source, f"{expr} (could be from {expr.snames}) not in {self.symbol_to_source}" | ||
return self.symbol_to_source[expr][0] | ||
if HAS_SYMPY: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this system env variable ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's declared at the top of the file near the sympy import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pytorch/torch/fx/experimental/symbolic_shapes.py
Lines 19 to 25 in a6cd8e2
try: | |
import sympy # type: ignore[import] | |
from sympy.printing.precedence import precedence # type: ignore[import] | |
from sympy.printing.str import StrPrinter # type: ignore[import] | |
HAS_SYMPY = True | |
except ImportError: | |
HAS_SYMPY = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but considering that SYMPY is now a mandatory dep, should we really have this guard?
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 2 additional jobs have failed, first few of them are: trunk ,trunk / linux-bionic-cuda11.7-py3.10-gcc7 / test (distributed, 1, 3, linux.8xlarge.nvidia.gpu) Details for Dev Infra teamRaised by workflow job |
@pytorchbot merge -f"flaky failure for distributed tests, #73315" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Signed-off-by: Eli Uriegas eliuriegas@meta.com
Follow up to #90528
Fixes #90696