prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Add more details to Callback doc
  (from zulip chat)
  > When are the Callbacks executed in the hydra stack exactly? More specifically, are they executed after the launchers in the environments that the launchers provide? (Would be awesome to add a sentence about this in the docs)
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `hydra/experimental/callback.py`
  Content:
  ```
  1 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
  2 import logging
  3 from typing import Any
  4 
  5 from omegaconf import DictConfig
  6 
  7 from hydra.core.utils import JobReturn
  8 
  9 logger = logging.getLogger(__name__)
  10 
  11 
  12 class Callback:
  13     def on_run_start(self, config: DictConfig, **kwargs: Any) -> None:
  14         """
  15         Called in RUN mode before job starts.
  16         """
  17         ...
  18 
  19     def on_run_end(self, config: DictConfig, **kwargs: Any) -> None:
  20         """
  21         Called in RUN mode after job ends.
  22         """
  23         ...
  24 
  25     def on_multirun_start(self, config: DictConfig, **kwargs: Any) -> None:
  26         """
  27         Called in MULTIRUN mode before any job starts.
  28         """
  29         ...
  30 
  31     def on_multirun_end(self, config: DictConfig, **kwargs: Any) -> None:
  32         """
  33         Called in MULTIRUN mode after all jobs end.
  34         """
  35         ...
  36 
  37     def on_job_start(self, config: DictConfig, **kwargs: Any) -> None:
  38         """
  39         Called in both RUN and MULTIRUN modes, once for each Hydra job (before running
  40         application code).
  41         """
  42         ...
  43 
  44     def on_job_end(
  45         self, config: DictConfig, job_return: JobReturn, **kwargs: Any
  46     ) -> None:
  47         """
  48         Called in both RUN and MULTIRUN modes, once for each Hydra job (after running
  49         application code).
  50         """
  51         ...
  52
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/hydra/experimental/callback.py b/hydra/experimental/callback.py
  --- a/hydra/experimental/callback.py
  +++ b/hydra/experimental/callback.py
  @@ -12,32 +12,37 @@
   class Callback:
       def on_run_start(self, config: DictConfig, **kwargs: Any) -> None:
           """
  -        Called in RUN mode before job starts.
  +        Called in RUN mode before job/application code starts. `config` is composed with overrides.
  +        Some `hydra.runtime` configs are not populated yet.
  +        See hydra.core.utils.run_job for more info.
           """
           ...
   
       def on_run_end(self, config: DictConfig, **kwargs: Any) -> None:
           """
  -        Called in RUN mode after job ends.
  +        Called in RUN mode after job/application code returns.
           """
           ...
   
       def on_multirun_start(self, config: DictConfig, **kwargs: Any) -> None:
           """
           Called in MULTIRUN mode before any job starts.
  +        When using a launcher, this will be executed on local machine before any Sweeper/Launcher is initialized.
           """
           ...
   
       def on_multirun_end(self, config: DictConfig, **kwargs: Any) -> None:
           """
  -        Called in MULTIRUN mode after all jobs end.
  +        Called in MULTIRUN mode after all jobs returns.
  +        When using a launcher, this will be executed on local machine.
           """
           ...
   
       def on_job_start(self, config: DictConfig, **kwargs: Any) -> None:
           """
  -        Called in both RUN and MULTIRUN modes, once for each Hydra job (before running
  -        application code).
  +        Called in both RUN and MULTIRUN modes, once for each Hydra job (before running application code).
  +        This is called from within `hydra.core.utils.run_job`. In the case of remote launching, this will be executed
  +        on the remote server along with your application code.
           """
           ...
   
  @@ -47,5 +52,10 @@
           """
           Called in both RUN and MULTIRUN modes, once for each Hydra job (after running
           application code).
  +        This is called from within `hydra.core.utils.run_job`. In the case of remote launching, this will be executed
  +        on the remote server after your application code.
  +
  +        `job_return` contains info that could be useful for logging or post-processing.
  +        See hydra.core.utils.JobReturn for more.
           """
           ...
  
verification_info: {"golden_diff": "diff --git a/hydra/experimental/callback.py b/hydra/experimental/callback.py\n--- a/hydra/experimental/callback.py\n+++ b/hydra/experimental/callback.py\n@@ -12,32 +12,37 @@\n class Callback:\n     def on_run_start(self, config: DictConfig, **kwargs: Any) -> None:\n         \"\"\"\n-        Called in RUN mode before job starts.\n+        Called in RUN mode before job/application code starts. `config` is composed with overrides.\n+        Some `hydra.runtime` configs are not populated yet.\n+        See hydra.core.utils.run_job for more info.\n         \"\"\"\n         ...\n \n     def on_run_end(self, config: DictConfig, **kwargs: Any) -> None:\n         \"\"\"\n-        Called in RUN mode after job ends.\n+        Called in RUN mode after job/application code returns.\n         \"\"\"\n         ...\n \n     def on_multirun_start(self, config: DictConfig, **kwargs: Any) -> None:\n         \"\"\"\n         Called in MULTIRUN mode before any job starts.\n+        When using a launcher, this will be executed on local machine before any Sweeper/Launcher is initialized.\n         \"\"\"\n         ...\n \n     def on_multirun_end(self, config: DictConfig, **kwargs: Any) -> None:\n         \"\"\"\n-        Called in MULTIRUN mode after all jobs end.\n+        Called in MULTIRUN mode after all jobs returns.\n+        When using a launcher, this will be executed on local machine.\n         \"\"\"\n         ...\n \n     def on_job_start(self, config: DictConfig, **kwargs: Any) -> None:\n         \"\"\"\n-        Called in both RUN and MULTIRUN modes, once for each Hydra job (before running\n-        application code).\n+        Called in both RUN and MULTIRUN modes, once for each Hydra job (before running application code).\n+        This is called from within `hydra.core.utils.run_job`. In the case of remote launching, this will be executed\n+        on the remote server along with your application code.\n         \"\"\"\n         ...\n \n@@ -47,5 +52,10 @@\n         \"\"\"\n         Called in both RUN and MULTIRUN modes, once for each Hydra job (after running\n         application code).\n+        This is called from within `hydra.core.utils.run_job`. In the case of remote launching, this will be executed\n+        on the remote server after your application code.\n+\n+        `job_return` contains info that could be useful for logging or post-processing.\n+        See hydra.core.utils.JobReturn for more.\n         \"\"\"\n         ...\n", "issue": "Add more details to Callback doc\n(from zulip chat)\r\n> When are the Callbacks executed in the hydra stack exactly? More specifically, are they executed after the launchers in the environments that the launchers provide? (Would be awesome to add a sentence about this in the docs)\r\n\n", "before_files": [{"content": "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport logging\nfrom typing import Any\n\nfrom omegaconf import DictConfig\n\nfrom hydra.core.utils import JobReturn\n\nlogger = logging.getLogger(__name__)\n\n\nclass Callback:\n    def on_run_start(self, config: DictConfig, **kwargs: Any) -> None:\n        \"\"\"\n        Called in RUN mode before job starts.\n        \"\"\"\n        ...\n\n    def on_run_end(self, config: DictConfig, **kwargs: Any) -> None:\n        \"\"\"\n        Called in RUN mode after job ends.\n        \"\"\"\n        ...\n\n    def on_multirun_start(self, config: DictConfig, **kwargs: Any) -> None:\n        \"\"\"\n        Called in MULTIRUN mode before any job starts.\n        \"\"\"\n        ...\n\n    def on_multirun_end(self, config: DictConfig, **kwargs: Any) -> None:\n        \"\"\"\n        Called in MULTIRUN mode after all jobs end.\n        \"\"\"\n        ...\n\n    def on_job_start(self, config: DictConfig, **kwargs: Any) -> None:\n        \"\"\"\n        Called in both RUN and MULTIRUN modes, once for each Hydra job (before running\n        application code).\n        \"\"\"\n        ...\n\n    def on_job_end(\n        self, config: DictConfig, job_return: JobReturn, **kwargs: Any\n    ) -> None:\n        \"\"\"\n        Called in both RUN and MULTIRUN modes, once for each Hydra job (after running\n        application code).\n        \"\"\"\n        ...\n", "path": "hydra/experimental/callback.py"}], "after_files": [{"content": "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport logging\nfrom typing import Any\n\nfrom omegaconf import DictConfig\n\nfrom hydra.core.utils import JobReturn\n\nlogger = logging.getLogger(__name__)\n\n\nclass Callback:\n    def on_run_start(self, config: DictConfig, **kwargs: Any) -> None:\n        \"\"\"\n        Called in RUN mode before job/application code starts. `config` is composed with overrides.\n        Some `hydra.runtime` configs are not populated yet.\n        See hydra.core.utils.run_job for more info.\n        \"\"\"\n        ...\n\n    def on_run_end(self, config: DictConfig, **kwargs: Any) -> None:\n        \"\"\"\n        Called in RUN mode after job/application code returns.\n        \"\"\"\n        ...\n\n    def on_multirun_start(self, config: DictConfig, **kwargs: Any) -> None:\n        \"\"\"\n        Called in MULTIRUN mode before any job starts.\n        When using a launcher, this will be executed on local machine before any Sweeper/Launcher is initialized.\n        \"\"\"\n        ...\n\n    def on_multirun_end(self, config: DictConfig, **kwargs: Any) -> None:\n        \"\"\"\n        Called in MULTIRUN mode after all jobs returns.\n        When using a launcher, this will be executed on local machine.\n        \"\"\"\n        ...\n\n    def on_job_start(self, config: DictConfig, **kwargs: Any) -> None:\n        \"\"\"\n        Called in both RUN and MULTIRUN modes, once for each Hydra job (before running application code).\n        This is called from within `hydra.core.utils.run_job`. In the case of remote launching, this will be executed\n        on the remote server along with your application code.\n        \"\"\"\n        ...\n\n    def on_job_end(\n        self, config: DictConfig, job_return: JobReturn, **kwargs: Any\n    ) -> None:\n        \"\"\"\n        Called in both RUN and MULTIRUN modes, once for each Hydra job (after running\n        application code).\n        This is called from within `hydra.core.utils.run_job`. In the case of remote launching, this will be executed\n        on the remote server after your application code.\n\n        `job_return` contains info that could be useful for logging or post-processing.\n        See hydra.core.utils.JobReturn for more.\n        \"\"\"\n        ...\n", "path": "hydra/experimental/callback.py"}]}