mlc-llm icon indicating copy to clipboard operation
mlc-llm copied to clipboard

[Question] How do you convert .bin files to wasm. Also where are TVM_HOME and MLC_HOME located?

Open justrach opened this issue 1 year ago • 3 comments

❓ General Questions

Hi there, from this documentation: https://llm.mlc.ai/docs/install/emcc.html#step-2-set-tvm-home-and-mlc-llm-home

Where do you find the paths for these two items, are they part of the python package or must they be installed as seperate packages?

export TVM_HOME=/path/to/3rdparty/tvm
export MLC_LLM_HOME=/path/to/mlc-llm

Also would you guys happen to know how do I build a .wasm build from the .bin files as well! Thanks :)

justrach avatar May 17 '24 05:05 justrach

clone the repo TVM is in https://github.com/mlc-ai/mlc-llm/tree/main/3rdparty MLC_LLM is there, too

here's some of the output of mlc_llm compile --help

--output OUTPUT, -o OUTPUT The path to the output file. The suffix determines if the output file is a shared library or objects. Available suffixes: 1) Linux: .so (shared), .tar (objects); 2) macOS: .dylib (shared), .tar (objects); 3) Windows: .dll (shared), .tar (objects); 4) Android, iOS: .tar (objects); 5) Web: .wasm (web assembly). (required)

after you have EMSDK installed per your directions up there, you should be able to build a WASM binary

electroglyph avatar May 19 '24 10:05 electroglyph

MLC_HOME

lengjing606 avatar May 20 '24 00:05 lengjing606

clone the repo TVM is in https://github.com/mlc-ai/mlc-llm/tree/main/3rdparty MLC_LLM is there, too

here's some of the output of mlc_llm compile --help

--output OUTPUT, -o OUTPUT The path to the output file. The suffix determines if the output file is a shared library or objects. Available suffixes: 1) Linux: .so (shared), .tar (objects); 2) macOS: .dylib (shared), .tar (objects); 3) Windows: .dll (shared), .tar (objects); 4) Android, iOS: .tar (objects); 5) Web: .wasm (web assembly). (required)

after you have EMSDK installed per your directions up there, you should be able to build a WASM binary

So this wouldn't work with the direct pip installs for MLC right, I would have to build it from scratch instead to get a working MLC build for WASM

justrach avatar May 20 '24 01:05 justrach

you can use the pip insall, but still need to obtain a copy of the source code

tqchen avatar May 28 '24 02:05 tqchen