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

[air] Do not warn of checkpoint_dir if it's coming from us (base_trainer). #26259

Merged
merged 33 commits into from
Jul 4, 2022

Conversation

xwjiang2010
Copy link
Contributor

@xwjiang2010 xwjiang2010 commented Jul 1, 2022

Why are these changes needed?

Currently, the following information will be printed even the user is not directly using a tune function. This is confusing and not actionable.

 "`checkpoint_dir` in `func(config, checkpoint_dir)` is "
                    "being deprecated. "
                    "To save and load checkpoint in trainable functions, "
                    "please use the `ray.air.session` API:\n\n"
                    "from ray.air import session\n\n"
                    "def train(config):\n"
                    "    # ...\n"
                    '    session.report({"metric": metric}, checkpoint=checkpoint)\n\n'
                    "For more information please see "
                    "https://docs.ray.io/en/master/ray-air/key-concepts.html#session\n"

The new logic check if base_trainer is in the call stack and only adds the warning message when it is not. The new logic will be removed once internally we migrate to use session API.

Related issue number

Checks

  • 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 :(

…ainer).

This will be removed once internally we migrate to use `session` API.
@xwjiang2010 xwjiang2010 added this to the Ray AIR milestone Jul 1, 2022
Copy link
Contributor

@krfricke krfricke 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 bit hacky. Can we just add a flag to wrap_function to not warn or alternatively just trigger log_once("tune_checkpoint_dir_deprecation") in our trainers?

@xwjiang2010
Copy link
Contributor Author

This is a bit hacky. Can we just add a flag to wrap_function to not warn or alternatively just trigger log_once("tune_checkpoint_dir_deprecation") in our trainers?

Good point! Updated to warn=False in base_trainer

@krfricke krfricke merged commit b08a968 into ray-project:master Jul 4, 2022
truelegion47 pushed a commit to truelegion47/ray that referenced this pull request Jul 6, 2022
* master: (104 commits)
  [Serve] Java Client API and End to End Tests (ray-project#22726)
  [Docs] Small fix to AIR examples descriptions (ray-project#26227)
  [Deployment Graph] Move `Deployment` creation outside to build function (ray-project#26129)
  [K8s][Ray Operator] Ignore resource requests when detected container resources. (ray-project#26234)
  Revert "[Core] Add retry exception allowlist for user-defined filteri… (ray-project#26289)
  [ci] pin gpustat (ray-project#26311)
  [tune] fix `set_tune_experiment` (ray-project#26298)
  Revert "Revert "[AIR][Serve] Rename ModelWrapperDeployment -> PredictorDeployment"" (ray-project#26231)
  [Release] Use nightly base images for release tests (ray-project#25373)
  Revert "[Core] fix gRPC handlers' unlimited active calls configuration (ray-project#25626)" (ray-project#26202)
  [RLlib] Some Docs fixes (2). (ray-project#26265)
  [C++ worker] Refine worker context and more (ray-project#26281)
  Fix file_system_monitor.cc message (ray-project#26143)
  [Java] Make Java test more stable (ray-project#26282)
  [air] Do not warn of `checkpoint_dir` if it's coming from us (base_trainer). (ray-project#26259)
  [Datasets] Support drop_columns API (ray-project#26200)
  [Datasets] Fix max number of actors for default actor pool strategy (ray-project#26266)
  [ci] Stop syncer staging tests (ray-project#26273)
  [core][gcs] Add storage namespace to redis storage in GCS. (ray-project#25994)
  [workflow] Deprecate workflow.create (ray-project#26106)
  ...
@xwjiang2010 xwjiang2010 deleted the session3 branch July 26, 2023 19:54
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.

4 participants