-
Notifications
You must be signed in to change notification settings - Fork 8
transport: add parallel transport and improve resumable transport #130
Conversation
Signed-off-by: Jacob Howard <[email protected]>
Signed-off-by: Jacob Howard <[email protected]>
Signed-off-by: Jacob Howard <[email protected]>
Signed-off-by: Jacob Howard <[email protected]>
Signed-off-by: Jacob Howard <[email protected]>
Signed-off-by: Jacob Howard <[email protected]>
Signed-off-by: Jacob Howard <[email protected]>
Signed-off-by: Jacob Howard <[email protected]>
Signed-off-by: Jacob Howard <[email protected]>
Signed-off-by: Jacob Howard <[email protected]>
Signed-off-by: Jacob Howard <[email protected]>
Signed-off-by: Jacob Howard <[email protected]>
Signed-off-by: Jacob Howard <[email protected]>
Signed-off-by: Jacob Howard <[email protected]>
Signed-off-by: Jacob Howard <[email protected]>
Signed-off-by: Jacob Howard <[email protected]>
Signed-off-by: Jacob Howard <[email protected]>
555f56a to
9212d37
Compare
Signed-off-by: Jacob Howard <[email protected]>
Signed-off-by: Jacob Howard <[email protected]>
9212d37 to
4c1fd8d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a parallel HTTP transport for improved model pull performance, alongside enhancements to the existing resumable transport. Key changes include:
- New parallel transport implementation that automatically splits large downloads into concurrent byte-range requests
- Refactored resumable transport with improved error handling and code organization
- Shared common utilities extracted to reduce code duplication
- Comprehensive test coverage using a shared testing framework
Reviewed Changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| transport/parallel/transport.go | Core parallel transport implementation with concurrent byte-range downloading |
| transport/resumable/transport.go | Refactored resumable transport with improved error handling and shared utilities |
| transport/internal/common/http_utils.go | Shared HTTP utilities for range parsing and header handling |
| transport/internal/testing/fake_transport.go | Common test framework for transport testing |
| transport/internal/bufferfile/fifo.go | FIFO buffer implementation for temporary file-based streaming |
| tools/benchmarks/parallelget/main.go | Command-line benchmark tool for comparing sequential vs parallel downloads |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Signed-off-by: Jacob Howard <[email protected]>
|
Performance comparison on Docker Offload: Performance comparison on Starlink: |
Signed-off-by: Jacob Howard <[email protected]>
Signed-off-by: Jacob Howard <[email protected]>
Signed-off-by: Jacob Howard <[email protected]>
ilopezluna
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested the branch and verified that parallel transport works 👏👏.
I don’t have enough knowledge to give a thorough review, but I approve to unblock merging and to confirm that the parts I tested work as expected.
|
I'm going to merge this for now so that we can start pushing on the monorepo migration. This change won't bring in any new behavior - the parallel transport isn't wired up to anything by default. We will inherit some refinements and refactors to the existing resumable transport, but we have good test coverage for those. |
…cker/model-distribution#130) * transport: implement concurrent net/http.RoundTripper Signed-off-by: Jacob Howard <[email protected]> * transport: extract common code used across transports Signed-off-by: Jacob Howard <[email protected]> * transport: clean up semaphore implementation for unlimited case Signed-off-by: Jacob Howard <[email protected]> * transport: remove unnecessary CloneHeader function Signed-off-by: Jacob Howard <[email protected]> * transport: add better commenting to private field types Signed-off-by: Jacob Howard <[email protected]> * tools: add parallel download benchmark tool Signed-off-by: Jacob Howard <[email protected]> * tools: add progress output to parallelget benchmark Signed-off-by: Jacob Howard <[email protected]> * transport: refactor parallel transport to use FIFO implementation Signed-off-by: Jacob Howard <[email protected]> * transport: clean up FIFO tests and comments Signed-off-by: Jacob Howard <[email protected]> * tools: cleaned up parallelget implementation a bit Signed-off-by: Jacob Howard <[email protected]> * transport: refactored tests to use shared code Signed-off-by: Jacob Howard <[email protected]> * transport: improve code and comment styles Signed-off-by: Jacob Howard <[email protected]> * tools: clean up parallelget implementation and comments Signed-off-by: Jacob Howard <[email protected]> * transport: clean up tests and some formatting Signed-off-by: Jacob Howard <[email protected]> * transport: update code with GPT-5 recommendations Signed-off-by: Jacob Howard <[email protected]> * transport: implement resumable improvements from GPT-5 Signed-off-by: Jacob Howard <[email protected]> * transport: consolidate FIFO constructors Signed-off-by: Jacob Howard <[email protected]> * transport: final fixups to AI-generated code Signed-off-by: Jacob Howard <[email protected]> * transport: avoid using net/http/httptest package Signed-off-by: Jacob Howard <[email protected]> * transport: clarify FIFO temporary file purpose Signed-off-by: Jacob Howard <[email protected]> * tools: don't show parallelget usage on error Signed-off-by: Jacob Howard <[email protected]> * transport: fix test in bufferfile Signed-off-by: Jacob Howard <[email protected]> * transport: remove time.Sleep instances in concurrency test Signed-off-by: Jacob Howard <[email protected]> --------- Signed-off-by: Jacob Howard <[email protected]>
This PR implements an auto-parallelizing transport to support model pulls. It doesn't wire anything up within this repository - that will happen downstream. This PR also refactors the existing resumable transport and its tests so that code is shared across the resumable and parallel implementations.
The parallel downloader currently uses temporary files on disk to support chunks in a way that's transparent to the
http.RoundTripperinterface (seetransport/internal/bufferfile/fifo.go).Most of this PR was written by AI, but it has been human-supervised, human-reviewed, and human-tested.