Skip to content

Conversation

@shengxinhu
Copy link
Contributor

Refactor MATRIX_SET_DIAG operator in Relay/TOPI to support ONNX Trilu operator

Copy link
Contributor

@AndrewZhaoLuo AndrewZhaoLuo left a comment

Choose a reason for hiding this comment

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

Looks mostly right to me, have a few comments. Will take a closer look later though.

Also please fix the lint issues so we can run CI

// Determining which diagonal/sub-diagonal/super-diagonal it is
k = iter_vars[ndim] - iter_vars[ndim - 1];
diagonal_indices.push_back(k2 - k);
diagonal_indices.push_back(k2(0) - k);
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe (though please check) that you can just do k2() for 0-D tensor access.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

Copy link
Contributor Author

Choose a reason for hiding this comment

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

k2() will report error

Copy link
Contributor

Choose a reason for hiding this comment

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

Eh ok

"""Operator converter for Trilu"""

@classmethod
def _impl_v1(cls, inputs, attr, params):
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be opset14 so _impl_v14

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


@classmethod
def _impl_v1(cls, inputs, attr, params):
upper = attr.get("upper")
Copy link
Contributor

@AndrewZhaoLuo AndrewZhaoLuo Oct 22, 2021

Choose a reason for hiding this comment

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

suggest attr.get("upper", 1) since this appears to be the default in onnx spec

@shengxinhu
Copy link
Contributor Author

shengxinhu commented Oct 27, 2021

onnx and onnxruntime version need to be updated to version 1.10.1 and 1.9.0 respectively for Trilu operator,

@AndrewZhaoLuo
Copy link
Contributor

Let me talk to some folks about doing this.

@AndrewZhaoLuo
Copy link
Contributor

Hmm this will eventually get merged, I might get to upgrading CI next week

@AndrewZhaoLuo AndrewZhaoLuo mentioned this pull request Nov 15, 2021
7 tasks
@AndrewZhaoLuo
Copy link
Contributor

Working on upgrading onnx right now #9511

@shengxinhu shengxinhu requested a review from icemelon as a code owner January 4, 2022 01:44
@shengxinhu
Copy link
Contributor Author

wait for #9882

@masahi
Copy link
Member

masahi commented Jan 18, 2022

The new image with updated ONNX should become available by this week.

@AndrewZhaoLuo
Copy link
Contributor

AndrewZhaoLuo commented Jan 19, 2022

New CI image with updated onnx is (finally up)! Please jostle ci by sending an empty commit

@AndrewZhaoLuo
Copy link
Contributor

@shengxinhu do you still have interest in working to get this PR merged? If not then I can try to shepard this in new branch.

@shengxinhu
Copy link
Contributor Author

@shengxinhu do you still have interest in working to get this PR merged? If not then I can try to shepard this in new branch.

Thanks, please shepard it.

bfgoldstein added a commit to bfgoldstein/tvm that referenced this pull request Apr 1, 2022
…/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.
@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
@shengxinhu shengxinhu closed this Nov 28, 2022
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.

4 participants