Implement backend caching and add GIF benchmarking and plotting tools#2
Merged
Conversation
Add scripts/bench_gifs.py (comprehensive GIF moderation pipeline benchmark) and scripts/plot_results.py (generate media/perf_stages.png and media/perf_latency.png from bench_results.jsonl). Update docs/performance.md to document installing bench deps and the new bench/plot workflow. Tweak scripts/bench_decode.py wording to clarify that ViT inference dominates wall-clock (~91%) and adjust the delta message. bench_gifs runs the real prescreen pipeline (precise backend stubbed), outputs per-GIF JSONL and scaling/timing analysis.
Add caching for constructed backends to avoid reloading large model weights per invocation: introduce _cache, _cache_lock, _construct, and a cache-aware load_backend (with cache=False bypass). Export clear_backend_cache() to allow tests or users to drop cached backends. Update package exports to include clear_backend_cache. Update CLI to build a Config and create a single Scanner.from_config() (reusing the constructed backend) and then scan each path with that scanner, handling BackendUnavailableError up-front. Also update two performance images (media/perf_latency.png, media/perf_stages.png).
Update project version in pyproject.toml and synchronize the __version__ fallback values in src/pyframe/__init__.py to 0.3.0 in preparation for a new release.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.