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

[TIR] ConvertSSA process entry func first #16236

Merged
merged 2 commits into from Dec 14, 2023

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
18 checks passed
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.

None yet

2 participants