Skip to content

Label encoder with tensor attributes #5453

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

Merged

Conversation

adityagoel4512
Copy link
Contributor

@adityagoel4512 adityagoel4512 commented Jul 30, 2023

Description

This PR adds keys_as_tensor and values_as_tensor attributes as discussed in #5412. This is intended to be in line with the approach followed when introducing tensor attributes to operators previously like TreeEnsemble* operators so converter libraries require no code change.

This requires a bump to ai.onnx.ml opset 4.

Shape inference tests can also now be applied across versions for ai.onnx.ml operators. Previously this only worked for the default domain.

In this new version of the LabelEncoder, int32_t and int16_t types are also proposed but no additional keys_*/values_* attributes are added.

Motivation and Context

Closes #5412.

Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
@adityagoel4512 adityagoel4512 marked this pull request as ready for review July 31, 2023 08:03
@adityagoel4512 adityagoel4512 requested review from a team as code owners July 31, 2023 08:03
@xadupre
Copy link
Contributor

xadupre commented Jul 31, 2023

Would it be possible to add a test case in folder https://github.com/onnx/onnx/tree/main/onnx/backend/test/case/node/ai_onnx_ml?

adityagoel4512 and others added 5 commits July 31, 2023 18:27
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
adityagoel4512 and others added 4 commits August 2, 2023 16:02
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
adityagoel4512 and others added 4 commits August 17, 2023 13:16
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Copy link
Contributor

@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.

LGTM, thanks for the PR. One minor comment/nit left in the review.

Signed-off-by: Aditya Goel <agoel4512@gmail.com>
…tyagoel4512/onnx into label_encoder_with_tensor_attributes

Signed-off-by: Aditya Goel <agoel4512@gmail.com>
@adityagoel4512 adityagoel4512 force-pushed the label_encoder_with_tensor_attributes branch from 9bd2062 to 750af66 Compare August 22, 2023 11:02
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
@adityagoel4512 adityagoel4512 force-pushed the label_encoder_with_tensor_attributes branch from a04a822 to 45eac0f Compare August 22, 2023 15:27
@adityagoel4512
Copy link
Contributor Author

Great, if resolved now can this be added to the merge queue please

@gramalingam gramalingam added this pull request to the merge queue Aug 22, 2023
Merged via the queue into onnx:main with commit c4f68dd Aug 22, 2023
@adityagoel4512 adityagoel4512 deleted the label_encoder_with_tensor_attributes branch August 23, 2023 08:58
github-merge-queue bot pushed a commit that referenced this pull request Aug 23, 2023
### Description
In #5453, we should have added support
for double inputs. This PR adds double input tensor support.

---------

Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: Aditya Goel <48102515+adityagoel4512@users.noreply.github.com>
corwinjoy pushed a commit to corwinjoy/onnx that referenced this pull request Sep 5, 2023
### Description
<!-- - Describe your changes. -->
This PR adds `keys_as_tensor` and `values_as_tensor` attributes as
discussed in onnx#5412. This is intended
to be in line with the approach followed when introducing tensor
attributes to operators previously like TreeEnsemble* operators so
converter libraries require no code change.

This requires a bump to `ai.onnx.ml` opset 4.

Shape inference tests can also now be applied across versions for
`ai.onnx.ml` operators. Previously this only worked for the default
domain.

In this new version of the LabelEncoder, `int32_t` and `int16_t` types
are also proposed but no additional `keys_*`/`values_*` attributes are
added.

### Motivation and Context
Closes onnx#5412.

---------

Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: Aditya Goel <48102515+adityagoel4512@users.noreply.github.com>
Signed-off-by: Corwin Joy <corwinjoy@gmail.com>
corwinjoy pushed a commit to corwinjoy/onnx that referenced this pull request Sep 5, 2023
### Description
In onnx#5453, we should have added support
for double inputs. This PR adds double input tensor support.

