-
Notifications
You must be signed in to change notification settings - Fork 86
Analyze type annotation for input types | feat(op_schema) #631
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
Move version_utils to `_internal` so that it can be used my onnxscript [ghstack-poisoned]
[ghstack-poisoned]
…tion` | chore(irbuilder)" Merge the two list in `IRFunction` by adding a `has_default` field in `IRAttributeValue`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…builder)" Merge the two list in `IRFunction` by adding a `has_default` field in `IRAttributeValue`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…tion` | chore(irbuilder)" Merge the two list in `IRFunction` by adding a `has_default` field in `IRAttributeValue`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…builder)" Merge the two list in `IRFunction` by adding a `has_default` field in `IRAttributeValue`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…tion` | chore(irbuilder)" Merge the two list in `IRFunction` by adding a `has_default` field in `IRAttributeValue`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…builder)" Merge the two list in `IRFunction` by adding a `has_default` field in `IRAttributeValue`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…tion` | chore(irbuilder)" Merge the two list in `IRFunction` by adding a `has_default` field in `IRAttributeValue`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…builder)" Merge the two list in `IRFunction` by adding a `has_default` field in `IRAttributeValue`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…tion` | chore(irbuilder)" Merge the two list in `IRFunction` by adding a `has_default` field in `IRAttributeValue`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…builder)" Merge the two list in `IRFunction` by adding a `has_default` field in `IRAttributeValue`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…tion` | chore(irbuilder)" Merge the two list in `IRFunction` by changing its type to `IRAttributeParameter`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…builder)" Merge the two list in `IRFunction` by changing its type to `IRAttributeParameter`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…tion` | chore(irbuilder)" Merge the two list in `IRFunction` by changing its type to `IRAttributeParameter`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…builder)" Merge the two list in `IRFunction` by changing its type to `IRAttributeParameter`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…tion` | chore(irbuilder)" Merge the two list in `IRFunction` by changing its type to `IRAttributeParameter`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…builder)" Merge the two list in `IRFunction` by changing its type to `IRAttributeParameter`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…tion` | chore(irbuilder)" Merge the two list in `IRFunction` by changing its type to `IRAttributeParameter`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…builder)" Merge the two list in `IRFunction` by changing its type to `IRAttributeParameter`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
…feat(op_schema)" [ghstack-poisoned]
[ghstack-poisoned]
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.
I think your latest changes have probably not been pushed yet!
Yes. ghstack is trying to push 6 changes and they were rejected by github because of our repo settings. Could you help relax that limit? |
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.
Non-blocking minor comments/questions.
onnxscript/type_annotation.py
Outdated
_LIST_CONSTRUCTORS = frozenset([list, typing.List, typing.Sequence, collections.abc.Sequence]) | ||
|
||
# A sorted list of all type strings used in an OpSchema | ||
ALL_TENSOR_TYPE_STRINGS = ( |
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.
nit: must this be hardcoded?
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.
Not sure where else we can find it?
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.
I guess you could compute it by iterating over tensor_type_registry ... it would be convenient to have the to_string
method defined in one of the other PRs.
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.
But do you want the 8-bit floats included in this?
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.
Great, I can use tensor_type_registry. I think 8-floats are fine
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.
Done
raise ValueError(f"Unsupported type: {pytype}") | ||
|
||
|
||
def get_type_constraint_name(pytype: TypeAnnotationValue) -> Optional[str]: |
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.
When is this function used/useful?
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.
…feat(op_schema)" [ghstack-poisoned]
[ghstack-poisoned]
…feat(op_schema)" [ghstack-poisoned]
[ghstack-poisoned]
…feat(op_schema)" [ghstack-poisoned]
[ghstack-poisoned]
…feat(op_schema)" [ghstack-poisoned]
[ghstack-poisoned]
ghstack-source-id: 462ff66 Pull Request resolved: microsoft/onnxscript#631 Signed-off-by: Justin Chu <justinchu@microsoft.com>
ghstack-source-id: fe340e0 Pull Request resolved: microsoft/onnxscript#631 Signed-off-by: Justin Chu <justinchu@microsoft.com>
Stack from ghstack (oldest at bottom):