refactor: remove parallel GPU coordinator, fix streaming backpressure#122
Merged
Conversation
…ng backpressure The parallel GPU coordinator serialized entropy encoding on one thread, bottlenecking at 28 MiB/s. The streaming path's GPU coordinator with adaptive backpressure is the correct architecture for GPU acceleration. Changes: - Remove GPU coordinator from parallel.rs (~900 lines): GpuRequest enum, StageGpu/FusedGpu task variants, gpu_fused_span, pressure_inc/dec, should_route_block_to_gpu_stage0, complete_gpu_stage, and all GPU channel/routing logic. Parallel scheduler is now CPU-only. - Fix one-way backpressure ratchet in streaming.rs: coordinator now decrements pressure by batch_len on completion, preventing permanent GPU lockout (routing went from ~16% to ~62% on mozilla corpus). - Honor Backend::WebGpu in compress_with_options: multi-block GPU requests route through compress_stream with in-memory Cursor I/O, producing framed-format output (transparently decompressible). - Flatten UnifiedTask from single-variant enum to type alias. - Simplify complete_task_lifecycle (remove dead next_task parameter). - Remove dead GPU telemetry methods and atomic fields from LocalSchedulerStats; retain public UnifiedSchedulerStats fields for API stability. - Add criterion benchmark comparing parallel vs streaming GPU paths. - Update CLAUDE.md, DESIGN.md, gpu-strategy.md, pipeline-architecture.md. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
469c061 to
4387364
Compare
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.
Summary
batch_lenon batch completion. Previously, once pressure exceeded the limit notry_sendwas attempted, so pressure could never decrease, permanently locking out GPU. GPU routing went from ~16% → ~62% on the mozilla corpus.Backend::WebGpuincompress_with_options— multi-block GPU requests now route throughcompress_streaminternally (in-memoryCursorI/O), which has the GPU coordinator with adaptive backpressure. Output uses framed format, transparently decompressible bydecompress().Additional cleanup
UnifiedTaskfrom single-variant enum to type alias(usize, usize)complete_task_lifecycle(remove deadnext_taskparameter, alwaysNone)LocalSchedulerStatsgpu_parallel_vs_streaming) comparing all four pathsArchitecture after this PR
compress_blockrespectsBackend::WebGpudirectlycompress_blockrespectsBackend::WebGpudirectlycompress_parallel— CPU-only unified schedulercompress_stream— GPU coordinator with adaptive backpressureTest plan
cargo bench -- gpu_par_vs_stream🤖 Generated with Claude Code