| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
全く急ぎではないのですが、自分で使っていて気になった点があったためPRを出させていただきました。 |
Sorry, something went wrong.
Adds a --check-env CLI flag that collects physical hardware characteristics (GPU VRAM, CPU RAM, disk space) and model memory estimates before quantization starts, then classifies OOM risk as safe/warning/danger. Exits with code 1 on danger; otherwise prints a report and proceeds with quantization. - onecomp/utils/vram_estimator.py: new EnvironmentSnapshot, ModelMemoryProfile, EnvCheckResult dataclasses; check_environment() and print_env_report() functions reusing existing weight_memory_gb() and estimate_target_bitwidth() - onecomp/utils/__init__.py: export 5 new public symbols - onecomp/cli.py: --check-env argparse flag with preflight invocation - onecomp/runner.py: check_env=False kwarg in auto_run() for library API use - pyproject.toml: optional extras [check-env] = ["psutil>=5.9"] Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| Back | FazBrowse Home | New Git URL |
Background
While quantizing a large-scale LLM (70B+ parameters), the process crashed midway through with an out-of-memory error after running for several hours. There was no way to know in advance whether the available GPU VRAM was sufficient — the failure only surfaced deep into the quantization loop, wasting significant compute time.
This PR introduces a --check-env preflight flag that detects OOM risk before quantization starts, based on the physical characteristics of the execution environment.
Summary
Example output
============================================================ OneComp Environment Check ============================================================ Hardware GPU count : 1 GPU name : NVIDIA A100 80GB PCIe GPU VRAM (total) : 80.0 GB GPU VRAM (free) : 78.3 GB CPU RAM (total) : 251.6 GB CPU RAM (avail) : 230.1 GB Disk (avail) : 320.4 GB [/home/user/output] Model: meta-llama/Llama-2-7b-hf Parameters : 6,738,415,616 FP16 footprint : 12.54 GB Memory Estimates 2-bit quantized : 1.96 GB 4-bit quantized : 3.77 GB 8-bit quantized : 7.28 GB Calib. overhead : 1.88 GB (15% of FP16) 4-bit + overhead : 5.65 GB OOM Risk Assessment Risk level : WARNING Detail : Free VRAM (78.3 GB) fits 4-bit quantized weights but is tight (calibration overhead included). Recommended wbits : 3.84 (VRAM-estimated) ============================================================Risk thresholds
Changed files
Test plan
🤖 Generated with Claude Code