Comments (5)
Powerhouse!
from web-llm.
Thanks for reporting this! I'll look into fixing this, perhaps blocking subsequent chatCompletion()
calls until the previous one is finished, maintaining FCFS. Currently the engine does not support continuous batching, so this may be the only way resolving it as of now. That is, despite you can call multiple chatCompletion()
s concurrently, to ensure correctness, they have to be executed sequentially.
However, if you instantiate multiple engines, two requests can be processed concurrently. We will soon support having multiple models loaded in a single engine, so in that case same thing applies.
from web-llm.
Thank you.
I don't strictly need this to run in parallel (though that would be nice). The concurrency bug is very nonintuitive though and worth fixing.
I did some investigation and this is a gross start, but I think if you separate out this.outputIds.push
per completion, that could fix it.
Some sort of key to identify the specific request and keep track of its specific outputIds
.
from web-llm.
Hi @LEXNY this should be fixed in #549 and reflected in npm 0.2.61. You can check out the PR description for the specifics of the problem and the solution.
Your example now works, though the second request does not start until the first request is finished, as we maintain a FCFS schedule, with only one request running per-model. However, there can be multiple models running in an engine, hence multiple requests can be running per-engine. For more, you can try examples/multi-models
.
from web-llm.
Closing this issue as completed. Feel free to reopen/open new ones if issues arise!
from web-llm.
Related Issues (20)
- Can I initialize existing model with random weights?
- Deply llama 3 40 billion parameters model HOT 4
- Sending raw text to the model HOT 4
- Deploy small LLM in a chrome extension HOT 2
- Runing LLM in a webworker fails due to loglevel dependency HOT 1
- support concurrent inference from multiple models HOT 4
- anyone tried to run web-llm in tauri?
- Request: Allow deletion of individual cached models. HOT 3
- LLama 3.1 Error: Device was lost during reload. This can happen due to insufficient memory or other GPU constraints. Detailed error: [object GPUDeviceLostInfo]. Please try to reload WebLLM with a less resource-intensive model. HOT 4
- Custom model outputs garbage in firefox nightly, works fine in chrome.
- Phi 3 Mini output near random (Phi-3-mini-4k-instruct-q4f16_1-MLC) HOT 10
- Gemma 2 2B crashes on mobile phone HOT 16
- [Tracking][WebLLM] Function calling (beta) and Embeddings HOT 1
- Feature request: engine.preload() HOT 5
- I can't find a method to stop a conversation in progress. HOT 1
- TypeError: Cannot read properties of undefined (reading 'origin') HOT 1
- vercel/ai provider integration HOT 1
- Use subgroup operations when possible HOT 5
- DuckDB-NSQL-7B Model
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web-llm.