feat(deps): pip dep unification + cu126/dead-config cleanup + WORKSPA…#1124
feat(deps): pip dep unification + cu126/dead-config cleanup + WORKSPA…#1124baohengyi wants to merge 60 commits into
Conversation
…CE/utils fixes Squashed roll-up of the pip-unification work for the opensource side. Strict separation invariant (Phase 2): - Opensource builds may only consume mirrors.aliyun.com/pypi/simple/ + rtp-opensource OSS + download.pytorch.org/whl/<cfg>/. - Internal builds may only consume artlab.alibaba-inc.com + rtp-opensource OSS. - The rtp-opensource OSS bucket is the SINGLE shared mirror for RTP-LLM custom wheels (flash_attn, deep_ep, deep_gemm, flashinfer_*, rtp_kernel, etc.) — same URL serves both sides. Build cfg cleanup: - Drop cuda12 (cu126/torch2.6) build path entirely; cuda12_9 (cu129/torch2.8) is now the canonical x86 GPU build. cuda_pre_12_9 config_setting + every select branch that used it removed (latent ABI mismatch: cu126 native libs with torch 2.8 Python deps from the cu129 pip_parse). - Drop using_arm / using_cpu config_settings + their select branches — --config=arm / --config=cpu bazelrc entries were removed with the lockfiles so the [] branches were unreachable and default branches (decord, xfastertransformer_devel) silently applied. - Drop dead pip_ppu_torch lockfile registration from opensource pip.bzl (no using_ppu select branch in opensource arch_select.bzl). - Drop unused cu126 + cpu --extra-index-url from opensource pip.bzl — halves per-package query surface against download.pytorch.org and reduces regen timeout flakiness. - Drop CPU-only and ARM-CPU build paths (requirements_torch_cpu.txt, requirements_torch_arm.txt, requirements_cpu_arm.txt) — no bazel cfg wires them up anymore. - Drop build:cuda12_2 / build:cuda12_6 from .bazelrc; retarget multi-node perf test scripts/yaml + 5 docs (install/benchmark/debug/profiling/3fs) to --config=cuda12_9. - Delete torch_2.6_py310_cuda http_archive + cuda_pre_12_9 branch in BUILD.pytorch linkopts. Shared-wheel hygiene: - aarch64 wheels retagged manylinux_2_28_aarch64 (uv refuses bare linux_aarch64 under aarch64-manylinux python-platform) and uploaded to OSS for direct version-pin. - URL-pin patched wheels to OUR OSS so resolver can't silently swap to an upstream copy with different bytes (flash_attn 2.8.3+cu12torch2.8cxx11abiTRUE, flashinfer-python 0.6.6, flashinfer-cubin 0.6.6 — we host patched variants). - nvidia-cutlass-dsl pinned 4.4.1 (latest on artlab; hash matches across artlab + aliyun mirror); pulls libs-base==4.4.1 transitive. Whl_deps tightening: - whl_deps() select key changed from :using_cuda12 → :using_cuda12_9_x86 + default. The :using_cuda12 key over-matched every CUDA variant (cuda12_9 inherits build:cuda12 which sets using_cuda12=true), so cu129 wheels were baking torch==2.6.0+cu126 into install_requires. WORKSPACE/pip stub: - WORKSPACE unconditionally calls pip_ppu_torch_install_deps(). Internal builds satisfy that via --override_repository=rtp_deps but opensource builds don't — so opensource-only builds errored 'Failed to load Starlark extension @pip_ppu_torch//:requirements.bzl'. Register pip_ppu_torch in opensource pip.bzl as a lazy alias of the cuda12_9 lockfile (pip_parse is lazy, no opensource select depends on it, so no PPU wheel is ever fetched). py_library deps: - //rtp_llm:utils now declares :aiohttp. utils/util.py imports aiohttp but the target had no pip dep — surfaced as ModuleNotFoundError on ut-sm8x's util_test + duplicated_kv_test once the strict py_test runfiles sandbox started enforcing it. Verified end-to-end on Aone CI pipeline 1346, run 39069908: all 28 jobs SUCCESS (cuda12_9 / cuda12_9_arm / amd / ppu / frontend builds + ut + smoke + perf + open_source variants). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
d0a6fd8 to
43c2d4b
Compare
AI Code Review - PR #1124Status: BLOCKING Summary: P0/0 · P1/1 · P2/3 · P3/0 Blocking IssuesP1
Non-blocking SuggestionsP2
Checklist ✅ (25 items passed)Strengths
|
…ng_cpu config_settings
AI Code Review - PR #1124Status: BLOCKING Summary: P0/0 · P1/4 · P2/3 · P3/0 Blocking IssuesP1
Non-blocking SuggestionsP2
Checklist ✅ (25 items passed)Strengths
|
…ngling :av reference - arch_select.bzl: load @pip_cuda12_arm_torch requirement and add using_cuda12_arm select branch to requirement() so ARM builds resolve to the ARM lockfile instead of falling through to x86 cuda12_9. - arch_select.bzl: add using_cuda12_arm branch to torch_deps() pointing at the new @torch_2.9_py310_cuda_arm http_archive (aarch64 cu129 wheel). - deps/http.bzl: declare @torch_2.9_py310_cuda_arm http_archive. - rtp_llm/BUILD: remove :av from arch_dep / arch_with_version_dep / requirement list since av is absent from all current lockfiles.
AI Code Review - PR #1124Status: BLOCKING Summary: P0/0 · P1/2 · P2/5 · P3/0 Blocking IssuesP1
Non-blocking SuggestionsP2
Checklist ✅ (25 items passed)Strengths
|
… lockfiles - whl_deps(): add using_cuda12_arm branch for torch==2.9.0+cu129 (ARM lockfile pins 2.9.0, while x86 cuda12_9 stays on 2.8.0). - requirements_base.txt: downgrade transformers 4.57.1 -> 4.51.2 to match all three current lockfiles (cuda12_9, cuda12_arm, rocm). A full pip-compile regeneration is still needed to upgrade back.
AI Code Review - PR #1124Status: LGTM Summary: P0/0 · P1/0 · P2/7 · P3/5 lgtm ready to ci Non-blocking SuggestionsP2
P3
Checklist ✅ (25 items passed)Strengths
|
…guard - deps/pip.bzl: split PIP_EXTRA_ARGS into PIP_BASE_ARGS + PIP_CUDA_EXTRA_ARGS / PIP_ROCM_EXTRA_ARGS so CUDA pip_parse/compile only query cu129 index and ROCm only queries rocm7.2. - deps/BUILD: update compile_pip_requirements to use config-specific extra args. - BUILD.pytorch: add using_cuda12_arm branch for torch_libs linkopts (CUPTI/cudart/nccl/cudnn/nvtx) so ARM CUDA builds link correctly. - requirements_torch_gpu_cuda12_9.txt: add platform_machine == x86_64 guard to tensorrt-cu12-libs, matching tensorrt/tensorrt-cu12-bindings.
AI Code Review - PR #1124Status: BLOCKING Summary: P0/0 · P1/1 · P2/6 · P3/4 Blocking IssuesP1
Non-blocking SuggestionsP2
P3
Checklist ✅ (25 items passed)Strengths
|
…oc cleanup - Restore test_xqa_batch_decode py_test with open_skip/H20/manual tags instead of leaving it commented out. - multi_runner.sh: collect background PIDs and aggregate exit codes so remote build/test failures are no longer swallowed. - multi_runner.sh: fix [ -z "" ] / [ -z "" ] spacing and initialize START_PORT before GANG_CONFIG_STRING. - http.bzl: add TODO explaining aiter 0.1.14rc1 archive vs 0.1.13.dev14 pip lockfile version gap; unification requires pip-compile regeneration. - docs/start/install.md: remove --test_output/--test_env from bazel build example (those flags only apply to bazel test).
AI Code Review - PR #1124Status: LGTM Summary: P0/0 · P1/0 · P2/9 · P3/6 lgtm ready to ci Non-blocking SuggestionsP2
P3
Checklist ✅ (25 items passed)Strengths
|
AI Code Review - PR #1124Status: LGTM Summary: P0/0 · P1/0 · P2/7 · P3/4 lgtm ready to ci Non-blocking SuggestionsP2
P3
Checklist ✅ (25 items passed)Strengths
|
AI Code Review - PR #1124Status: LGTM Summary: P0/0 · P1/0 · P2/9 · P3/9 lgtm ready to ci Non-blocking SuggestionsP2
P3
Checklist ✅ (25 items passed)Strengths
|
…source compatibility
- Trim cross-config PyTorch indexes from lockfile headers (CUDA lockfiles keep cu129, ROCm keeps rocm7.2). - Unify aiter http_archive to 0.1.13.dev14 to match ROCm lockfile. - Clarify pip_ppu_torch stub comment and PIP_EXTRA_ARGS CUDA-only default. - Merge duplicate CUDA linkopts in BUILD.pytorch via using_cuda12_9 group. - Pin flash-attn in ARM requirements to aarch64 wheel URL + marker. - Add transformers 4.51.2 downgrade note in requirements_base.txt and rtp_llm/BUILD wheel metadata. - Fix multi_runner.sh build exit-code aggregation and remove set -e/&& mix. - Update README_cn.md/benchmark.md/Update-whl-Deps.md to reference requirements_torch_gpu_cuda12_9 / origin main.
AI Code Review - PR #1124Status: LGTM Summary: P0/0 · P1/0 · P2/6 · P3/4 lgtm ready to ci Non-blocking SuggestionsP2
P3
Checklist ✅ (25 items passed)Strengths
|
…or internal overlays Internal source overlays still reference @pip_gpu_cuda12_torch, which was removed in the pip unification. Restore it as a thin alias pointing to the same requirements_lock_torch_gpu_cuda12_9.txt so CI can resolve @pip_gpu_cuda12_torch_deep_ep and other pip_parse-generated targets. TODO: Remove once internal overlays migrate to @pip_gpu_cuda12_9_torch.
…_select.bzl upstream/main arch_config/arch_select.bzl loads both @pip_gpu_cuda12_torch and @pip_gpu_cuda12_9_torch. The internal overlay may still use the old version that references requirement_gpu_cuda12. Restore the load statement to prevent 'variable not defined' errors when internal arch_select.bzl is used alongside the opensource WORKSPACE.
AI Code Review - PR #1124Status: LGTM Summary: P0/0 · P1/0 · P2/5 · P3/7 lgtm ready to ci Non-blocking SuggestionsP2
P3
Checklist ✅ (25 items passed)Strengths
|
# Conflicts: # deps/requirements_base.txt # deps/requirements_lock_cuda12_arm.txt # deps/requirements_lock_rocm.txt # deps/requirements_lock_torch_arm.txt # deps/requirements_lock_torch_cpu.txt # deps/requirements_lock_torch_gpu_cuda12.txt # deps/requirements_lock_torch_gpu_cuda12_9.txt # rtp_llm/BUILD
AI Code Review - PR #1124Status: LGTM Summary: P0/0 · P1/0 · P2/7 · P3/10 lgtm ready to ci Non-blocking SuggestionsP2
P3
Checklist ✅ (25 items passed)Strengths
|
|
internal source has been updated, please review the changes! |
…ssertions - qwen2_vl VisionAttention: add missing self.head_dim; fix bool-add mask leak by switching to masked_fill(~mask, -inf) (matches SDPA semantics) - OpenaiEndpoint::extract_generation_config: guard chat_render_/tokenizer_ before deref to avoid null-pointer crash - test_xqa: assert support() results in test_support; convert silent return to self.skipTest in _test_decode_correctness
- deepseek_vl2/_create_config & kimi_k25/_read_top_config: raise
FileNotFoundError instead of silently returning None/{} on missing config.json
- TensorPbConvert::torchToPb: move tensor to CPU before serialization to
avoid reading GPU memory as host bytes
- embeding_test: randint upper bound = embedding table rows (vocab), not hidden_size
- tau2_bench_comparer: tarfile.extractall(filter='data') to block path traversal
- QueryConverter::transMMInputsPB: take vector by const ref instead of by value
- deepgemm_wrapper: globals().get(name) instead of getattr(globals(), ...)
which never matched (dict has no such attribute), forcing re-init every call
AI Code Review - PR #1124Status: BLOCKING Summary: P0/0 · P1/1 · P2/7 · P3/3 Blocking IssuesP1
Non-blocking SuggestionsP2
P3
Checklist ✅ (56 items passed)Strengths
|
…sformers 5.2.0) Cross-platform uv resolve (--python-platform aarch64-manylinux_2_28) on x86 so the aarch64 CUDA lock matches x86/ROCm at transformers/sentence-transformers 5.2.0. Custom aarch64 wheels resolved from the public rtp-opensource bucket; torch==2.9.0+cu129. No absolute-path leaks. No aarch64 hardware needed.
AI Code Review - PR #1124Status: LGTM Summary: P0/0 · P1/0 · P2/1 · P3/0 lgtm ready to ci Non-blocking SuggestionsP2
Checklist ✅ (54 items passed)Strengths
|
|
internal source has been updated, please review the changes! |
The cuda12_arm lock (generated with uv) otherwise resolved older pydantic 2.7.0 / safetensors 0.6.2 / regex 2025.9.18 than pip-compile picks for x86/ROCm (2.13.4 / 0.8.0 / 2026.6.28), despite no constraint and aarch64 wheels being available. Pin all three in the shared base so every platform locks to the same versions. Requires regenerating the cuda12_arm lock.
…afetensors/regex)
AI Code Review - PR #1124Status: BLOCKING Summary: P0/0 · P1/2 · P2/1 · P3/0 Blocking IssuesP1
Non-blocking SuggestionsP2
Checklist Violations (2 fail / 54 total)General Principles Checklist
Strengths
|
When chat_render_ is null, encode request stop words via the tokenizer (equivalent token-id path) instead of skipping; when neither renderer nor tokenizer is available, or when select_tokens/sp_advice_prompt are requested without a tokenizer, fail fast with std::runtime_error (mapped to an error response by HttpApiServer's top-level catch). Uses std::runtime_error rather than HttpApiServerException to avoid a cross-layer dependency from the low-level :openai library. Adds unit tests for the fallback and fail-fast paths.
- install.md: --config=cuda12_arm -> --config=cuda12_9_arm (matches .bazelrc) - pip.bzl: generalize internal-index hostname references in comments
pip (used by rules_python at build time) picked the PyPI sdist over the bucket's plain linux_x86_64 wheel for fast-hadamard-transform, then failed building it (setup.py imports torch, absent in the isolated build env), aborting cuda12_9 analysis. Reference deep-ep, deep-gemm, fast-hadamard-transform, fast-safetensors, fastsafetensors, flash-mla and rtp-kernel by explicit rtp-opensource OSS wheel URL (per-arch, matching flash-attn/flashinfer) so pip installs the wheel directly instead of resolving/ building from an index. All 18 wheel URLs verified reachable (HTTP 200). Requires regenerating the cuda12_9 and cuda12_arm lockfiles.
AI Code Review - PR #1124Status: BLOCKING Summary: P0/0 · P1/1 · P2/1 · P3/0 Blocking IssuesP1
Non-blocking SuggestionsP2
Checklist Violations (2 fail / 54 total)General Principles Checklist
Strengths
|
The wheel's install_requires listed unpinned safetensors/pydantic and no regex, so installing rtp_llm from the wheel would re-resolve them and bypass the cross-platform version pins added to requirements_base.txt and the three lockfiles. Pin safetensors==0.8.0, pydantic==2.13.4 and add regex==2026.6.28.
SmokeException requires (QueryStatus, message); the unsafe-tarball-member branches passed only the message, so hitting an unsafe path/link raised TypeError instead of a SmokeException(QueryStatus.OTHERS, ...).
AI Code Review - PR #1124Status: BLOCKING Summary: P0/0 · P1/1 · P2/0 · P3/0 Blocking IssuesP1
Checklist Violations (1 fail / 54 total)General Principles Checklist
Strengths
|
…se label The three lockfile update targets referenced extra_data = ["//:requirements_base.txt"], but requirements_base.txt lives in the deps/ package (exported there), not the repo root. The documented 'bazel run //deps:<cfg>.update' entry points therefore failed to analyze against a nonexistent root label. Use ":requirements_base.txt".
AI Code Review - PR #1124Status: BLOCKING Summary: P0/0 · P1/2 · P2/0 · P3/0 Blocking IssuesP1
Checklist Violations (3 fail / 54 total)General Principles Checklist
Strengths
|
whl_deps() ROCm branch only listed pyrsmi/amdsmi(old sinian source)/aiter/ triton-kernels, so the ROCm wheel's install_requires diverged from the regenerated lockfile. Align it: amdsmi -> rtp-opensource bucket, and add the triton URL, fast-safetensors, fastsafetensors, torch and torchvision pins that requirements_rocm.txt/lockfile carry.
The pre-3.12 fallback did a bare extractall() after only path/linkname checks. Approximate tarfile's data filter instead: allow only regular files and directories (reject sym/hard links and device/fifo/char/block special files), strip archive ownership and setuid/setgid/sticky + group/other write bits, and extract only the vetted members. Verified locally against ../ traversal, absolute paths, symlink, hardlink and FIFO members.
AI Code Review - PR #1124Status: BLOCKING Summary: P0/0 · P1/1 · P2/0 · P3/0 Blocking IssuesP1
Checklist Violations (1 fail / 54 total)General Principles Checklist
Strengths
|
--config=cuda12 now maps to cuda12_9 with torch==2.8.0+cu129, but the rtp_llm_cuda12 target still emitted rtp_llm-<ver>+cuda121.whl, mislabeling the CUDA/PyTorch ABI and risking wrong package selection by release scripts/users. Rename to +cuda129.
AI Code Review - PR #1124Status: LGTM Summary: P0/0 · P1/0 · P2/0 · P3/0 lgtm ready to ci Checklist ✅ (54 items passed)Strengths
|
|
internal source has been updated, please review the changes! |
AI Code Review - PR #1124Status: BLOCKING Summary: P0/0 · P1/4 · P2/0 · P3/0 Blocking IssuesP1
Checklist Violations (6 fail / 136 total)General Principles Checklist
Strengths
|
AI Code Review - PR #1124Status: BLOCKING Summary: P0/0 · P1/1 · P2/0 · P3/0 Blocking IssuesP1
Checklist Violations (3 fail / 136 total)General Principles Checklist
RTP-LLM Checklist
Strengths
|
whl_deps() x86 and ARM branches returned only torch, so the CUDA wheel's install_requires omitted torchvision even though the lockfiles require it and //rtp_llm:multimodal imports it. A clean 'pip install rtp_llm-...+cuda129.whl' would then fail at the multimodal top-level import. Pin torchvision to match each lockfile (x86 0.23.0+cu129, ARM 0.24.0); ROCm already carried it.
AI Code Review - PR #1124Status: BLOCKING Summary: P0/0 · P1/1 · P2/0 · P3/0 Blocking IssuesP1
Checklist Violations (1 fail / 136 total)General Principles Checklist
Strengths
|
Summary
Continues from #962
…CE/utils fixes
Squashed roll-up of the pip-unification work for the opensource side.
Strict separation invariant (Phase 2):
Build cfg cleanup:
Shared-wheel hygiene:
Whl_deps tightening:
WORKSPACE/pip stub:
py_library deps:
Verified end-to-end on Aone CI pipeline 1346, run 39069908: all 28 jobs SUCCESS (cuda12_9 / cuda12_9_arm / amd / ppu / frontend builds + ut + smoke + perf + open_source variants).