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

Chrome demo frequently terminates while loading #322

Closed
neubig opened this issue Feb 29, 2024 · 18 comments
Closed

Chrome demo frequently terminates while loading #322

neubig opened this issue Feb 29, 2024 · 18 comments

Comments

@neubig
Copy link

neubig commented Feb 29, 2024

Thank you for the great project! I'm playing with the chrome extension. It works some of the time, but it also frequently (>50% of the time) dies while loading the model. The progress bar stops half-way through, and this is what I see in the console when I inspect the plugin popup:

Screenshot 2024-02-29 at 8 45 24 AM

I'm using:

  • Chrome: Version 122.0.6261.94 (Official Build) (arm64)
  • web-llm: ab26e65

I'm happy to help debug in any way.

@kudaibergenu
Copy link

I am experiencing the same problem. So far, I understood the problem starts once it tries to pull the models from the cache.

@CharlieFRuan
Copy link
Contributor

Apologies for the inconvenience, I'll look into this issue today. Meanwhile, clearing chrome's cache might alleviate the problem.

@CharlieFRuan
Copy link
Contributor

CharlieFRuan commented Mar 2, 2024

@neubig @kudaibergenu Just updated the npm to 0.2.24: #323

This should fix it. Let us know if issues persist. Thank you!

@neubig
Copy link
Author

neubig commented Mar 2, 2024

Thanks for the fast response @CharlieFRuan !
I upgraded to the latest version and it does seem to not be hanging anymore, so I'll close the issue.

@neubig neubig closed this as completed Mar 2, 2024
@mrsheep76
Copy link

I'm still experiencing this issue even after updating to the latest version (0.2.24).

Would you be open to further investigation? Some notes from my own experience:

  • It happens 90%+ of the time
  • The progress bar usually gets about 70-80% finished before the crash
  • Clearing the Chrome cache temporarily fixes the problem, but it begins immediately again on the next reload from cache
  • I reproduced it at least once from the "get-started" example (not Chrome extension), but it seems to happen somewhat less often than in the Chrome extension.

Happy to help chase this down - thanks!

@CharlieFRuan
Copy link
Contributor

Hi @mrsheep76 what is the error that you are seeing? Is it also exit(1)? Would be great if you could share a screenshot of the console/UI

@mrsheep76
Copy link

Hi @CharlieFRuan - yes, same error as described at the top of this bug - exit(1). I made sure to rebuild the plug-in (npm run build) with the new version of the npm with your changes. Here is a Console screenshot, which I took from inspecting the plug-in popup:

Screenshot 2024-03-07 at 10 06 46 AM

And here is the UI after it crashed:
Screenshot 2024-03-07 at 10 12 35 AM

Let me know if there's anything else I can do to gather information - and thanks for investigating!

@neubig
Copy link
Author

neubig commented Mar 7, 2024

And actually I'm still encountering crashes as well, although it seems less frequent than before.

@neubig neubig reopened this Mar 7, 2024
@CharlieFRuan
Copy link
Contributor

@mrsheep76 @neubig Thanks for the info, I'll look into it today!

@CharlieFRuan
Copy link
Contributor

CharlieFRuan commented Mar 10, 2024

@mrsheep76 @neubig I was not able to replicate the error (either via simple chat or the chrome extension example). But I published 0.2.25, with the hope of fixing this (assuming the issue is due to parallelly downloading too many shards at the same time). For more description, see #328. Let me know, thanks!

@mrsheep76
Copy link

@CharlieFRuan Thanks for the attempted fix! Unfortunately I'm still getting crashes 90%+ of the time when loading from cache -- same frequency as before from what I can tell. It does occasionally work, so I wonder if there's a race condition somewhere?

Is there any way for me to get a more informative error message and pass it to you, since you cannot reproduce it yourself? The exit(1) is obviously pretty generic...

@CharlieFRuan
Copy link
Contributor

CharlieFRuan commented Mar 11, 2024

Hmm I see; before we further dig into this, could you perhaps try a smaller model, say Gemma 2B (assuming that you are using Mistral 7B q4f16, the default one in the chrome extension example). Not sure how much RAM you have, but it could be that the model is too large? See discussion in #324 for specifics.

@CharlieFRuan
Copy link
Contributor

And I just noticed that it states Loading model from cache in the log, rather than Fetching param cache. This means that all shards of the model parameters are already in the browser cache. Perhaps you can try to clear the cache, and let it fetch the params again. The Cached images and files in chrome should do it:
image

CharlieFRuan added a commit that referenced this issue Mar 12, 2024
Another minor follow-up to version 0.2.24 (or hence to 0.2.25). This PR
adds a `try-catch` when loading the **_already-downloaded_** weights,
attempting to provide more information to the `exit(1)` error in
#322.

The only change is TVMJS's commit
apache/tvm@b193cbb
from apache/tvm#16650
@CharlieFRuan
Copy link
Contributor

I also further bumped to 0.2.26, which adds an additional try-catch, attempting to provide more information to the exit(1).

@neubig
Copy link
Author

neubig commented Mar 13, 2024

Thanks! I tried 4-5 times now, including after clearing cache and every time worked! So maybe this is fixed with the new version. Closing for now, thanks @CharlieFRuan !

@neubig neubig closed this as completed Mar 13, 2024
@CharlieFRuan
Copy link
Contributor

@neubig Thanks for confirming; feel free to reopen any time!

@mrsheep76
Copy link

Good news - it is now working for me as well!

I had a temporary glitch with my build environment during my last test run, so I suspect one of the earlier fixes actually did the trick (perhaps limiting the number of concurrent threads)?

In any case, it is working consistently now. Thank you for all the help!

@CharlieFRuan
Copy link
Contributor

@mrsheep76 Thanks, that is great to hear! Feel free to open new issues if there are other problems

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

No branches or pull requests

4 participants