---------

Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: Aditya Goel <48102515+adityagoel4512@users.noreply.github.com>
Signed-off-by: Corwin Joy <corwinjoy@gmail.com>
corwinjoy pushed a commit to corwinjoy/onnx that referenced this pull request Sep 5, 2023
### Description
<!-- - Describe your changes. -->
This PR adds `keys_as_tensor` and `values_as_tensor` attributes as
discussed in onnx#5412. This is intended
to be in line with the approach followed when introducing tensor
attributes to operators previously like TreeEnsemble* operators so
converter libraries require no code change.

This requires a bump to `ai.onnx.ml` opset 4.

Shape inference tests can also now be applied across versions for
`ai.onnx.ml` operators. Previously this only worked for the default
domain.

In this new version of the LabelEncoder, `int32_t` and `int16_t` types
are also proposed but no additional `keys_*`/`values_*` attributes are
added.

### Motivation and Context
Closes onnx#5412.

---------

Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: Aditya Goel <48102515+adityagoel4512@users.noreply.github.com>
Signed-off-by: Corwin Joy <corwinjoy@gmail.com>
corwinjoy pushed a commit to corwinjoy/onnx that referenced this pull request Sep 5, 2023
### Description
In onnx#5453, we should have added support
for double inputs. This PR adds double input tensor support.

---------

Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: Aditya Goel <48102515+adityagoel4512@users.noreply.github.com>
Signed-off-by: Corwin Joy <corwinjoy@gmail.com>
corwinjoy pushed a commit to corwinjoy/onnx that referenced this pull request Sep 5, 2023
### Description
In onnx#5453, we should have added support
for double inputs. This PR adds double input tensor support.

---------

Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: Aditya Goel <48102515+adityagoel4512@users.noreply.github.com>
Signed-off-by: Corwin Joy <corwinjoy@gmail.com>
@liqunfu
Copy link
Collaborator

liqunfu commented Sep 18, 2023

@adityagoel4512 , thank you for contributing to ONNX. Now I am preparing ONNX 1.15.0 release and integrating the release with ORT, I wonder if you have a plan to implement the runtime kernel for this updated op in ORT? If so, I will let you know once ORT has ONNX 1.15.0 integrated. Thank you in advance.
I see you also added RegexFullMatch, StringConcat, and StringSplit. Please let me know if you have plan to add implementations for these new ops in ORT. Thank you.

@adityagoel4512
Copy link
Contributor Author

adityagoel4512 commented Sep 18, 2023

Hi @liqunfu. Yes, I intend to implement the runtime kernels once ORT integrates the new ONNX release. I would appreciate being notified once this is possible.

@liqunfu
Copy link
Collaborator

liqunfu commented Sep 27, 2023

Hi @liqunfu. Yes, I intend to implement the runtime kernels once ORT integrates the new ONNX release. I would appreciate being notified once this is possible.

@adityagoel4512 , onnx rel-1.15.0 branch is in ORT now. (microsoft/onnxruntime#17125). @skottmckay has mentioned to me that There are also regex and string manipulation ops in onnxruntime-extensions: onnxruntime-extensions/operators/text at main · microsoft/onnxruntime-extensions (github.com). See if it helps. Thank you, Liqun

@gramalingam
Copy link
Contributor

Hi @liqunfu. Yes, I intend to implement the runtime kernels once ORT integrates the new ONNX release. I would appreciate being notified once this is possible.

Hi @adityagoel4512 : it would be great if you could try this. Sometimes we find minor issues with the ONNX spec that need to be fixed when we try to implement it. It would be helpful to identify this before ONNX is released. Thanks!

@adityagoel4512
Copy link
Contributor Author

Hi @liqunfu. Yes, I intend to implement the runtime kernels once ORT integrates the new ONNX release. I would appreciate being notified once this is possible.

Hi @adityagoel4512 : it would be great if you could try this. Sometimes we find minor issues with the ONNX spec that need to be fixed when we try to implement it. It would be helpful to identify this before ONNX is released. Thanks!

Will take a look! I wasn't aware ORT would support 1.15 before the ONNX release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature request] LabelEncoder with Tensor attributes
5 participants