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

[Debt] Make tvmjs an npm package, simplify build from source #570

Merged
merged 2 commits into from
Sep 23, 2024

Conversation

CharlieFRuan
Copy link
Contributor

In the past, building WebLLM from source could be cumbersome as users needed to build TVMjs by themselves by setting up emscripten and running ./scripts/prep_deps.sh, while TVMjs is, most of the time, not where the users may want to modify the code.

This PR modifies package.json's "tvmjs": "file:./tvm_home/web", to "@mlc-ai/tvmjs": "0.18.0-dev0",, as we uploaded TVMjs as an npm package, so users no longer need to run ./scripts/prep_deps.sh.

We update README.md's directions for building from source accordingly.

Users can still build TVMjs from source with similar steps as before, as described in the README.md.

Note that an extra step required by this change is addressing "import require$$4 from 'ws'" and const WebSocket = require(\"ws\") in lib/index.js and lib/index.js.map after npm run build. We take care of it in cleanup-idnex-js.sh by following similar measures for perf_hooks.

@CharlieFRuan CharlieFRuan merged commit c85d64c into mlc-ai:main Sep 23, 2024
1 check passed
CharlieFRuan added a commit that referenced this pull request Sep 23, 2024
No breaking changes or API-related changes.

### Changes

- #571
- #570
- This is the major change in this version, where we now depend on the
packaged TVMjs: `@mlc-ai/web-runtime`. This only changes how users build
WebLLM from source
- Since `@mlc-ai/web-runtime` is not an official package from
`apache/tvm`, we record the commit that it is built upon in the WebLLM
version bump PR, like below

### TVMjs
- Version `0.18.0-dev0`
- Built at
apache/tvm@30fb16a
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.

1 participant