Repository navigation
feat(streaming): add AirLLM-style sliding-window layer streamer with double-buffered ring - #2458
Open
presentyourlove wants to merge 1 commit into
Conversation
…double-buffered ring
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR implements AirLLM-Style Sliding-Window Layer Streaming (
SlidingWindowLayerStreamer) using an asynchronous double-buffered ring pipeline and zero-dirty-page clean eviction, enabling 70B parameter models to run on memory-constrained edge hardware with 2GB–4GB RAM.Background & Motivation
In extreme edge hardware environments (e.g. legacy laptops, mini PCs with 2GB–4GB RAM), storing even 2-bit quantized 70B model weights (7GB–18GB) exceeds physical memory capacity, while OS swap causes catastrophic thrashing.
Because Transformer forward inference proceeds strictly layer-by-layer sequentially, retaining only the currently active layer in RAM and prefetching the subsequent layer over a double-buffered ring decouples memory capacity from total model parameter count.
Key Changes
Streaming Data Models (
src/exo/shared/types/streaming_layer.py):LayerStreamingConfig: Configuration defining streaming mode, buffer size limit, and clean page eviction toggle.LayerDiskMetadata: Location descriptor tracking layer offsets, file paths, and byte sizes.StreamedLayerBuffer: Status descriptor representing double-buffering slots (slot_a,slot_b).StreamingPipelineTelemetry: Tracks peak resident RAM, swap latency, and I/O overlap ratio.Sliding Window Layer Streamer Engine (
src/exo/worker/engines/streaming/layer_streamer.py):Module Exports (
src/exo/worker/engines/streaming/__init__.py):SlidingWindowLayerStreamer.Unit Tests (
src/exo/shared/tests/test_sliding_window_streamer.py):Verification
.venv/Scripts/pytest.exe src/exo/shared/tests/test_sliding_window_streamer.py # 4 passed in 0.15s.venv/Scripts/ruff.exe check src/exo/shared/types/streaming_layer.py src/exo/worker/engines/streaming/layer_streamer.py src/exo/worker/engines/streaming/__init__.py src/exo/shared/tests/test_sliding_window_streamer.py # All checks passed!Related Issues
人人都能跑llm.md(AirLLM-Style Sliding Window Layer Streaming)