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

[WIP] Add support for TupleGetItem node in Operator fusion #2899

Closed
wants to merge 1 commit into from

Conversation

masahi
Copy link
Member

@masahi masahi commented Mar 26, 2019

A partial fix for #2890. It can enable fuse through TupleGetItem node.

Example: GRU

%14 = fn (%X: Tensor[(1, 10), float32], %W: Tensor[(30, 10), float32]) -> Tensor[(1, 10), float32] {
  %1 = fn (%p0: Tensor[(1, 10), float32], %p1: Tensor[(30, 10), float32], __dict__=meta[StrMap][0]) -> Tensor[(1, 30), float32] {
    %0 = nn.dense(%p0, %p1, units=None)
    %0
  }
  %2 = %1(%X, %W)
  %12 = fn (%p01: Tensor[(1, 30), float32], __dict__=meta[StrMap][1]) -> Tensor[(1, 10), float32] {
    %3 = split(%p01, indices_or_sections=int64(3), axis=1)
    %4 = %3.0
    %5 = sigmoid(%4)
    %6 = %3.1
    %7 = tanh(%6)
    %8 = %3.2
    %9 = exp(%8)
    %10 = multiply(%7, %9)
    %11 = add(%5, %10)
    %11
  }
  %13 = %12(%2)
  %13
}

@tqchen
Copy link
Member

tqchen commented Mar 26, 2019

Please also add an execution example to confirm we can generate correct code for cpu/gpu. Please tag more reviewers

@masahi masahi changed the title [Relay] Add support for TupleGetItem node in Operator fusion [WIP] Add support for TupleGetItem node in Operator fusion Mar 26, 2019
@masahi
Copy link
Member Author

masahi commented Mar 26, 2019

Looks like my modification is not quite right. Will spend more time on it.

@masahi masahi closed this Mar 26, 2019
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.

2 participants