fetch-sources.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/env bash
  2. # Fetch the TensorFold 2x 1017 build sources at their pins OUTSIDE the image
  3. # directory, so the image dir stays tiny and its build checksum stays stable.
  4. #
  5. # Pins (upstream `x00byte/DeepSeek-V4.1-Flash-1017-Dual-Spark` @ TF1017_REPO_REV,
  6. # whose own scripts/fetch-sources.sh pins everything else):
  7. # MiaAI-Lab/DeepSeek-v4.1-Flash-EXL3-2x-DGX-Sparks 6f7d1590...
  8. # jayleaton/deepseek-v41-tensorfold-spark 2dcce030...
  9. # └─ vendor/TensorFold c4646171...
  10. #
  11. # Usage: fetch-sources.sh [target-dir] (default /tmp/dsv41-tf-1017-src)
  12. set -euo pipefail
  13. TARGET="${1:-/tmp/dsv41-tf-1017-src}"
  14. REPO=https://github.com/x00byte/DeepSeek-V4.1-Flash-1017-Dual-Spark
  15. REV="${TF1017_REPO_REV:-2df9e96a886d778c3fd5ef9d3c272c3c9972d89d}"
  16. if [[ ! -d "$TARGET/upstream/.git" ]]; then
  17. mkdir -p "$TARGET"
  18. git clone "$REPO" "$TARGET/upstream"
  19. fi
  20. git -C "$TARGET/upstream" fetch --depth 1 origin "$REV"
  21. git -C "$TARGET/upstream" checkout --detach "$REV"
  22. # Their fetcher clones the Mia runtime + Jay Leaton's fork (+ the TensorFold
  23. # submodule) at pins and applies the 1017 patches to build/tensorfold. It
  24. # refuses to run twice (build/mia-runtime already exists), so a repeat build
  25. # reuses the prepared tree.
  26. if [[ -d "$TARGET/upstream/build/tensorfold" && -d "$TARGET/upstream/build/mia-runtime" ]]; then
  27. echo "[fetch-sources] already prepared in $TARGET/upstream/build"
  28. else
  29. bash "$TARGET/upstream/scripts/fetch-sources.sh"
  30. fi
  31. echo "[fetch-sources] sources ready in $TARGET/upstream/build (tensorfold, mia-runtime)"