[do not merge] diffusion: pr ci consistency#20139
[do not merge] diffusion: pr ci consistency#20139yhyang201 wants to merge 3 commits intosgl-project:mainfrom
Conversation
- Add consistency_threshold.json for per-case threshold config - Add CLIP-based consistency checking utilities: get_clip_model, compute_clip_embedding, compute_clip_similarity, compare_with_gt, load_gt_embeddings, gt_exists, get_clip_threshold, ConsistencyResult - Add _validate_consistency() method to test_server_common.py - Call consistency validation after performance validation in test_diffusion_generation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the CI pipeline for diffusion models by introducing a robust consistency testing framework. It ensures that generated outputs (images and videos) remain consistent across different runs and environments by comparing them against predefined ground truth using CLIP similarity. This helps prevent regressions and maintains the quality of diffusion model generations, providing clear feedback when outputs deviate from expected results. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a robust consistency checking mechanism for diffusion model outputs within the CI pipeline, which is a valuable addition for ensuring output stability. The implementation is well-structured, adding a new configuration file for thresholds, utility functions for ground truth management and comparison using CLIP, and integrating this validation into the existing test suite. The approach to skip tests when ground truth is missing is a good design choice to avoid blocking CI for new test cases. I have a couple of suggestions to enhance the robustness of network requests by using more specific exception handling.
| try: | ||
| r = requests.head(url, timeout=10) | ||
| return url if r.status_code == 200 else None | ||
| except Exception: | ||
| return None |
There was a problem hiding this comment.
The except Exception: is too broad and can hide non-network related errors, making debugging difficult. It's better to catch a more specific exception, like requests.exceptions.RequestException, to only handle network issues.
| try: | |
| r = requests.head(url, timeout=10) | |
| return url if r.status_code == 200 else None | |
| except Exception: | |
| return None | |
| try: | |
| r = requests.head(url, timeout=10) | |
| return url if r.status_code == 200 else None | |
| except requests.exceptions.RequestException: | |
| return None |
| try: | ||
| r = requests.head(url, timeout=10) | ||
| if r.status_code == 200: | ||
| return url | ||
| except Exception: | ||
| continue |
There was a problem hiding this comment.
Similar to the above, using except Exception: is too broad. Catching requests.exceptions.RequestException is more specific and safer, as it won't suppress unrelated programming errors.
| try: | |
| r = requests.head(url, timeout=10) | |
| if r.status_code == 200: | |
| return url | |
| except Exception: | |
| continue | |
| try: | |
| r = requests.head(url, timeout=10) | |
| if r.status_code == 200: | |
| return url | |
| except requests.exceptions.RequestException: | |
| continue |
|
/tag-and-rerun-ci |
|
/rerun-failed-ci |
2 similar comments
|
/rerun-failed-ci |
|
/rerun-failed-ci |
|
the amd tests are failing |
|
/tag-and-rerun-ci |
|
/rerun-failed-ci |
2 similar comments
|
/rerun-failed-ci |
|
/rerun-failed-ci |
Motivation
Modifications
Accuracy Tests
Benchmarking and Profiling
Checklist
Review Process
/tag-run-ci-label,/rerun-failed-ci,/tag-and-rerun-ci