Skip to content
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

Merged
merged 6 commits into from
Jun 4, 2022
Merged

Added Common GPU Workflows in Docs #1980

merged 6 commits into from
Jun 4, 2022

Conversation

lfenzo
Copy link
Contributor

@lfenzo lfenzo commented May 30, 2022

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.

@codecov-commenter
Copy link

codecov-commenter commented May 31, 2022

Codecov Report

Merging #1980 (f6907be) into master (f2ecdf6) will not change coverage.
The diff coverage is n/a.

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f2ecdf6...f6907be. Read the comment docs.

Copy link
Member

@ToucheSir ToucheSir left a 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.

@lfenzo
Copy link
Contributor Author

lfenzo commented Jun 1, 2022

Thanks @ToucheSir for the reviews! I only left the first one pending as I wasn't sure how to add an example of the CuIterator in the context.

Comment on lines +98 to +108
```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
```
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

@ToucheSir ToucheSir left a 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!

@ToucheSir ToucheSir merged commit f86b356 into FluxML:master Jun 4, 2022
@lfenzo
Copy link
Contributor Author

lfenzo commented Jun 6, 2022

Thanks @ToucheSir, @CarloLucibello and @darsnack for the reviews, comments and suggestions!

@lfenzo lfenzo deleted the docs/gpu-common-workflows branch June 6, 2022 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants