Commit 2c63095
authored
Fail binary validation if linux torch wheel exceeds 850 MB (pytorch#8324)
## Summary
Adds a **hard size ceiling** to binary validation: fail if a Linux torch
wheel exceeds **850 MB**. Requested to gate the nightly-binary
validation flow.
The check lives in the shared `.github/scripts/validate_binaries.sh`,
which is sourced by **`validate-binaries.yml`**,
**`validate-nightly-binaries.yml`**, and the linux + aarch64 platform
validators — so a single insertion point covers all of them.
### Scope
- **Platforms:** Linux `x86_64` + `aarch64` only (macOS/Windows
unaffected).
- **Variants:** all **except ROCm** — ROCm wheels are legitimately ~4 GB
and would always trip a flat ceiling. `libtorch` is skipped too.
- **Threshold:** 850 MB, overridable via `WHEEL_SIZE_THRESHOLD_MB`.
### How the size is measured (answering "can we get wheel size at pip
install time?")
Yes — directly from pip. The validators already run `pip3 install torch
--index-url https://download.pytorch.org/whl/<channel>/cuXXX`, and pip
prints the wheel's compressed size on its own line:
```
Downloading torch-2.10.0.dev...-linux_x86_64.whl (812.4 MB)
# or, if cached:
Using cached torch-...whl (812.4 MB)
```
We tee the existing install output and read that number — **no extra
download**. This is the `.whl` **download** size (compressed) = the same
size on download.pytorch.org / PyPI, *not* the unpacked install
footprint (~2-3 GB).
### Robustness
- Handles B / kB / MB / GB units.
- `torch-[0-9]` isolates the torch wheel (ignores
torchvision/torchaudio).
- If the size line can't be found (e.g. a future pip output change), it
emits a `::warning::` and skips rather than wedging all validation.
- `set -o pipefail` keeps the install's exit status through the `tee`.
Approx current sizes for reference: cpu ~175 MB, xpu ~694 MB, cuda ~773
MB (850 leaves headroom), rocm ~4 GB (excluded).1 parent 1997b69 commit 2c63095
1 file changed
Lines changed: 59 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
226 | 278 | | |
227 | 279 | | |
228 | 280 | | |
| |||
306 | 358 | | |
307 | 359 | | |
308 | 360 | | |
309 | | - | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
310 | 368 | | |
311 | 369 | | |
312 | 370 | | |
| |||
0 commit comments