-
Notifications
You must be signed in to change notification settings - Fork 7k
[agents docs] add float64 gotcha #13472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c421712
[docs] add float64 + runtime weight-dtype gotchas to models.md
20741c2
update claude config to allow .ai folder
428faf6
[ci] fetch default branch before .ai/ checkout in claude_review
9106fc3
combine #10 into #8
5054fb7
Merge branch 'main' into docs/models-float64-gotcha
yiyixuxu 1b0d4a1
Apply suggestions from code review
yiyixuxu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@claude this overlaps a little bit with earlier point (8) -> should we combine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @claude here, can you take a look now?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Claude finished @yiyixuxu's task in 54s —— View job
.ai/models.mdto compare gotcha Schedulers - what code should go into a "Scheduler" class? #8 and the new Unet for Grad TTS and pipeline #9/Missingtransformersrequirement #10Overlap analysis: #8, #9, #10
Here are the three entries side by side:
float32/bfloat16in forward — use input tensor's dtype orself.dtypefloat64anywhere — MPS/NPU don't support it; default tofloat32or use device-gated patternself.linear.weight.dtype— it breaks under gguf/quantized; use input tensor's dtype orself.dtype#9 vs #8 — keep separate. These address opposite failure modes. #8 warns against hardcoding a lower precision (forgetting that the user might run in bf16/fp16), while #9 warns against higher precision (float64) that certain backends can't execute at all. The advice also differs: #8 says "follow the input dtype," while #9 says "use float32 unconditionally (or gate on device)." The float64 entry also carries important porting guidance (grep up front, device-gated pattern with named references) that would be diluted inside #8.
#10 vs #8 — strong case for merging. #10 is essentially a concrete anti-pattern that violates #8's positive rule. #8 says what to do ("use input tensor's dtype or
self.dtype"), and #10 says what not to do ("don't peek at a child module's weight dtype"). They share the same root cause (weight dtype ≠ compute dtype under quantization). Merging them makes #8 self-contained:That said, if you expect #10 to be cited independently in review comments or linked from
review-rules.md, keeping it numbered and separate does make it easier to reference. Either choice is defensible; I'd lean toward merging given the entries are short and the principle is identical.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@claude let's merge, can you do that?
COMMIT THIS
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Claude finished @yiyixuxu's task in 2m 29s —— View job
.ai/models.mdto see current state of Schedulers - what code should go into a "Scheduler" class? #8, Unet for Grad TTS and pipeline #9, Missingtransformersrequirement #10transformersrequirement #10 into Schedulers - what code should go into a "Scheduler" class? #8What was done
Merged gotcha #10 into #8. The diff:
Gotcha #9 (float64) kept unchanged. Gotcha #10 removed.
Push failed
The GitHub App token used by this workflow doesn't have write access to push directly. You can apply the local commit manually:
git fetch && git cherry-pick 43e6633 git pushOr I can note that the commit is ready and someone with repo write access can push it.