Skip to content

Conversation

Move version_utils to `_internal` so that it can be used my onnxscript

[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]
@justinchuby justinchuby changed the base branch from main to gh/justinchuby/17/base April 27, 2023 16:50
@justinchuby justinchuby added the change base before merge Remember to change the merge base to main when the PR is ready to merge label Apr 27, 2023
justinchuby added a commit that referenced this pull request Apr 27, 2023
ghstack-source-id: 356be97
Pull Request resolved: #631

Signed-off-by: Justin Chu <justinchu@microsoft.com>
Copy link
Collaborator

@gramalingam gramalingam left a 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!

@justinchuby
Copy link
Collaborator Author

justinchuby commented Apr 27, 2023

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?

Copy link
Contributor

@BowenBao BowenBao left a 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.

_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 = (
Copy link
Contributor

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?

Copy link
Collaborator Author

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?

Copy link
Collaborator

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.

Copy link
Collaborator

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?

Copy link
Collaborator Author

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

Copy link
Collaborator Author

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]:
Copy link
Contributor

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It’s used for converting Python function signatures into onnx type constraints. The tests show usage. You can find actual usage in #626 and #674

justinchuby added a commit that referenced this pull request Apr 27, 2023
@justinchuby justinchuby changed the base branch from gh/justinchuby/17/base to main April 27, 2023 22:41
@justinchuby justinchuby merged commit 0b633ea into main Apr 28, 2023
@justinchuby justinchuby deleted the gh/justinchuby/17/head branch April 28, 2023 03:46
Indie365 pushed a commit to Indie365/onnxscript that referenced this pull request Oct 26, 2023
ghstack-source-id: 462ff66
Pull Request resolved: microsoft/onnxscript#631

Signed-off-by: Justin Chu <justinchu@microsoft.com>
Indie365 pushed a commit to Indie365/onnxscript that referenced this pull request Oct 26, 2023
ghstack-source-id: fe340e0
Pull Request resolved: microsoft/onnxscript#631

Signed-off-by: Justin Chu <justinchu@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change base before merge Remember to change the merge base to main when the PR is ready to merge topic: typing Typing related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants