Skip to content
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

[NNPA] A rewrite pattern to get dim directly from a zTensor without unstickification. #2624

Merged
merged 5 commits into from
Nov 28, 2023

Conversation

tungld
Copy link
Collaborator

@tungld tungld commented Nov 15, 2023

This patch is to add a rewriting pattern that removes zhigh.unstick when getting dimensions.

For example, the following code

%0 = "zhigh.Unstick"(%arg0) : (tensor<?x?x?xf16, #zhigh.layout<{dataLayout = "3D"}>>) -> tensor<?x?x?xf32>
%1 = "onnx.Dim"(%0) {axis = 1 : si64}: (tensor<?x?x?xf32>) -> tensor<1xi64>

will be replace by

"onnx.Dim"(%arg0) {axis = 1 : si64} : (tensor<?x?x?xf16, #zhigh.layout<{dataLayout = "3D"}>>) 

where the dimension is obtained directly from a zTensor without unstickifying the zTensor.

Copy link
Collaborator

@AlexandreEichenberger AlexandreEichenberger left a comment

Choose a reason for hiding this comment

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

LGTM, makes total sense

@tungld tungld merged commit 4d643da into onnx:main Nov 28, 2023
8 checks passed
@jenkins-droid
Copy link
Collaborator

Jenkins Linux amd64 Build #13521 [push] Get dim directly from zT... started at 20:54

@jenkins-droid
Copy link
Collaborator

Jenkins Linux s390x Build #13548 [push] Get dim directly from zT... started at 21:54

@jenkins-droid
Copy link
Collaborator

Jenkins Linux ppc64le Build #12545 [push] Get dim directly from zT... started at 22:00

@jenkins-droid
Copy link
Collaborator

Jenkins Linux amd64 Build #13521 [push] Get dim directly from zT... failed after 58 min

@jenkins-droid
Copy link
Collaborator

Jenkins Linux s390x Build #13548 [push] Get dim directly from zT... passed after 1 hr 20 min

@jenkins-droid
Copy link
Collaborator

Jenkins Linux ppc64le Build #12545 [push] Get dim directly from zT... passed after 1 hr 57 min

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.

3 participants