-
Notifications
You must be signed in to change notification settings - Fork 169
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
Fix LR schedule handling for low-bit optimizers #736
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
af8de67
update benchmark script
gau-nernst aecc1c4
try CPU Tensor lr
gau-nernst 55077cf
update
gau-nernst 487ede0
Merge branch 'pytorch:main' into optim_lr
gau-nernst dc0e2f9
consolidate adam
gau-nernst 87d3be7
remove unnecessary requires_grad in subclass
gau-nernst cdf283c
update README
gau-nernst 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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
from .adam import Adam8bit, Adam4bit, AdamFp8 | ||
from .adamw import _AdamW, AdamW8bit, AdamW4bit, AdamWFp8 | ||
from .adam import Adam4bit, Adam8bit, AdamFp8, AdamW4bit, AdamW8bit, AdamWFp8, _AdamW | ||
from .cpu_offload import CPUOffloadOptimizer |
Oops, something went wrong.
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.
FP8 max memory is ~1GB higher than expected. I re-ran the benchmark on main branch (without this PR) and the max memory for FP8 is the same. I'm suspecting something funny happening with torch.compile. The benchmark was done with
2.5.0.dev20240820
. I don't think it's a big issue, especially since FP8 optimizer is not popular yet (may change in the future though 👀). Re-running with 2.4 now. (probably won't re-run the rest with 2.4 since I'm lazy)(Accuracy is much better than before across the board thanks to cosine LR scheduler)
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.
FP8 optimizer
Definitely something funny with newer torch.compile 🤔
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.
On 2.3.1, Triton refused to run due to compute capability (though my GPU should support - 2.4.0 and nightly are fine)
In the original benchmark numbers, FP8 optim was good (max memory is the same as 8-bit optim). But I don't rmb which PyTorch version I used back then 😅.
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.
This is just compiling the optimizer. There were some larger changes to the min cut partioner that affect how we split forward + bwd graphs ( determine what to recompute vs save). These changes show up more in fp8 since you typically have long chains of ops to dequant or quant. But if there is no fwd/bwd I am not totally sure what might be happening