si/concurrency - #104
si/concurrency#104stingram wants to merge 14 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for multi-chip TPU configurations by dynamically generating evaluation configurations and launching multiple TPU servers based on a new --chips argument. It also implements GenAI API rate-limit handling via monkey patching with tenacity retries, and enhances search timing analysis to report real-world wall time and concurrency acceleration. Feedback highlights several improvement opportunities: adding a missing 90-second timeout to the HITL agent's async monkey patch for consistency, restoring a removed return type annotation in server_config.py, defensively handling potential ValueError exceptions when parsing the PORT environment variable in tpu_server.py, correcting a unit mismatch in the timing summary where seconds are incorrectly labeled as computation-hours, and validating that the --chips input is a positive integer in the setup script.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Summary
This PR introduces multi-chip concurrency mapping and quota management.
By automatically backing off the API client against quota limits, we can fan out
auto_searchdistribution sweeps without bottlenecking on local TPU ports or dropping candidates to transient Vertex/AI Studio 429s.Changes
setup.sh,server_config.py,tpu_server.py):cpu_portcollisions when--chips > 1.auto_agent/config.py,hitl_agent/config.py):generate_content/generate_content_asyncmonkeypatch for thegoogle.genaiSDK. This wraps all core LLM API calls with exponential backoff and jitter timeouts, allowing expansion acrossnum_parallel_runs> 4 without getting blocked by quota violations.analyze_timing.py,run_search.py):computation-hours.prepare_maxkernel.sh):ruffpackage installation pipeline to support code formatting