Skip to content

Conversation

@junrushao
Copy link
Member

This PR introduces sugars for TIR buffer declaration.

Sugar 1. Convenient stride definition by string.

// Previous
stride = T.int32()
A = T.match_buffer(..., strides=(stride,))

// This PR
A = T.match_buffer(..., strides=("s0", ))

Sugar 2. Multiple definition of TIR Var from a single buffer are now merged into a single line.

// Previous
m = T.int32()
n = T.int32()
stride = T.int32()
stride_1 = T.int32()
A = T.match_buffer(a, (m, n), strides=(stride, stride_1))

// This PR
m, n = T.int32(), T.int32()
A = T.match_buffer(a, (m, n), strides=("s0", "s1"))

This PR introduces sugars for TIR buffer declaration.

Sugar 1. Convenient stride definition by string.

```python
// Previous
stride = T.int32()
A = T.match_buffer(..., strides=(stride,))

// This PR
A = T.match_buffer(..., strides=("s0", ))
```

Sugar 2. Multiple definition of TIR Var from a single buffer are now
merged into a single line.

```python
// Previous
m = T.int32()
n = T.int32()
stride = T.int32()
stride_1 = T.int32()
A = T.match_buffer(a, (m, n), strides=(stride, stride_1))

// This PR
m, n = T.int32(), T.int32()
A = T.match_buffer(a, (m, n), strides=("s0", "s1"))
```
@tvm-bot
Copy link
Collaborator

tvm-bot commented Mar 7, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

Generated by tvm-bot

@junrushao junrushao marked this pull request as ready for review March 7, 2023 09:16
Copy link
Member

@tqchen tqchen left a comment

Choose a reason for hiding this comment

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

LGTM

@tqchen tqchen merged commit 2c4af88 into apache:main Mar 7, 2023
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