Skip to content

Conversation

@bfgoldstein
Copy link
Contributor

This commit is based on PR #9329 proposed by @shengxinhu.

Refactor MATRIX_SET_DIAG operator in Relay/TOPI to support ONNX Trilu operator;
+ Fixed issues related to shape transformation of inputs in TFLite and ONNX frontend ops.

@AndrewZhaoLuo PTAL

bfgoldstein and others added 13 commits March 23, 2022 16:13
Added hardswish support to TVM CI and fixed unit test.

- Add class HardSwish and added its reference to convert_map in onnx.py;
- Removed test_hardswish entry from test_forward.py;
Fixing onnx.py format.
…/TOPI to support ONNX Trilu operator

    This commit is based on PR apache#9329 proposed by @shengxinhu.

    Refactor MATRIX_SET_DIAG operator in Relay/TOPI to support ONNX Trilu operator;
    + Fixed issues related to shape transformation of inputs in tflite and onnx frontend ops.
@AndrewZhaoLuo AndrewZhaoLuo self-requested a review April 1, 2022 21:00
Copy link
Contributor

@jwfromm jwfromm left a comment

Choose a reason for hiding this comment

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

Thanks for this change, it overall seems excellent. I left a few nitpicks and questions.

for dtype in ["float32", "int32"]:
verify_matrix_set_diag((2, 2), (2,), dtype)
verify_matrix_set_diag((4, 3, 3), (4, 3), dtype)
verify_matrix_set_diag((2, 3, 4), (2, 3), dtype, 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious, why are these tests removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This has been removed in the original PR. I ended up not putting it back and testing it again. Thanks for pointing it out since the test_matrix_set_diag is outputting an error for these three cases. I will check it out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Josh, these three TOPI test cases are still not passing. I am debugging it to solve the Tensor dimension mismatch issue.

.set_num_inputs(4)
.add_argument("input", "Tensor", "Input Tensor.")
.add_argument("diagonal", "Tensor", "Values to be filled in the diagonal.")
.add_argument("k1", "Tensor", "ILower limit (included) of the range of diagonals.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Small typo here "ILower" -> "Lower"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I will fix it.

matrix_set_diag_result = topi.transform.matrix_set_diag(input, diagonal, (k1, k2), align)

k_one, k_two = None, None
if isinstance(k, (tuple, list)):
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add some comments to this test? It's a little hard to follow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. I will add some comments and update the PR.

-- Fixed typo in transform.cc;
-- Adding comments to verify_matrix_set_diag on test_topi_transform.py;
-- Rollback TOPI tests set in test_matrix_set_diag;
-- Rollback TFLite frontend convert_matrix_diag method;
---  For some reason (maybe some package version), removing the last dimension was necessary (on Macbook M1);
--- When moving to Linux, the old version was running smoothly and test passed;

- Andrew's comments:
-- Small change into matrix_set_diag of include/tvm/topi/transform.h;
-- Fixed comment in relay/op/tensor/transform.cc
@mikepapadim
Copy link
Contributor

@bfgoldstein what is the status on this one?

@bfgoldstein
Copy link
Contributor Author

@bfgoldstein what is the status on this one?

@mikepapadim, it is on hold. I will try to work on that by early next week.

@mikepapadim
Copy link
Contributor

@bfgoldstein what is the status on this one?

@mikepapadim, it is on hold. I will try to work on that by early next week.

no worries, I was looking into the trilu ticket and I bumped into this PR.

@bfgoldstein
Copy link
Contributor Author

@bfgoldstein what is the status on this one?

@mikepapadim, it is on hold. I will try to work on that by early next week.

no worries, I was looking into the trilu ticket and I bumped into this PR.

No problem! I bump into two special test cases which the TOPI is not passing. I had to put it on hold due to priorities.

@areusch areusch added needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it and removed needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it labels Oct 19, 2022
@tqchen tqchen closed this Dec 10, 2024
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.

6 participants