Skip to content

Conversation

jinhongyii
Copy link
Contributor

@jinhongyii jinhongyii commented Dec 14, 2023

ConvertSSA is called in SplitHostDevice. The vars which only exists in T.launch_thread extent in device function must be the same as host function, so we need to let ConvertSSA process host function first to avoid var redefine.

@jinhongyii
Copy link
Contributor Author

cc: @tqchen

@tqchen tqchen merged commit b0e146f into apache:main Dec 14, 2023
Lunderberg added a commit to Lunderberg/tvm that referenced this pull request Dec 15, 2023
The buf reported in apache#16237 can be resolved by tracking variable usage
in a thread extent.
Lunderberg added a commit to Lunderberg/tvm that referenced this pull request Dec 18, 2023
The buf reported in apache#16237 can be resolved by tracking variable usage
in a thread extent.
Lunderberg added a commit that referenced this pull request Jan 3, 2024
* [TIR] In SplitHostDevice, check for variables in thread extents

Otherwise, they would be undefined after being de-duplicated by
`ConvertSSA`.

* Revert #16236

The buf reported in #16237 can be resolved by tracking variable usage
in a thread extent.

* lint fixes

* Update TIR well-formed checker for env thread SSA requirements

Environment threads must reuse the same `tir::Var` across all
`AttrStmt` instances in a `PrimFunc`, but must not reuse across
separate `PrimFunc`s in an `IRModule`.

* Update ConvertSSA to handle environment threads' SSA requirements

* lint fix

* Updated docstrings for VerifyWellFormed

* Rely on script.Complete for read/writes

Avoids issue in cortexm unit tests resulting from read/write
annotations being present in the root block, followed by application
of BindParams.

* Typo fix

* Added structural equal comparison in unit test
junrushao pushed a commit to junrushao/tvm that referenced this pull request Jan 7, 2024
…he#16250)

* [TIR] In SplitHostDevice, check for variables in thread extents

Otherwise, they would be undefined after being de-duplicated by
`ConvertSSA`.

* Revert apache#16236

The buf reported in apache#16237 can be resolved by tracking variable usage
in a thread extent.

* lint fixes

* Update TIR well-formed checker for env thread SSA requirements

Environment threads must reuse the same `tir::Var` across all
`AttrStmt` instances in a `PrimFunc`, but must not reuse across
separate `PrimFunc`s in an `IRModule`.

* Update ConvertSSA to handle environment threads' SSA requirements

* lint fix

* Updated docstrings for VerifyWellFormed

* Rely on script.Complete for read/writes

Avoids issue in cortexm unit tests resulting from read/write
annotations being present in the root block, followed by application
of BindParams.

* Typo fix

* Added structural equal comparison in unit test
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