gen-locks.sh 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/usr/bin/env bash
  2. # Regenerate the hash-locked python requirements for the DS4 from-source build.
  3. #
  4. # The checked-in python locks detached from the GLM-5.2 NF3-Hybrid harness are
  5. # NOT valid here: they pin torch 2.11 / flashinfer 0.6.12. This stack (the
  6. # newest local-inference-lab b12x fork, feat/gg-ds4-0731-launcher) uses
  7. # torch 2.12.0, flashinfer 0.6.15, cutlass-dsl 4.6.0 — so we lock from the
  8. # FORK'S OWN requirements/* at the pinned commit, which are authoritative.
  9. #
  10. # Usage (run on the aarch64 build host, e.g. dgx3.lan, before build.sh):
  11. # bash gen-locks.sh
  12. # Writes locks/python-build.txt and locks/python-runtime.txt.
  13. #
  14. # Requires: uv (bootstrapped in the Dockerfile's apt-base; or `apt install uv`).
  15. set -euo pipefail
  16. cd "$(dirname "$0")"
  17. source ./versions.env
  18. PY="${PYTHON_VERSION:-3.12}"
  19. PLAT="${PLATFORM:-aarch64-unknown-linux-gnu}"
  20. W="${VLLM_WORKSPACE:-$PWD/.gen/vllm}" # shallow fork checkout (partial clone)
  21. echo "==> ensuring fork checkout at ${VLLM_COMMIT}"
  22. if [[ ! -d "$W/.git" ]]; then
  23. mkdir -p "$(dirname "$W")"
  24. git clone --filter=blob:none --no-checkout "${VLLM_REPO}" "$W"
  25. fi
  26. git -C "$W" fetch --depth 1 origin "${VLLM_COMMIT}"
  27. git -C "$W" checkout --detach "${VLLM_COMMIT}"
  28. common_flags=(--generate-hashes --python-version "$PY" --python-platform "$PLAT"
  29. --index-url "$PYPI_INDEX_URL" --extra-index-url "$PYTORCH_INDEX_URL"
  30. --index-strategy unsafe-best-match)
  31. echo "==> python-build.txt (vLLM build deps, torch 2.12.0)"
  32. # Also install the CUDA-side build companions the source builds need at build
  33. # time (tvm_ffi is required by flashinfer-cubin's backend; torch/compiler deps
  34. # come from the fork's own build/*.txt).
  35. printf -- "-r '${W}/requirements/build/cuda.txt'\n-r '${W}/requirements/build/rust.txt'\napache-tvm-ffi==${TVM_FFI_VERSION}\nnvidia-nvshmem-cu13==${NVSHMEM_VERSION}\nnvidia-ml-py\nnvidia-cudnn-frontend\nnvidia-cudnn-cu13\npillow\nprotobuf\ntqdm\nregex\nrequests\npyproject-hooks\nwheel\nsemantic-version\nvcs-versioning\nsetuptools-scm\n" > .gen/build.in
  36. uv pip compile "${common_flags[@]}" .gen/build.in \
  37. --output-file locks/python-build.txt
  38. echo "==> python-runtime.txt (vLLM CUDA runtime deps)"
  39. # FlashInfer is built from source and installed as a wheel (see Dockerfile), so
  40. # drop the flashinfer lines (and the flashinfer.ai extra-index directive) from
  41. # the lock — otherwise the runner's install can't resolve flashinfer-cubin and
  42. # the pinned 0.6.14 would also collide with our built 0.6.15 wheel.
  43. sed -e '/flashinfer/I d' -e '/extra-index-url.*flashinfer[^ ]*/I d' \
  44. "$W/requirements/cuda.txt" \
  45. | sed "s|^-r common.txt|-r ${W}/requirements/common.txt|" > .gen/runtime.in
  46. uv pip compile "${common_flags[@]}" .gen/runtime.in \
  47. --output-file locks/python-runtime.txt
  48. echo "locked. Now: cd docker-images/deepseek-v4-flash-dspark-src && bash build.sh"