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

Accelerator docs #2076

Merged
merged 8 commits into from
Jan 10, 2024
Merged

Accelerator docs #2076

merged 8 commits into from
Jan 10, 2024

Conversation

kumare3
Copy link
Contributor

@kumare3 kumare3 commented Dec 31, 2023

Tracking issue

Adds basic documentation for accelerators in flytekit

Generated docs at:

@neverett / @samhita-alla can you please help with copy-edit and layout
@jeevb / @zeryx can you please help improve content - like partition information

Nvidia docs here - https://docs.nvidia.com/datacenter/tesla/mig-user-guide/index.html#abstract

Signed-off-by: Ketan Umare <kumare3@users.noreply.github.com>
Copy link

codecov bot commented Dec 31, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b5dbd85) 85.73% compared to head (4eab4be) 85.52%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2076      +/-   ##
==========================================
- Coverage   85.73%   85.52%   -0.22%     
==========================================
  Files         313      302      -11     
  Lines       23435    23084     -351     
  Branches     3512     3512              
==========================================
- Hits        20093    19743     -350     
+ Misses       2734     2733       -1     
  Partials      608      608              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Ketan Umare <kumare3@users.noreply.github.com>
Signed-off-by: Ketan Umare <kumare3@users.noreply.github.com>
Signed-off-by: Ketan Umare <kumare3@users.noreply.github.com>
Copy link
Contributor

@neverett neverett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few structural comments and copy edits, let me know if you have any questions!

@@ -80,6 +80,7 @@ Expected output:
testing
extend
deck
extras.accelerators
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like this section should just be extras, for consistency with the other sections, and then "Accelerators" should be a subsection in the docs. I'm not sure why the other extras aren't showing up in the API docs (pytorch, sklearn, sqlite, tasks, tensorflow), but if they should be there, those should also be subsections under extras.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is because some of them are under types.extend and some under tasks.extend.

While accelerators is under extras, but it is not a type or a task extension. it is just a helper to help configure accelerators


.. tags:: MachineLearning, Advanced, Hardware

Flyte tasks are very powerful and allow you to select `gpu` resources for your task. However, there are some cases where
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested edit for this section below. (The suggestion tool won't let me leave a suggestion for more than one line, otherwise I'd use that.)

Flyte allows you to specify `gpu` resources for a given task. However, in some cases, you may want to use a different accelerator type, such as TPU, specific variations of GPUs, or fractional GPUs. You can configure the Flyte backend to use your preferred accelerators, and those who write workflow code can import the `flytekit.extras.accelerators` module to specify an accelerator in the task decorator.

The `flytekit.extras.accelerators` module provides some constants for known accelerators, listed below, but this is not a complete list. If you know the name of the accelerator, you can pass the string name to the task.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -0,0 +1,4 @@
.. automodule:: flytekit.extras.accelerators
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this just be flytekit.extras?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no accelerators is a specific module under extras

Signed-off-by: Ketan Umare <kumare3@users.noreply.github.com>
neverett
neverett previously approved these changes Jan 5, 2024
Signed-off-by: Ketan Umare <kumare3@users.noreply.github.com>
flytekit/extras/accelerators.py Outdated Show resolved Hide resolved
flytekit/extras/accelerators.py Show resolved Hide resolved
flytekit/extras/accelerators.py Show resolved Hide resolved
@cosmicBboy
Copy link
Contributor

we can ignore the monodocs build ci error for now, I'm working on the monodocs transition and will add this once that's done.

flytekit/extras/accelerators.py Outdated Show resolved Hide resolved
flytekit/extras/accelerators.py Outdated Show resolved Hide resolved
flytekit/extras/accelerators.py Outdated Show resolved Hide resolved
flytekit/extras/accelerators.py Outdated Show resolved Hide resolved
EngHabu
EngHabu previously approved these changes Jan 10, 2024
Signed-off-by: Ketan Umare <kumare3@users.noreply.github.com>
@kumare3 kumare3 merged commit 2fde2ed into master Jan 10, 2024
82 of 84 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants