-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[FFI] Re-introduce the boxed primitive values #17257
Merged
tqchen
merged 3 commits into
apache:main
from
Lunderberg:ffi_boxed_primitive_values_take_2
Aug 12, 2024
Merged
[FFI] Re-introduce the boxed primitive values #17257
tqchen
merged 3 commits into
apache:main
from
Lunderberg:ffi_boxed_primitive_values_take_2
Aug 12, 2024
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
…float/bool" (apache#17252)" This reverts commit 11be832.
Initially introduced in apache#16183, these changes were reverted in apache#17252 due to performance degredation in some Relax models. This could occur when a model contained a large number of calls to `"vm.builtin.tuple_getitem"`, which may occur when model weights are provided as a tuple. This PR re-applies the changes from apache#16183, but with the performance degredation resolved. The root cause was unnecessary type-checking when converting from an untyped `tvm::ArrayNode*` to the typed `tvm::Array<T>`, in the case where `T` is `ObjectRef`.
cc @vinx13 , would be great to confirm LLM perf before we merge this |
Confirmed the performance is good |
Thank you on the confirmation! With how many parts could be impacted by this change, I very much appreciate the QC check. |
tqchen
approved these changes
Aug 12, 2024
Lunderberg
added a commit
to Lunderberg/tvm
that referenced
this pull request
Aug 12, 2024
This reverts commit `02f48828e4b56995be0021c9a98e1705a837e712`. The post-merge builds on `main` are failing in CI on both MacOS and Windows. The failure modes do not appear to be caused by the FFI changes, but the FFI changes impact enough parts of TVM that it's difficult to say that definitively.
This was referenced Aug 12, 2024
CharlieFRuan
added a commit
to mlc-ai/web-llm
that referenced
this pull request
Aug 23, 2024
### Change - #555 ### TVMjs - Updated to current head: apache/tvm@1518008 - Main change is apache/tvm#17251 - This is needed for WASMs compiled after apache/tvm#17257 is merged (e.g. Phi-3.5). TVM global functions that returns bool need this PR to run correctly (e.g. `AcceptToken()` in BNFGrammar) in runtime. - However, these are backward compatible to WASMs compiled prior to this PR. Tested with Phi-3 (old WASM) running grammar.
jzhao62
pushed a commit
to jzhao62/web-llm
that referenced
this pull request
Dec 8, 2024
### Change - mlc-ai#555 ### TVMjs - Updated to current head: apache/tvm@1518008 - Main change is apache/tvm#17251 - This is needed for WASMs compiled after apache/tvm#17257 is merged (e.g. Phi-3.5). TVM global functions that returns bool need this PR to run correctly (e.g. `AcceptToken()` in BNFGrammar) in runtime. - However, these are backward compatible to WASMs compiled prior to this PR. Tested with Phi-3 (old WASM) running grammar.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Initially introduced in #16183, these changes were reverted in #17252 due to performance degredation in some Relax models. This could occur when a model contained a large number of calls to
"vm.builtin.tuple_getitem"
, which may occur when model weights are provided as a tuple.This PR re-applies the changes from #16183, but with the performance degredation resolved. The root cause was unnecessary type-checking when converting from an untyped
tvm::ArrayNode*
to the typedtvm::Array<T>
, in the case whereT
isObjectRef
.