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

[WASM] Implement concat embeddings #17404

Merged
merged 2 commits into from
Sep 23, 2024
Merged

Conversation

CharlieFRuan
Copy link
Contributor

This PR implements tvmjs.runtime.ConcatEmbeddings in C++ and exposes it to runtime.ts's Instance class as concatEmbeddings().

The method takes in a vector of NDArray, each array i has shape (m_i, hidden_size), returning an NDArray of shape (\sum_{i} {m}, hidden_size).

Besides, this PR also:

  • Add reserved name std for WebGPU codegen
  • Allow copyFrom()'s data argument to be different types of typed array
  • Allow this.dtype === uint32 for copyFrom()

CharlieFRuan added a commit to mlc-ai/web-llm that referenced this pull request Sep 23, 2024
### Changes
- The only change is the support of Phi-3.5-vision:
  - #563
- Added `Phi-3.5-vision-instruct-q4f16_1-MLC` and
`Phi-3.5-vision-instruct-q4f32_1-MLC` to prebuilt model list
- See `examples/vision-model` on how to use vision language model in
WebLLM

### TVMjs
- Compiled at
apache/tvm@931efc7
  - Cherry-picked apache/tvm#17404 on top
- Note this does not require us to recompile non-vision models because
text-only inputs will not need embeddings concatenation
- WASMs: still the same `v0_2_48` WASMs
@tqchen tqchen merged commit 44808b4 into apache:main Sep 23, 2024
15 checks passed
jzhao62 pushed a commit to jzhao62/web-llm that referenced this pull request Dec 8, 2024
### Changes
- The only change is the support of Phi-3.5-vision:
  - mlc-ai#563
- Added `Phi-3.5-vision-instruct-q4f16_1-MLC` and
`Phi-3.5-vision-instruct-q4f32_1-MLC` to prebuilt model list
- See `examples/vision-model` on how to use vision language model in
WebLLM

### TVMjs
- Compiled at
apache/tvm@931efc7
  - Cherry-picked apache/tvm#17404 on top
- Note this does not require us to recompile non-vision models because
text-only inputs will not need embeddings concatenation
- WASMs: still the same `v0_2_48` WASMs
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