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

[Doc] Workspace template examples #32802

Merged
merged 81 commits into from
Mar 20, 2023

Conversation

justinvyu
Copy link
Contributor

@justinvyu justinvyu commented Feb 24, 2023

Why are these changes needed?

This PR adds an initial set of examples that can be used as a template for users to get started with certain workloads.

This includes:

  1. Batch prediction w/ AIR
  2. Many model training w/ AIR
  3. Serving a stable diffusion model

For each example, we include:

  • Jupyter notebook
  • (Optional) requirements.txt for additional dependencies
  • Entry in templates.yaml
  • Entry in release tests yaml

See the contributing guide to see the steps needed to add a new template.

TODOs

  • Finish READMEs
  • Create hello world vs. production versions for all examples. Currently, there's just one version of each.
  • Add release tests

To add in a follow-up PR

  • Full Ray cluster launcher support
    • Guide on how to run these templates on OSS cluster
    • Show these templates somewhere in OSS docs
    • Create an script to convert OSS cluster config -> Anyscale configs

Related issue number

N/A

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

justinvyu and others added 25 commits February 16, 2023 11:15
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
Copy link
Contributor

@ericl ericl left a comment

Choose a reason for hiding this comment

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

Let's actually do two things for now:

  1. Don't use BatchPredictor or Checkpoint APIs.
  2. Instead, use the Dataset ActorPool APIs and callable classes.

We are having some internal discussions on possibly deprecating / unifying BatchPredictor: #32929

@ericl ericl added the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Mar 10, 2023
@ericl ericl self-assigned this Mar 10, 2023
@@ -160,6 +160,7 @@
"_build",
"source/workflows/api/doc/ray.workflow.*",
"source/serve/api/doc/ray.serve.*",
"source/templates",
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe source/templates/*?

"NUM_WORKERS: int = 1\n",
"\n",
"USE_GPU: bool = True\n",
"NUM_GPUS_PER_WORKER: float = 1\n"
Copy link
Contributor

Choose a reason for hiding this comment

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

This cell is repeated twice.

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 how I'm getting around loading a small vs. large version of the template. On product side, we can run some post init command to process the notebook:

  • Filter out all notebook cells tagged as large. Vice versa for large scale examples. This way, the configurations get set to use the small example defaults.
jupyter nbconvert --TagRemovePreprocessor.remove_input_tags='large'
      --to notebook --output batch_inference.ipynb batch_inference.ipynb

How does that sound @ericl?

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we comment these cells like # This is the large case, etc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, sounds good!

"metadata": {},
"outputs": [],
"source": [
"preds = predictions.fully_executed()\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"preds = predictions.fully_executed()\n",
"preds = predictions.cache()\n",

The fully executed call is deprecated, use cache() instead.

@ericl ericl added the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Mar 16, 2023
@justinvyu justinvyu added tests-ok The tagger certifies test failures are unrelated and assumes personal liability. and removed @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. labels Mar 19, 2023
@richardliaw richardliaw changed the title [Doc][Anyscale] Workspace template examples [Doc] Workspace template examples Mar 20, 2023
@richardliaw richardliaw merged commit ed2982f into ray-project:master Mar 20, 2023
edoakes pushed a commit to edoakes/ray that referenced this pull request Mar 22, 2023
clarng pushed a commit to clarng/ray that referenced this pull request Mar 23, 2023
chaowanggg pushed a commit to chaowanggg/ray-dev that referenced this pull request Apr 4, 2023
elliottower pushed a commit to elliottower/ray that referenced this pull request Apr 22, 2023
ProjectsByJackHe pushed a commit to ProjectsByJackHe/ray that referenced this pull request May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests-ok The tagger certifies test failures are unrelated and assumes personal liability.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants