-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Introducing SymInt to Pytorch (for tracing size arithmetic) (master rebase) #74861
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
Conversation
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit 840a382 (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
7d019e7 to
5731273
Compare
torch/types.py
Outdated
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.
this is a temporary workaround. Eventually SymInt would be Union[int, SymIntNode] and we will be hitting the exact same error:
error: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader [misc]
fyi: @ezyang
5731273 to
bd9846f
Compare
52b47dd to
0ebb322
Compare
|
@Krovatkin has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
0ebb322 to
537fd43
Compare
|
@Krovatkin has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
1 similar comment
|
@Krovatkin has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
rename SymbolicOrConcreteInt -> SymInt address Ed's feedback remove spurious changes fix schema matching to allow int to be converted to symint change to expect_int test narrow_copy in jit missed some feedback fix headers add a comment to SymInt add annotation str to pass fx tests fix a trailing space lint address feedback and fix build failures build fixes fix dynamic types more CI fixes add pragma once add SymInt remove type not defined errors resolve bc issues add SymInt to templates
7365790 to
840a382
Compare
|
@Krovatkin has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
…ebase) (#74861) Summary: This PR introduces `SymInt` type to Pytorch which will be used by LTC and AOTAutograd for tracing size arithmetic and tests. `SymInt` is a C++ union structure [int64_t, SymbolicIntNode*] that wraps around an int64_t field where the value of the field could be an index into a list of `shared_ptr<SymbolicIntNode>` or a real int. This PR doesn't add any support for actually tracing symbolic ints. i.e. data_ for now can only contain real ints. ``` Goal 1: just to show we can add a type to PyTorch core. (wraps int) LANDEABLE Finalize the naming - symint Want the name to be short Does invoke “size” - NO SInt/SymInt/SymbolicInt SInt could mean signed int sym_int or symint or SymInt (originally it was “int”; capitalized implies object semantics, whereas lowercase implies value semantics) JIT schema - symint C++ - symint ``` See more details here: https://docs.google.com/document/d/1iiLNwR5ohAsw_ymfnOpDsyF6L9RTUaHMpD8 (d843f63f2a49c339fe79c3016a082c60fbf3fed5)YLw-jxEw Pull Request resolved: #74861 Reviewed By: qihqi, ngimel Differential Revision: D35226230 Pulled By: Krovatkin fbshipit-source-id: 34acf342bd50fcaa4d8d5dd49c2fd6a98823a5b3
|
Hey @Krovatkin. |
This PR introduces
SymInttype to Pytorch which will be used by LTC and AOTAutograd for tracing size arithmetic and tests.SymIntis a C++ union structure [int64_t, SymbolicIntNode*] that wraps around an int64_t field where the value of the field could be an index into a list ofshared_ptr<SymbolicIntNode>or a real int.This PR doesn't add any support for actually tracing symbolic ints. i.e. data_ for now can only contain real ints.
See more details here: https://docs.google.com/document/d/1iiLNwR5ohAsw_ymfnOpDsyF6L9RTUaHMpD8YLw-jxEw