Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

agentic client: venv rebuilt on every run and caller's UV_CACHE_DIR overridden

未关闭
#4,234 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
58/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
backend

调研方向

Start with infx/bench/agentic/venv.py and the existing expectations in infx/tests/bench/test_agentic_runtime.py:70-97; infx/bench/agentic/run.py:248-256 shows where bootstrap is called. Read the venv setup and tests first, then update the tests for cache selection and matching-venv reuse. Done when matching requirements avoid uv calls, changed requirements rebuild, and a caller-supplied UV_CACHE_DIR is honored.

由索引模型根据 Issue 内容生成。

描述

The agentic benchmark client rebuilds its venv on every run and ignores a caller-supplied UV_CACHE_DIR, so a caller that runs many benchmarks pays a full client download each time. Downstream: AMD-AGI/Magpie#128, AMD-AGI/Hyperloom#1919.

Current behaviour (main @ 288471b, read from code)

  • inferencex-e2e/benchmarks/srt_agentic.sh runs python3 -m infx.bench agentic, which calls venv.bootstrap when not already inside the client venv (infx/bench/agentic/run.py:248-256).
  • bootstrap always deletes the venv (infx/bench/agentic/venv.py:66), with no check of whether the existing one already matches.
  • It always sets UV_CACHE_DIR=<runtime root>/uv-cache (venv.py:67-69), overriding a value from the caller. The CI workflows set their own UV_CACHE_DIR (e.g. .github/workflows/benchmark-tmpl.yml:246), which this also overrides.
  • The runtime root is AIPERF_RUNTIME_DIR, else a per-job temp directory (venv.py:28-34). When the root is new per run, as it is for Magpie's AgentX runs, the cache is always cold and every run downloads the full client requirements again, plus uv itself if it is not on PATH (infx/bench/uv.py:21-32).
  • infx/tests/bench/test_agentic_runtime.py:70-97 pins the rebuild-and-override behaviour.

The older bash path had the same shape: 408c015 inferencex-e2e/benchmarks/benchmark_lib.sh:3133 deletes the venv and :3140-3142 force the cache path; 3d55815 made AIPERF_UV_CACHE_DIR overridable (benchmarks/benchmark_lib.sh:1787-1790) but still deleted the venv (:1841). Main dropped that override.

Impact
For a caller such as Magpie, the client starts after the server is healthy, so the download runs while the server holds its GPUs and counts against the client timeout. On a slow or restricted network a run can fail for reasons unrelated to what is being benchmarked.

Proposed change (all in infx/bench/agentic/venv.py, plus tests)

  1. Honour the caller's cache: use os.environ.get("UV_CACHE_DIR") when set, falling back to <root>/uv-cache.
  2. Reuse a matching venv: key it on PYTHON_VERSION plus the bytes of REQUIREMENTS, store the key in the venv after a successful install, and skip the rebuild when the key matches and agentx and hf are executable. Otherwise rebuild as today.
  3. If the venv is meant to be shared across concurrent runs through a persistent AIPERF_RUNTIME_DIR, take a file lock around the check-and-build.
  4. Tests: a matching key makes no uv calls; changed requirements rebuild; UV_CACHE_DIR from the caller is used.
主要语言
Python
星标
1.9k
派生
343
平均合并
2 天 40 分钟
30 天内合并 PR
431

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

SemiAnalysisAI/InferenceX 的其他 Issue

查看 SemiAnalysisAI/InferenceX 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。