Skip to content

[Relay/TOPI][ONNX/TFLite] Refactor MATRIX_SET_DIAG Operator for Relay… - #9329

Closed
shengxinhu wants to merge 8 commits into
apache:mainfrom
shengxinhu:onnx_trilu
Closed

[Relay/TOPI][ONNX/TFLite] Refactor MATRIX_SET_DIAG Operator for Relay…#9329
shengxinhu wants to merge 8 commits into
apache:mainfrom
shengxinhu:onnx_trilu

Conversation

@shengxinhu

Copy link
Copy Markdown
Contributor

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

@AndrewZhaoLuoAndrewZhaoLuo left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

ok

Copy link
Copy Markdown
ContributorAuthor

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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Eh ok

Comment threadpython/tvm/relay/frontend/onnx.py Outdated
"""Operator converter for Trilu"""

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

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

done

Comment threadpython/tvm/relay/frontend/onnx.py Outdated

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

@AndrewZhaoLuoAndrewZhaoLuoOct 22, 2021

Copy link
Copy Markdown
Contributor

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

shengxinhu commented Oct 27, 2021

Copy link
Copy Markdown
ContributorAuthor

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

@AndrewZhaoLuo

Copy link
Copy Markdown
Contributor

Let me talk to some folks about doing this.

@AndrewZhaoLuo

Copy link
Copy Markdown
Contributor

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

@AndrewZhaoLuoAndrewZhaoLuo mentioned this pull request Nov 15, 2021
7 tasks
@AndrewZhaoLuo

Copy link
Copy Markdown
Contributor

Working on upgrading onnx right now #9511

@shengxinhu

Copy link
Copy Markdown
ContributorAuthor

wait for #9882

@masahi

Copy link
Copy Markdown
Member

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

@AndrewZhaoLuo

AndrewZhaoLuo commented Jan 19, 2022

Copy link
Copy Markdown
Contributor

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

@AndrewZhaoLuo

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

@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.
@areuschareusch 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
Sign up for freeto 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

@shengxinhu@AndrewZhaoLuo@masahi@areusch