-
-
Notifications
You must be signed in to change notification settings - Fork 613
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
Added Common GPU Workflows in Docs #1980
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1980 +/- ##
=======================================
Coverage 87.94% 87.94%
=======================================
Files 19 19
Lines 1485 1485
=======================================
Hits 1306 1306
Misses 179 179 Continue to review full report at Codecov.
|
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.
Thanks a lot! A couple of content-related suggestions from me.
Thanks @ToucheSir for the reviews! I only left the first one pending as I wasn't sure how to add an example of the |
Co-authored-by: Carlo Lucibello <[email protected]>
```julia | ||
train_loader = Flux.DataLoader((xtrain, ytrain), batchsize = 64, shuffle = true) | ||
# ... model, optimizer and loss definitions | ||
for epoch in 1:nepochs | ||
for (xtrain_batch, ytrain_batch) in train_loader | ||
x, y = gpu(xtrain_batch), gpu(ytrain_batch) | ||
gradients = gradient(() -> loss(x, y), parameters) | ||
Flux.Optimise.update!(optimizer, parameters, gradients) | ||
end | ||
end | ||
``` |
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.
I don't believe this and subsequent code blocks need to be indented?
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.
I just wanted to make sure they would be in the same indentation level as the text in the sub items after rendering. But this is not mandatory at all.
Co-authored-by: Brian Chen <[email protected]>
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 a great addition, thanks @lfenzo!
Thanks @ToucheSir, @CarloLucibello and @darsnack for the reviews, comments and suggestions! |
Following the discussion in #1974, this is a very rough draft of the "Common GPU Workflows", feel free to suggest any changes or additions to this new section in the docs.
I also took the liberty of reformatting the
docs/make.jl
to make the pages and titles a bit easier to read.