Skip to content

Optimize ghstack submit latency via parallelization and reduced IO#334

Closed
ezyang wants to merge 1 commit intomasterfrom
gh/ezyang/47/head
Closed

Optimize ghstack submit latency via parallelization and reduced IO#334
ezyang wants to merge 1 commit intomasterfrom
gh/ezyang/47/head

Conversation

@ezyang
Copy link
Copy Markdown
Owner

@ezyang ezyang commented May 10, 2026

Reduce wall-clock time for ghstack submit by eliminating unnecessary
network round-trips and parallelizing independent IO operations.

Key changes:

  • Targeted fetch: only fetch gh/{user}/* refs instead of all branches
  • Merge 3 sequential git pushes into 1 atomic push using per-refspec + force
  • Replace N serial GraphQL queries with REST GETs + local PR-to-ghnum index
  • Parallelize REST GET (PR info prefetch) and PATCH (PR body updates) via ThreadPoolExecutor
  • Batch-push and parallel-create new PRs instead of serial push+create per PR
  • Add GHSTACK_TIMING=1 env var for per-phase timing instrumentation
  • Add bench/bench_submit.py for E2E benchmarking against real GitHub
  • Make FakeGitHubEndpoint thread-safe and fix asyncio event loop in worker threads

[ghstack-poisoned]
@ezyang
Copy link
Copy Markdown
Owner Author

ezyang commented May 10, 2026

@ezyang ezyang closed this May 10, 2026
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.

1 participant