Skip to content

Conversation

@isuruf
Copy link
Collaborator

@isuruf isuruf commented Nov 6, 2024

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Nov 6, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/139899

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit f7e4bb0 with merge base 19c3ba4 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

isuruf added a commit that referenced this pull request Nov 6, 2024
ghstack-source-id: ef9fab3
Pull Request resolved: #139899
@isuruf
Copy link
Collaborator Author

isuruf commented Nov 6, 2024

cc @anijain2305

[ghstack-poisoned]
isuruf added a commit that referenced this pull request Nov 6, 2024
ghstack-source-id: 454ac7a
Pull Request resolved: #139899
[ghstack-poisoned]
isuruf added a commit that referenced this pull request Nov 6, 2024
ghstack-source-id: 0708511
Pull Request resolved: #139899
[ghstack-poisoned]
isuruf added a commit that referenced this pull request Nov 7, 2024
ghstack-source-id: fb14b80
Pull Request resolved: #139899
[ghstack-poisoned]
isuruf added a commit that referenced this pull request Nov 7, 2024
ghstack-source-id: 3f5bcbb
Pull Request resolved: #139899
import sympy

from torch._inductor.codecache import CppCodeCache
from torch._inductor.codegen.cpp_utils import cexpr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sigh, layering violation lol

) -> Tuple[List[str], List[str]]: # regular, verbose
) -> Tuple[
List[str], List[str], List[Tuple[sympy.Expr, Dict[str, List[Source]]]]
]: # regular, verbose, sympy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re the changes here, would it make more sense to just directly do C++ rendering here directly? This prevents you from having to invent one-off sympy functions for special concepts we don't normally have in sympy. In general sympy IR is not a good IR for driving C++ codegen, IMO.

Comment on lines +3208 to +3210
if (!THPVariable_CheckExact(obj) && !THPVariable_Check(obj)) {
return false;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should be able to skip this check. Because in the guard tree, this accessor will only be called from a GuardManager for a tensor.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a ping on this.

@anijain2305
Copy link
Contributor

I have done a quick non-rigorous review. The flow looks good to me. A few things that will help

  • Maybe we should move the code sitting in inductor for sympy C++ translator to symbolic shapes first in a separate PR.
  • Can you write some comments on the IndexManager feeding into Symbolic Shape Guard? A simple example directly in the cpp file, that shows the translated code and how IndexedManager helps you construct the arguments to the translated function, is good enough.
  • We should keep the flag off for now. You can turn it on in tests. Atleast not turn it on in this PR itself, because the reverts could be painful then.

@anijain2305
Copy link
Contributor

cc @jansel as well

@anijain2305 anijain2305 requested a review from jansel November 9, 2024 22:55
[ghstack-poisoned]
@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: Command git -C /home/runner/work/pytorch/pytorch cherry-pick -x 106221246a400da5a6c4e8c01b9d31e14fedf3ab returned non-zero exit code 1

Auto-merging torch/_dynamo/guards.py
Auto-merging torch/fx/experimental/symbolic_shapes.py
CONFLICT (content): Merge conflict in torch/fx/experimental/symbolic_shapes.py
error: could not apply 106221246a... Add a langs option for symbolic shape guards
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Details for Dev Infra team Raised by workflow job

[ghstack-poisoned]
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 22, 2025 06:26 Inactive
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 22, 2025 06:26 Inactive
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 22, 2025 06:26 Inactive
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 22, 2025 06:26 Inactive
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 22, 2025 06:26 Inactive
[ghstack-poisoned]
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 22, 2025 09:08 Inactive
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 22, 2025 09:08 Inactive
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 22, 2025 09:08 Inactive
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 22, 2025 09:08 Inactive
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 22, 2025 09:08 Inactive
[ghstack-poisoned]
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 22, 2025 11:05 Inactive
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 22, 2025 11:05 Inactive
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 22, 2025 11:05 Inactive
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 22, 2025 11:05 Inactive
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 22, 2025 11:05 Inactive
@isuruf
Copy link
Collaborator Author

isuruf commented Jan 22, 2025

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/inductor ciflow/trunk Trigger trunk jobs on your pull request fx Merged module: cpu CPU specific problem (e.g., perf, algorithm) module: dynamo open source release notes: dynamo release notes: fx release notes category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants