Spaces:
Running on Zero
Running on Zero
Commit History
2 days ago
-
fix: no entry can sample on an MPS PyTorch that fails the numerics self-test: build_local_runner applies the app's gate on mps, so scripts/local_generate.py --device mps exits refused (2) before loading anything, and the remedy names the README's floor, PyTorch 2.14 (#11)
Unverified signaturetorch 2.11 on MPS reuses the first scale scaled-dot-product attention saw, which gives wrong numbers without any error. The app's pipeline factory refused such a build through device.require_mps_numerics, but local_runtime.build_local_runner never called it, and scripts/local_generate.py builds the runner directly: on an affected torch it would have produced a wrong video. build_local_runner now calls require_mps_numerics on mps, after the watermark and availability checks and before any file is looked at, so every entry is covered by one check; LTX25_MPS_SELF_TEST=warn still lets an operator run unverified. The script counts MpsNumericsError among its refusals (exit 2). MPS_CLEAN_TORCH said 2.15 while the README states PyTorch 2.14 or newer (2.14.1 measured the same as 2.15.0 in the numerics checks), so the refusal and the unverified note now say 2.14, as the README does. Tests: the script test begun on wip/deploy2-w14 (ca91f07), unchanged; a runner-level test under enforce and warn…444bc2b
3 days ago
-
fix: the local script leaves the change level to the mode and writes the run record into its JSON, and the record names the device that ran
Unverified signature- scripts/local_generate.py: --noise-scale defaults to None, so a run without it varies at the mode's own level. It was 0.5, which snapped video to video to "a little" (0.42) instead of its 0.91, as the lead measured. --strength's help says no mode reads it. The run record (result.record as a dict) is written into the --json file beside the artifacts. - generate.RunRecord carries the device the run ran on (record.device): the runner's own device, else this process's resolution. The UI already reads it to label the run's time. - zerogpu.assert_returnable no longer takes a plain string device for a CUDA tensor: a torch object's device is a torch.device, never a str. Without this the record's "cuda" made every result through the Space entrypoint refuse itself (the suite caught it through app.py's run_generation). tests/test_local_generate.py drives the script through its parser and main() with a fake runner that writes real frames: no flag gives 0.909375, the flag still…419e0a5 -
fix: refuse an MPS watermark pair that makes every empty_cache() fail, before anything loads
Unverified signatureWith PYTORCH_MPS_HIGH_WATERMARK_RATIO below 1.4 and the low ratio unset, torch keeps its 1.4 low default and torch.mps.empty_cache() raises 'invalid low watermark ratio 1.4' — inside from_single_file and in the runner's own staging. memory.mps_watermarks() reads both ratios and names the problem and the fix; a high ratio without a low one at or below it, or a value that is not a number, is refused with a typed MpsWatermarkError. build_local_runner checks it on mps; scripts/local_generate.py prints both values and torch's recommended MPS maximum in the plan (dry run too) and exits 2 before touching anything. Nothing sets the variables.adad9b6 -
fix: the local runner gives model-file pages back — the committed gauge no longer counts weights twice
Unverified signatureMeasured by the lead on real weights: after a component moved to MPS, its memory-mapped safetensors pages stayed on the active queue for minutes, and active + wired + compressor (the gauge we keep) counted them, so G0 peaked ~22 GB over budget. Evicting them with mmap + msync(MS_INVALIDATE) dropped committed by the file's size in a fraction of a second. - memory.release_file_cache(paths): darwin msync(MS_INVALIDATE) per file, linux posix_fadvise(DONTNEED); resolves the HF cache's symlinks, walks directories, counts each file once, never raises. Data on disk untouched. - The runner moves every safetensors component (the small set, the text encoder, the transformer) tensor by tensor and releases the files' pages every ~2 GB, instead of one .to() that holds file pages plus the device copy; one release at the end, one line logged per release. The GGUF file is released after load_gguf_checkpoint (everything is copied by then) and after the move. Releasing the text encoder or …75d0c53 -
feat: scripts/local_generate.py — one local generation through the app's own generate(), with its memory story
Unverified signatureThe lead's entry point for real-weights runs on the Mac. The local runner is injected through generate()'s pipeline-factory seam, so it works before pipelines.get_pipeline knows about local devices. It prints the resolved plan, every preflight line, per-phase wall time, the peak committed memory (vm_stat, sampled every 0.5 s) and MPS driver memory, the files written and verify_streams' verdict, and writes the same with --json. --dry-run prints the plan and the projected preflight arithmetic and loads nothing. Nothing is downloaded: a missing file is reported with the exact hf download command. Exit codes: 0 ok, 2 refused (memory, validation, missing files), 3 error. The runner now attaches the connectors after the pipeline load (passed in, diffusers logs the whole module), and the frame bound used for an auto-duration estimate is public for the dry run.af26f09