feat: add local-cluster MoE, dense sharding, and WebGPU workers#380
feat: add local-cluster MoE, dense sharding, and WebGPU workers#380gauravsaini wants to merge 5 commits into
Conversation
|
@JustVugg: Alla vostra attenzione 😀 |
|
Heads-up: |
|
Rebase needed: this has been in conflict against |
|
This bundles three big features (local-cluster MoE, dense sharding, WebGPU workers) in +1408 lines and conflicts with current |
|
Sure , will try to do it in coming week if that's ok. |
|
Thanks for this, and apologies for the slow first response — it's a big PR from a first-time contributor and it deserved an answer sooner. Two blockers before content review, one mechanical and one about scope. Mechanical: the PR modifies Scope: this bundles three substantial and largely independent features — local-cluster MoE, dense sharding, and WebGPU workers — at ~1,400 lines across 9 files including a new Python module and browser worker code. Reviewed as one unit, the honest answer is that I cannot merge it: any one of the three failing would block the other two, and I have no way to validate a distributed cluster path or a WebGPU path. Split into three PRs, each becomes assessable on its own terms, and the strongest one can land while the others get discussed. If I had to pick where to start: dense sharding is closest to the engine's existing concerns and easiest to validate against the current tier code. The cluster and WebGPU pieces raise design questions worth their own threads — particularly how a cluster path interacts with the expert cache and the RAM budget, which the engine now enforces against measured RSS (#403). Not a rejection. It is a request to make the work reviewable, and a warning that as one 1,400-line bundle touching a file that no longer exists, it will keep sitting here. |
|
#550 - Here is the one just for dense sharding targetted for dev and I'll still send the remaining two independently and close this one |
|
Closing this as superseded — and thank you for doing exactly what was asked: you split it into three reviewable PRs (#550 dense MLP sharding, #551 distributed expert workers, #552 WebGPU workers). That's the right shape, and each can now be assessed on its own terms. Full credit for the work; it lives on in the three split PRs, which is where review will continue. Reopen if I've missed something that isn't covered by the split. |
Summary
This PR adds a progressive local-cluster execution path for consumer Macs and browser/WebGPU devices:
The coordinator keeps token generation, routing, attention, and KV state local. Remote workers execute assigned expert FFNs or dense MLP ranges.
Validation
make testScope and follow-ups
The WebGPU path currently uses f32 buffers and is intended for a trusted LAN. TLS/authentication, WebRTC transport, quantized WebGPU weight formats, and broader dense/tensor-parallel sharding can follow as separate changes.
Not yet tested (sorry for being gpu poor) :
Real C coordinator → dense worker COLIDN01 end-to-end
Dense shard output equivalence against local computation
Real C → WebGPU browser integration
WebGPU FFN numerical correctness against a CPU reference
Exporter tests
Actual iPhone/Android/WebGPU hardware smoke test