Skip to content

Create DFT-20 #5514

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
merged 62 commits into from
Sep 22, 2023
Merged

Create DFT-20 #5514

merged 62 commits into from
Sep 22, 2023

Conversation

justinchuby
Copy link
Member

@justinchuby justinchuby commented Aug 21, 2023

Description

  • Promote the axis attribute to input in DFT-20 and default it to -2. axis is now input number 2, after dft_length.
  • Update documentation for the spec to be clearer
  • Move SoftmaxFamilyDocGenerator to defs and move utilities into the ONNX_NAMESPACE::defs::math::utils namespace
  • Simplify reference evaluator logic

Checklist

  • Update the opset in defs.cc
  • Move the old definition of old.cc
  • Add the operator to onnx/defs/operator_sets.h or onnx/defs/operator_sets_ml.h
  • Create node tests
  • Disable the tests in test_backend_onnxruntime.py
  • Create reference implementation
  • Update version converter (Separate PR)
  • Create shape inference and checker tests
  • Build docs or use the auto update doc label on the GitHub pull request to update the generated documentation

Motivation and Context

Fixes #5447 Fixes #5493

Reference

https://github.com/openxla/xla/blob/main/docs/operation_semantics.md#fft

@justinchuby justinchuby requested a review from a team as a code owner August 21, 2023 18:58
@justinchuby justinchuby marked this pull request as draft August 21, 2023 18:59
Signed-off-by: Justin Chu <justinchu@microsoft.com>
Signed-off-by: Justin Chu <justinchu@microsoft.com>
Signed-off-by: Justin Chu <justinchu@microsoft.com>
Signed-off-by: Justin Chu <justinchu@microsoft.com>
Signed-off-by: Justin Chu <justinchu@microsoft.com>
Signed-off-by: Justin Chu <justinchu@microsoft.com>
Signed-off-by: Justin Chu <justinchu@microsoft.com>
@jcwchen jcwchen modified the milestone: 1.15 Aug 24, 2023
@justinchuby justinchuby added this to the 1.15 milestone Aug 31, 2023
@justinchuby justinchuby added the topic: operator Issues related to ONNX operators label Sep 12, 2023
Signed-off-by: Justin Chu <justinchu@microsoft.com>
Signed-off-by: Justin Chu <justinchu@microsoft.com>
Signed-off-by: Justin Chu <justinchu@microsoft.com>
Signed-off-by: Justin Chu <justinchu@microsoft.com>
Signed-off-by: Justin Chu <justinchu@microsoft.com>
@justinchuby justinchuby added the auto update doc Generate md/proto files automatically using the CI pipeline label Sep 13, 2023
Signed-off-by: Justin Chu <justinchu@microsoft.com>
justinchuby and others added 3 commits September 21, 2023 23:22
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchu@microsoft.com>
Signed-off-by: Justin Chu <justinchu@microsoft.com>
Signed-off-by: Justin Chu <justinchu@microsoft.com>
Signed-off-by: Justin Chu <justinchu@microsoft.com>
Signed-off-by: Justin Chu <justinchu@microsoft.com>
]
value_infos = [make_tensor_value_info("dft_length", TensorProto.INT64, ())]
else:
assert version >= 20

Check warning

Code scanning / CodeQL

Redundant comparison

Test is always true, because of [this condition](1).
int dim_size = result_shape_proto.dim_size();
result_shape_proto.mutable_dim(dim_size - 1)->set_dim_value(2);
updateOutputShape(ctx, output_index, result_shape_proto);
ONNX_ASSERTM(
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this meant for debugging? Seems a very local, straightforward, assertion, wonder if we need it. (nit)

Copy link
Member Author

@justinchuby justinchuby Sep 22, 2023

Choose a reason for hiding this comment

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

It was meant to guard a segfault because new_shape_proto.mutable_dim() will not fail gracefully (when there is a bug)

@justinchuby justinchuby added this pull request to the merge queue Sep 22, 2023
@justinchuby
Copy link
Member Author

Merging for now! Will follow up as needed

Merged via the queue into onnx:main with commit 2026f6b Sep 22, 2023
@justinchuby justinchuby deleted the justinchu/dft branch September 22, 2023 23:43
Copy link
Member

@jcwchen jcwchen left a comment

Choose a reason for hiding this comment

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

The release CIs for testing older NumPy version (1.16.6) seems failed after this PR. @justinchuby could you please take a closer look? I suspect this is related to DFT's reference implementation. The tests with the latest NumPy is fine, but the tests for NumPy==1.16.6 failed: https://github.com/onnx/onnx/actions/runs/6280136187/job/17056899644.

github-merge-queue bot pushed a commit that referenced this pull request Sep 27, 2023
Implement version converter to complete DFT-20.

Requires #5514 

Reference: #5514 (comment)

---------

Signed-off-by: Justin Chu <justinchu@microsoft.com>
Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>
Co-authored-by: Ganesan Ramalingam <grama@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto update doc Generate md/proto files automatically using the CI pipeline module: reference implementation module: shape inference Issues related to shape inference topic: operator Issues related to ONNX operators
Projects
None yet
Development

Successfully merging this pull request may close these issues.

What happens when axis of DFT - 17 is 0? [Feature request] Promote axis in DFT to dynamic
5 participants