Skip to content

Add simpler distributed runtime (HostWorker/DistWorker) design#1

Open
hw-native-sys-bot wants to merge 3 commits into
mainfrom
docs/simpler-distributed-runtime-design
Open

Add simpler distributed runtime (HostWorker/DistWorker) design#1
hw-native-sys-bot wants to merge 3 commits into
mainfrom
docs/simpler-distributed-runtime-design

Conversation

@hw-native-sys-bot

Copy link
Copy Markdown
Owner

Summary

  • Add comprehensive design document for simpler Phase 2 distributed runtime (HostWorker / DistWorker)
  • Synthesized from simpler/.docs/ design documents: UNIFIED_RUNTIME_PLAN.md, PHASE2_HOST_WORKER.md, HOSTSUB_FORK_SHM_DESIGN.md, PLATFORM_SERVICES_DESIGN.md
  • Describes the L3 DistWorker scheduling engine architecture, HostSubWorker fork+shm design, and unified Worker API

Document Scope

Architecture

  • Unified IWorker interface: ChipWorker (L2 device) / SubWorker (fork+shm Python) / DistWorker (L3+ orchestration)
  • DistWorker scheduling engine: Orch → Scheduler → Worker threads with ready_queue + completion_queue + CV notification
  • HostSubWorker fork+shm: zero-copy tensor sharing, callable registration via COW inheritance, mailbox state machine

Usage

  • Worker(level=N, ...) factory API with symmetric interface across all levels
  • L2 single-chip, L3 multi-chip + SubWorker, L4 recursive composition examples
  • Scope management, dependency inference via tensormap, eager dispatch

Implementation Plan

  • PR 2-1: C++ DistWorker core + nanobind bindings
  • PR 2-2: Python HostWorker wrapper + integration tests
  • PR 2-3: DeviceRunner thread_local + multi-device
  • PR 2-4: Platform comm .so (separate owner)

Relationship with Linqu

  • Maps to linqu_runtime_design.md §3.1: simpler L3 extension
  • Linqu L4-L6 uses simpler's ChipWorker/DistWorker as execution backend via ChipBackend adapter

Test plan

  • Review document for accuracy against simpler/.docs/ source documents
  • Verify consistency with existing linqu_runtime_design.md
  • Confirm type names and file paths match actual simpler codebase

🤖 Generated with Claude Code

ChaoWao and others added 3 commits April 2, 2026 20:59
Comprehensive design doc covering Phase 2 HostWorker implementation:
- Unified IWorker interface (ChipWorker/SubWorker/DistWorker)
- DistWorker scheduling engine with TensorMap/Ring/Scope/Scheduler
- HostSubWorker fork+shm parallel execution with zero-copy tensors
- Worker factory API and usage examples (L2-L4)
- Platform services .so separation design
- PR split plan and relationship with Linqu distributed runtime

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Convert the entire document from Chinese to English to match
the existing documentation style in this repository.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove: implementation progress table, key types, platform services,
  file layout, and PR split plan sections
- Keep only design and usage/examples
- Clarify that simpler IS the implementation of Linqu runtime

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

2 participants