This repository has been archived by the owner on May 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 58
[Op][Layout] Add layout_transform operator in Relax. #403
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
psrivas2
changed the title
[WIP][Op][Layout] Add layout_transform operator in Relax.
[Op][Layout] Add layout_transform operator in Relax.
Feb 3, 2023
masahi
reviewed
Feb 3, 2023
YuchenJin
approved these changes
Feb 3, 2023
tqchen
reviewed
Feb 3, 2023
MasterJH5574
reviewed
Feb 4, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @psrivas2 for supporting the layout transform op :-) Left a few comments.
tqchen
approved these changes
Feb 7, 2023
Thanks @MasterJH5574 @masahi @tqchen and @YuchenJin for review! |
junrushao
pushed a commit
to junrushao/relax
that referenced
this pull request
Feb 7, 2023
Adds layout_transform operator in Relax as part of Relax layout planning. layout_transform takes an input tensor x and an attribute index_map of tir::IndexMap type. It also has an optional pad_value attribute. It transforms x as per the index_map attribute and returns the transformed tensor. This operator for now allows layout transformations that introduce implicit padding. For example, transforming a tensor of shape (10,) using the lambda i: (i//4, i%4). The output shape will be (3, 4) with two elements padded. The optional pad_value is used to pad if specified, otherwise the compiler is free to choose any value to pad.
junrushao
pushed a commit
that referenced
this pull request
Feb 8, 2023
Adds layout_transform operator in Relax as part of Relax layout planning. layout_transform takes an input tensor x and an attribute index_map of tir::IndexMap type. It also has an optional pad_value attribute. It transforms x as per the index_map attribute and returns the transformed tensor. This operator for now allows layout transformations that introduce implicit padding. For example, transforming a tensor of shape (10,) using the lambda i: (i//4, i%4). The output shape will be (3, 4) with two elements padded. The optional pad_value is used to pad if specified, otherwise the compiler is free to choose any value to pad.
junrushao
pushed a commit
that referenced
this pull request
Feb 8, 2023
Adds layout_transform operator in Relax as part of Relax layout planning. layout_transform takes an input tensor x and an attribute index_map of tir::IndexMap type. It also has an optional pad_value attribute. It transforms x as per the index_map attribute and returns the transformed tensor. This operator for now allows layout transformations that introduce implicit padding. For example, transforming a tensor of shape (10,) using the lambda i: (i//4, i%4). The output shape will be (3, 4) with two elements padded. The optional pad_value is used to pad if specified, otherwise the compiler is free to choose any value to pad.
junrushao
pushed a commit
that referenced
this pull request
Feb 8, 2023
Adds layout_transform operator in Relax as part of Relax layout planning. layout_transform takes an input tensor x and an attribute index_map of tir::IndexMap type. It also has an optional pad_value attribute. It transforms x as per the index_map attribute and returns the transformed tensor. This operator for now allows layout transformations that introduce implicit padding. For example, transforming a tensor of shape (10,) using the lambda i: (i//4, i%4). The output shape will be (3, 4) with two elements padded. The optional pad_value is used to pad if specified, otherwise the compiler is free to choose any value to pad.
junrushao
pushed a commit
that referenced
this pull request
Feb 8, 2023
Adds layout_transform operator in Relax as part of Relax layout planning. layout_transform takes an input tensor x and an attribute index_map of tir::IndexMap type. It also has an optional pad_value attribute. It transforms x as per the index_map attribute and returns the transformed tensor. This operator for now allows layout transformations that introduce implicit padding. For example, transforming a tensor of shape (10,) using the lambda i: (i//4, i%4). The output shape will be (3, 4) with two elements padded. The optional pad_value is used to pad if specified, otherwise the compiler is free to choose any value to pad.
junrushao
pushed a commit
that referenced
this pull request
Feb 9, 2023
Adds layout_transform operator in Relax as part of Relax layout planning. layout_transform takes an input tensor x and an attribute index_map of tir::IndexMap type. It also has an optional pad_value attribute. It transforms x as per the index_map attribute and returns the transformed tensor. This operator for now allows layout transformations that introduce implicit padding. For example, transforming a tensor of shape (10,) using the lambda i: (i//4, i%4). The output shape will be (3, 4) with two elements padded. The optional pad_value is used to pad if specified, otherwise the compiler is free to choose any value to pad.
junrushao
pushed a commit
that referenced
this pull request
Feb 9, 2023
Adds layout_transform operator in Relax as part of Relax layout planning. layout_transform takes an input tensor x and an attribute index_map of tir::IndexMap type. It also has an optional pad_value attribute. It transforms x as per the index_map attribute and returns the transformed tensor. This operator for now allows layout transformations that introduce implicit padding. For example, transforming a tensor of shape (10,) using the lambda i: (i//4, i%4). The output shape will be (3, 4) with two elements padded. The optional pad_value is used to pad if specified, otherwise the compiler is free to choose any value to pad.
5 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds
layout_transform
operator in Relax as part of Relax layout planning.layout_transform
takes an input tensorx
and an attributeindex_map
oftir::IndexMap
type. It also has an optionalpad_value
attribute.It transforms
x
as per theindex_map
attribute and returns the transformed tensor.This operator for now allows layout transformations that introduce implicit padding. For example, transforming a tensor of shape
(10,)
using thelambda i: (i//4, i%4)
. The output shape will be(3, 4)
with two elements padded. The optionalpad_value
is used to pad if specified, otherwise the compiler is free to choose any value to pad.