feat(guidance): add --alignment-reverse-diffusion arg#264
Conversation
|
Warning Review limit reached
More reviews will be available in 59 minutes and 28 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughAdds a new optional boolean field ChangesAlignment Reverse Diffusion Toggle
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR adds a new CLI/config knob to control whether the EDM sampler performs “reverse diffusion” alignment (align noisy state to denoised prediction), defaulting to enabled for Boltz wrappers while allowing non-Boltz models to opt in.
Changes:
- Add
alignment_reverse_diffusion: bool | NonetoGuidanceConfigand plumb it throughGuidanceConfig.from_cli(). - Add
--alignment-reverse-diffusionCLI flag and use it in_run_guidance()to override the per-model default.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/sampleworks/utils/guidance_script_utils.py |
Computes the effective alignment_reverse_diffusion setting (model default vs. user override) and passes it into EDMSamplerConfig. |
src/sampleworks/utils/guidance_script_arguments.py |
Adds the new config field and CLI argument, and forwards it into the constructed GuidanceConfig. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "--alignment-reverse-diffusion", | ||
| action="store_const", | ||
| const=True, | ||
| default=None, | ||
| help=( |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/sampleworks/utils/guidance_script_arguments.py`:
- Around line 457-467: The --alignment-reverse-diffusion argument uses
action="store_const" with const=True, which only allows users to set the value
to True (when the flag is provided) or None (default), preventing explicit
disabling of the feature. Replace the action="store_const" with const=True
approach with a mechanism that supports both enabling and disabling the feature,
such as using action="store_true" and "store_false" for separate flags
(--alignment-reverse-diffusion to enable and --no-alignment-reverse-diffusion to
disable), or use argparse.BooleanOptionalAction if available, ensuring users can
explicitly override the default behavior in both directions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: bae053c9-ede6-4852-a105-98f9a7f1c618
📒 Files selected for processing (2)
src/sampleworks/utils/guidance_script_arguments.pysrc/sampleworks/utils/guidance_script_utils.py
marcuscollins
left a comment
There was a problem hiding this comment.
I'd make a couple changes, and it probably does make sense to add some tests for these arguments to make sure they propagate correctly.
| use_alignment_for_reverse_diffusion = is_boltz | ||
| # Boltz was trained with this, other models default to disabled, but the user | ||
| # can opt in via --alignment-reverse-diffusion. | ||
| override = getattr(args, "alignment_reverse_diffusion", None) |
There was a problem hiding this comment.
No reason to use getattr here. The code explicitly constructs args.alignment_reverse_direction, its default is None anyway, and it should raise an error if that attribute doesn't exist. I would change the default to False and then the next like can just be use_alignment_for_reverse_diffusion = override | is_boltz
9c1b278 to
578c8d2
Compare
marcuscollins
left a comment
There was a problem hiding this comment.
Thanks for the changes.
Pass through the alignment reverse diffusion arg.
Summary by CodeRabbit