forked from apache/tvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bugfix][SLM] Produce well-formed Relax for nn.modules.KVCache (apach…
…e#16684) * [Bugfix][SLM] Produce well-formed Relax for nn.modules.KVCache Prior to this commit, the `nn.modules.KVCache` implementations used `R.call_packed(...)` to call the `"vm.builtin.attention_*"` functions. Since `nn.Module` emits all relax functions within a `relax.DataflowBlock`, where impure expressions are forbidden, this is ill-formed. This commit updates the implementations in `nn.modules.KVCache` to use `R.call_pure_packed` instead of `R.call_packed`. This assertation that the callee is pure allows the call to occur within a `relax.DataflowBlock`. * Correct import for relax * Fix unit test
- Loading branch information
1 parent
9484836
commit 484c6c1
Showing
3 changed files
with
28 additions
and
13 deletions.
There are no files selected for viewing
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
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
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