-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathprint_versions.sh
More file actions
164 lines (149 loc) · 5.2 KB
/
Copy pathprint_versions.sh
File metadata and controls
164 lines (149 loc) · 5.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#!/usr/bin/env bash
# Copyright 2026 VinRobotics
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# print_versions.sh - emit a Reproducibility markdown block for vla.cpp benchmark
# reports. Pipe into a REPORT-*.md or paste under the "## Reproducibility" header.
#
# Usage:
# scripts/print_versions.sh # env-only
# scripts/print_versions.sh path/to/foo.gguf bar.gguf # also hash these GGUFs
# VLA_LIBERO_VENV=eval/sim/libero/libero_uv/.venv \
# VLA_SIMPLER_VENV=eval/sim/simpler/simpler_uv/.venv \
# scripts/print_versions.sh ... # include sim pip versions
set -u
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
# llama.cpp lives in the build tree (cmake FetchContent); set VLA_BUILD_DIR to override.
LLAMA_DIR="${VLA_BUILD_DIR:-$ROOT/build}/_deps/llama-src"
sha256() {
if command -v sha256sum >/dev/null 2>&1; then
sha256sum "$1" | awk '{print $1}'
else
shasum -a 256 "$1" | awk '{print $1}'
fi
}
trim() { sed 's/^ *//;s/ *$//' ; }
git_head_or_dash() {
local dir="$1"
if [[ -d "$dir/.git" ]] && command -v git >/dev/null 2>&1; then
git -C "$dir" rev-parse HEAD 2>/dev/null || echo "-"
else
echo "-"
fi
}
git_describe_or_dash() {
local dir="$1"
if [[ -d "$dir/.git" ]] && command -v git >/dev/null 2>&1; then
git -C "$dir" describe --tags --always --dirty 2>/dev/null || echo "-"
else
echo "-"
fi
}
venv_pip_freeze_subset() {
local venv="$1"; shift
local pip="$venv/bin/pip"
[[ -x "$pip" ]] || { echo "(venv not found at $venv)"; return; }
"$pip" freeze 2>/dev/null | grep -iE "^(torch|transformers|lerobot|gymnasium|numpy|mani_skill2|maniskill2_real2sim|simpler_env|libero)==" \
|| echo "(no matching packages installed)"
}
echo "## Reproducibility"
echo
echo "Generated by \`scripts/print_versions.sh\` on \`$(date -u +%Y-%m-%dT%H:%M:%SZ)\`."
echo
# ---- vla.cpp ----
echo "### vla.cpp"
echo
VLA_HEAD=$(git_head_or_dash "$ROOT")
VLA_DESC=$(git_describe_or_dash "$ROOT")
echo "- repo HEAD: \`${VLA_HEAD}\` (\`${VLA_DESC}\`)"
# ---- llama.cpp ----
echo
echo "### llama.cpp (fetched)"
echo
LLAMA_HEAD=$(git_head_or_dash "$LLAMA_DIR")
LLAMA_DESC=$(git_describe_or_dash "$LLAMA_DIR")
echo "- HEAD: \`${LLAMA_HEAD}\` (\`${LLAMA_DESC}\`)"
LLAMA_TAG=$("$ROOT/scripts/llama_tag.sh" 2>/dev/null || echo '?')
echo "- expected pinned tag (from \`CMakeLists.txt\`): \`${LLAMA_TAG}\`"
# ---- GGUFs ----
echo
echo "### GGUF checksums"
echo
if [[ $# -eq 0 ]]; then
echo "_(pass GGUF paths as positional args to include their sha256s)_"
else
for f in "$@"; do
if [[ -f "$f" ]]; then
echo "- \`$(basename "$f")\` (\`$(du -h "$f" | awk '{print $1}')\`): \`$(sha256 "$f")\`"
else
echo "- \`$f\`: **missing**"
fi
done
fi
# ---- Host ----
echo
echo "### Host"
echo
echo '```'
echo "uname: $(uname -srvmpio 2>/dev/null || uname -a)"
if [[ -r /etc/os-release ]]; then
. /etc/os-release
echo "os: ${PRETTY_NAME:-${NAME:-unknown}}"
fi
if command -v nvidia-smi >/dev/null 2>&1; then
echo "nvidia: $(nvidia-smi --query-gpu=name,driver_version --format=csv,noheader | head -1 | trim)"
echo " $(nvidia-smi --query-gpu=memory.total,compute_cap --format=csv,noheader | head -1 | trim)"
fi
if command -v nvcc >/dev/null 2>&1; then
echo "nvcc: $(nvcc --version | grep -i release | trim)"
fi
if command -v cmake >/dev/null 2>&1; then
echo "cmake: $(cmake --version | head -1)"
fi
if command -v g++ >/dev/null 2>&1; then
echo "g++: $(g++ --version | head -1)"
fi
if command -v python3 >/dev/null 2>&1; then
echo "python3: $(python3 --version 2>&1)"
fi
if command -v uv >/dev/null 2>&1; then
echo "uv: $(uv --version 2>&1)"
fi
echo '```'
# ---- Python venvs ----
if [[ -n "${VLA_LIBERO_VENV:-}" || -n "${VLA_SIMPLER_VENV:-}" ]]; then
echo
echo "### Python venv pins"
echo
if [[ -n "${VLA_LIBERO_VENV:-}" ]]; then
echo "**LIBERO venv** (\`$VLA_LIBERO_VENV\`):"
echo '```'
venv_pip_freeze_subset "$VLA_LIBERO_VENV"
echo '```'
fi
if [[ -n "${VLA_SIMPLER_VENV:-}" ]]; then
echo "**SimplerEnv venv** (\`$VLA_SIMPLER_VENV\`):"
echo '```'
venv_pip_freeze_subset "$VLA_SIMPLER_VENV"
echo '```'
fi
fi
# ---- Seeds & determinism notes ----
echo
echo "### Determinism"
echo
echo "- LIBERO seeds: see \`eval/client/run_libero_eval.py --seed\` (default in that script)."
echo "- Server-side denoising noise: client-supplied if \`PredictRequest.noise\` is set;"
echo " otherwise sampled from the per-arch RNG seeded at model load (not currently"
echo " exposed on the CLI - set \`PredictRequest.noise\` from the client for bit-exact"
echo " reruns)."