Closed flatsiedatsie closed 2 months ago
I've created a quick demo on Github pages:
https://flatsiedatsie.github.io/web_llm_vision/
and then I created a Reddit post about your awesome work here:
https://www.reddit.com/r/LocalLLaMA/comments/1fnjnkc/webllm_has_added_support_for_its_first_vision/
I haven't ran into this issue yet, but below are some info.
The adapterInfo is defined here: https://github.com/tqchen/tvm/blob/412aec4e2df8f01ee15f3165d9f740af5190866d/web/src/webgpu.ts#L27-L31
The adapterInfo is populated here: https://github.com/tqchen/tvm/blob/412aec4e2df8f01ee15f3165d9f740af5190866d/web/src/webgpu.ts#L119-L133
Specifically, GPUAdapter.info
(i.e. the adapterInfo
) is documented here: https://www.w3.org/TR/webgpu/#gpuadapter
I am not very sure why info
could be undefined
. Though there is indeed a related API deprecation on requestAdapterInfo() from the WebGPU side, where we adjusted this way: https://github.com/apache/tvm/pull/17371
I wonder if it is because your browser still prefers requestAdapterInfo()
. If not too inconvenient, could you try updating the browser or using a different browser to see if the same issue is observed? Thanks!
Sure, I'll give it a try.
I removed the checking code:
if(K.adapterInfo){ ... }
And then enabled WebGPU on Safari. I saw the same error:
I just found out this is now interfering with all WebLLM inference, not just the Vision model.
This issue affects me as well on Thorium (Chromium) 124 with an Nvidia GPU on Windows, and the proposed solution works for me. As far as the GPUAdapter
reference goes, there are some missing members, including GPUAdapterInfo.
Thanks for all the info, I'll fix it today
Though I believe using the latest chrome should fix it; but I'll make sure we are backward compatible
The issue persists with the latest Thorium (126) but it looks like there have been further releases upstream....
Edit: there are no issues when using a nightly build of Chromium: 131.0.6742.0
Thanks for the info, fix is under the way
0.2.70 should include the fix, please let me know whether it worked on your end, thank you!
the fix does not appear to work on my end, but this may be an unrelated bug.
The updated code is in the index.js
file, see here: index.js
Hmm what is the bug you are seeing?
Still seeing the same error:
// hmm, code still says 2.69
Could it be that the CDN version doesn't always get updated properly?
The CDN seems to take a bit to get updated. Perhaps you can try specify 0.2.70 specifically? https://www.jsdelivr.com/package/npm/@mlc-ai/web-llm
Thanks, that helped.
New error with V2.7:
(no other details in the console)
Which version of brave are you on? I'll try to reproduce on my end
Ahh I can reproduce on [Version 1.65.133 Chromium: 124.0.6367.208 (Official Build) (arm64)
. Taking a look
Turns out I missed an await
. 0.2.71
should fixed this thoroughly: https://github.com/mlc-ai/web-llm/pull/583. I confirmed with Brave 1.65.133
Apologies for the inconvenience!
Glad you found a bug! I just realized I wasn't on the latest version of Brave:
Version 1.67.123 Chromium: 126.0.6478.126 (Official Build) (arm64)
I've upgraded now, and the problem is gone, even without being on 0.2.71.
(and never any need to apologize, the fact that WebLLM even exists is awesome enough)
Glad the issue is solved! Will close this one. Feel free to reopen / open new ones if issues persist
it seems this also is how hardware issues are handled. If the GPU process dies a certain way, you may end up with this error upon reload.
the transformed code appears to be in the build, as well
it seems that the web worker is the issue, and it does not have the latest patch:
I wonder if it is because you need to clear some cached files. I feel like the index.js
on npm is kind of the source of truth of the most updated code: https://www.npmjs.com/package/@mlc-ai/web-llm?activeTab=code
IIUC, the const adapterInfo
line should appear only once, since WebWorker and non-WebWorker call on the same helper function implemented in TVMjs.
Perhaps do something like rm -r lib/ node_modules/ dist/ .parcel-cache
and re-do npm install
and npm run build
I removed .next/
and things worked after, the package was okay but intermediates needed updated
I see! Glad it worked!
I'm trying the Phi3.5 vision demo, but got the error below.
I proceeded to wrap that bit of code in
if(K.adapterInfo){ ... }
And then it started working.
Another thing I then ran into: I'm not allowed to use relative image paths?