Hydra is a framework for elegantly configuring complex applications

Related tags

Configurationhydra
Overview

logo

PyPI CircleCI PyPI - License PyPI - Python Version Downloads Code style: black Total alerts Language grade: Python zulip

A framework for elegantly configuring complex applications.

Check the website for more information.


Releases

Stable

Hydra 1.0 is the stable version of Hydra.

Development release

Hydra 1.1 is still in active development and should not be considered stable. You are welcome to try it out at your own risk and report any issues.

  • Documentation
  • Installation : pip install hydra-core --upgrade --pre
  • Dev releases are more likely to have bugs, please report any issues.
  • APIs and behaviors are subject to change without notice between different dev releases.

License

Hydra is licensed under MIT License.

Community

Ask questions in the chat or StackOverflow (Use the tag #fb-hydra or #omegaconf):

Citing Hydra

If you use Hydra in your research please use the following BibTeX entry:

@Misc{Yadan2019Hydra,
  author =       {Omry Yadan},
  title =        {Hydra - A framework for elegantly configuring complex applications},
  howpublished = {Github},
  year =         {2019},
  url =          {https://github.com/facebookresearch/hydra}
}
Comments
  • Use circleCI API to kick off multiple pipelines for different plugins.

    Use circleCI API to kick off multiple pipelines for different plugins.

    update 09/17 CircleCI support helped me find a way to kick off pipelines for forked PRs (after a few back and forth emails.), yayy.

    Test plan:

    on forked PR

    This PR is a forked PR. Pls check the checks sections for all the jobs that was kicked off. one example here, notice the plugin test was kicked off by beloved mecha-hydra. image

    IN Hydra repo

    I created a PR from within Hydra, the checks can be seen in this PR. https://github.com/facebookresearch/hydra/pull/985


    update 09/16

    • [x] move github token to github secrets https://github.com/facebookresearch/hydra/issues/973
    • [x] use deploy key instead of user key in hydra I've removed the user key and created a read only deploy key for Hydra cirleCI and kicked off a build here https://app.circleci.com/pipelines/github/facebookresearch/hydra/3484/workflows/d822ee36-a0bb-4a04-9ccd-73a42c2b4db8 (this build runs all the workflows, so if it succeeds it means we are good.)
    • [x] some related config needed for forked PR.

    Then we should be good to go with this PR.

    update 09/01

    We found a good solution for running tests in forked PR. I'm going to

    • [x] address omry's comments.
    • [x] reach out to oss with our plan - done, task in progress
    • [x] submit feature request to circleCI on only sharing selected secrets - done, support ticket created.

    TODO

    • [x] Create github bot user and set it up in Hydra (blocked by github support, our bot account was flagged as spam.)

    Motivation

    Try out parameterized the nox session.

    reduced the CI time from 46m to 16m (disclaimer: one datapoint only)

    Have you read the Contributing Guidelines on pull requests?

    Yes/No

    Test Plan

    validate yaml locally, and CI

    Related Issues and PRs

    (Is this PR part of a group of changes? Link the other relevant PRs and Issues here. Use https://help.github.com/en/articles/closing-issues-using-keywords for help on GitHub syntax)

    CLA Signed 
    opened by jieru-hu 40
  • Ray launcher WIP

    Ray launcher WIP

    Update 10/14 Follow up items:

    • [x] add custom resolver to get lib versions.
    • [x] clean up orphaned instances.

    Update 09/30

    A few items I want to follow up separately (will create PR for these)

    1. cannot run the plugin in python 3.6 (cloudpickle issue, same error message as #428, failed run here https://app.circleci.com/pipelines/github/jieru-hu/hydra/611/workflows/0d99e3b0-1442-446f-857b-f476a7707b6d/jobs/6648 ), I tried a few things (updating cloudpickle version etc but was not able to resolve it.)
    2. nightly builds test AMIs (right now the AMI is set as an env variable which is annoying everytime when we need to update the AMI id, I want to automate this.)
    3. doc update. The doc needs to be refreshed a bit. I think it might be easier to create a separate PR for this.

    Update 09/28

    Summary of the changes:

    1. Address omry's comments.

    2. Changes to integration test:

    The goal is "No outbound traffic for the test instances." The barrier is the pip install and conda create we need to run while setting up the instance which requires us to open 443 to all outbound traffic. To get around this: for conda and dependency packages needed for starting the cluster, I created a base AMI that has everything pre-installed. 2) for Hydra related packages, build the wheels at test time and install the wheels on the instance. The upside is we achieve "no outbound traffic for the instance", the downside is that means we need update AMI when dependencies changes. To help with that I created a script (create_ami.py) to automate building the AMI.

    It would be good to build nightly AMIs and wheels, that's something I want to work on soon.

    output from running `create_ami.py`
    $ AWS_PROFILE=jieru python create_ami.py 
    2020-09-28 16:23:56.268051 - Running: aws ec2 authorize-security-group-egress --group-id sg-0a1 --ip-permissions IpProtocol=tcp,FromPort=443,ToPort=443,IpRanges=[{CidrIp=0.0.0.0/0}]
    2020-09-28 16:23:57.464861 - 
    2020-09-28 16:23:57.487688 - Running: ray up /var/folders/n_/9qzct77j68j6n9lh0lw3vjqcn96zxl/T/tmpjw6lihef.yaml -y
    2020-09-28 16:25:57.400029 - 2020-09-28 16:23:58,540    INFO cli_logger.py:388 -- Using cached config at /var/folders/n_/9qzct77j68j6n9lh0lw3vjqcn96zxl/T/ray-config-d951a214f8602b878335411b5df6e84af463922b
    
    2020-09-28 16:25:57.462567 - Running: ray rsync_up /var/folders/n_/9qzct77j68j6n9lh0lw3vjqcn96zxl/T/tmpjw6lihef.yaml './setup_ami.py' '/home/ubuntu/' 
    2020-09-28 16:25:59.210039 - 2020-09-28 16:25:58,320    INFO cli_logger.py:388 -- Using cached config at /var/folders/n_/9qzct77j68j6n9lh0lw3vjqcn96zxl/T/ray-config-d951a214f8602b878335411b5df6e84af463922b
    2020-09-28 16:25:58,736 INFO cli_logger.py:388 -- NodeUpdater: i-0d82abc901a725abc: Syncing ./setup_ami.py to /home/ubuntu/...
    2020-09-28 16:25:58,922 INFO log_timer.py:25 -- NodeUpdater: i-0d82abc901a725abc: Got IP  [LogTimer=186ms]
    building file list ... done
    setup_ami.py
    
    sent 692 bytes  received 42 bytes  489.33 bytes/sec
    total size is 1345  speedup is 1.83
    Installing dependencies now, this may take a while...
    2020-09-28 16:25:59.210121 - Running: ray exec /var/folders/n_/9qzct77j68j6n9lh0lw3vjqcn96zxl/T/tmpjw6lihef.yaml 'python ./setup_ami.py' 
    ...
    Installing collected packages: typing-extensions, omegaconf
    Successfully installed omegaconf-2.0.2 typing-extensions-3.7.4.3
    2020-09-28 23:45:09.147903 - OUT: /home/ubuntu/anaconda3/envs/hydra_3.8.5/bin/pip install antlr4-python3-runtime==4.8
    2020-09-28 23:45:09.927774 - OUT: Processing ./.cache/pip/wheels/c8/d0/ab/d43c02eaddc5b9004db86950802442ad9a26f279c619e28da0/antlr4_python3_runtime-4.8-py3-none-any.whl
    Installing collected packages: antlr4-python3-runtime
    Successfully installed antlr4-python3-runtime-4.8
    2020-09-28 23:45:09.927847 - OUT: /home/ubuntu/anaconda3/envs/hydra_3.8.5/bin/pip install --ignore-installed PyYAML
    2020-09-28 23:45:10.798501 - OUT: Processing ./.cache/pip/wheels/13/90/db/290ab3a34f2ef0b5a0f89235dc2d40fea83e77de84ed2dc05c/PyYAML-5.3.1-cp38-cp38-linux_x86_64.whl
    Installing collected packages: PyYAML
    Successfully installed PyYAML-5.3.1
    Shared connection to 34.221.119.106 closed.
    2020-09-28 16:45:11.007294 - Running: aws ec2 revoke-security-group-egress --group-id sg-0a1 --ip-permissions IpProtocol=tcp,FromPort=443,ToPort=443,IpRanges=[{CidrIp=0.0.0.0/0}]
    2020-09-28 16:45:12.047395 - 
    2020-09-28 16:45:12.047395 - 
    ec2.Image(id='ami-0c46') current state pending
    ec2.Image(id='ami-0c46') current state pending
    ...
    ami-0c46 ready for use now.
    
    #### 3. skip `-Werror` flag for ray launcher, the tests will fail with the flag, stack trace (this is caused by ray, not the plugin itself) - solution is to add a pytest.ini in ray's tests dir to suppress the warnings.
    Stack trace
    test_ray_local_launcher.py .[2020-09-28 21:52:46,553][HYDRA] Ray Launcher is launching 1 jobs, sweep output dir: /private/var/folders/n_/9qzct77j68j6n9lh0lw3vjqcn96zxl/T/pytest-of-jieru/pytest-25/test_sweep_1_job_ray_local_ove0
    [2020-09-28 21:52:46,553][HYDRA] Initializing ray with config: {'num_cpus': 1, 'num_gpus': 0}
    2020-09-28 21:52:46,564 INFO resource_spec.py:223 -- Starting Ray with 8.79 GiB memory available for workers and up to 4.41 GiB for objects. You can adjust these settings with ray.init(memory=<bytes>, object_store_memory=<bytes>).
    Exception ignored in: <_io.FileIO name='/tmp/ray/session_2020-09-28_21-52-46_557592_90415/logs/redis-shard_0.err' mode='ab' closefd=True>
    Traceback (most recent call last):
      File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/ray/node.py", line 746, in start_head_processes
        self.start_redis()
    ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/ray/session_2020-09-28_21-52-46_557592_90415/logs/redis-shard_0.err' mode='a' encoding='utf-8'>
    Exception ignored in: <_io.FileIO name='/tmp/ray/session_2020-09-28_21-52-46_557592_90415/logs/redis-shard_0.out' mode='ab' closefd=True>
    Traceback (most recent call last):
      File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/ray/node.py", line 746, in start_head_processes
        self.start_redis()
    ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/ray/session_2020-09-28_21-52-46_557592_90415/logs/redis-shard_0.out' mode='a' encoding='utf-8'>
    Exception ignored in: <_io.FileIO name='/tmp/ray/session_2020-09-28_21-52-46_557592_90415/logs/redis.err' mode='ab' closefd=True>
    Traceback (most recent call last):
      File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/ray/node.py", line 746, in start_head_processes
        self.start_redis()
    ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/ray/session_2020-09-28_21-52-46_557592_90415/logs/redis.err' mode='a' encoding='utf-8'>
    Exception ignored in: <_io.FileIO name='/tmp/ray/session_2020-09-28_21-52-46_557592_90415/logs/redis.out' mode='ab' closefd=True>
    Traceback (most recent call last):
      File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/ray/node.py", line 746, in start_head_processes
        self.start_redis()
    ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/ray/session_2020-09-28_21-52-46_557592_90415/logs/redis.out' mode='a' encoding='utf-8'>
    Exception ignored in: <_io.FileIO name='/tmp/ray/session_2020-09-28_21-52-46_557592_90415/logs/gcs_server.out' mode='ab' closefd=True>
    Traceback (most recent call last):
      File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/ray/node.py", line 748, in start_head_processes
        self.start_gcs_server()
    ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/ray/session_2020-09-28_21-52-46_557592_90415/logs/gcs_server.out' mode='a' encoding='utf-8'>
    Exception ignored in: <_io.FileIO name='/tmp/ray/session_2020-09-28_21-52-46_557592_90415/logs/gcs_server.err' mode='ab' closefd=True>
    Traceback (most recent call last):
      File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/ray/node.py", line 748, in start_head_processes
        self.start_gcs_server()
    ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/ray/session_2020-09-28_21-52-46_557592_90415/logs/gcs_server.err' mode='a' encoding='utf-8'>
    Exception ignored in: <_io.FileIO name='/tmp/ray/session_2020-09-28_21-52-46_557592_90415/logs/monitor.out' mode='ab' closefd=True>
    Traceback (most recent call last):
      File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/ray/node.py", line 750, in start_head_processes
        self.start_monitor()
    ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/ray/session_2020-09-28_21-52-46_557592_90415/logs/monitor.out' mode='a' encoding='utf-8'>
    Exception ignored in: <_io.FileIO name='/tmp/ray/session_2020-09-28_21-52-46_557592_90415/logs/monitor.err' mode='ab' closefd=True>
    Traceback (most recent call last):
      File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/ray/node.py", line 750, in start_head_processes
        self.start_monitor()
    ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/ray/session_2020-09-28_21-52-46_557592_90415/logs/monitor.err' mode='a' encoding='utf-8'>
    F[2020-09-28 21:52:47,565][HYDRA] Ray Launcher is launching 2 jobs, sweep output dir: /private/var/folders/n_/9qzct77j68j6n9lh0lw3vjqcn96zxl/T/pytest-of-jieru/pytest-25/test_sweep_2_jobs_ray_local_ov0
    [2020-09-28 21:52:47,565][HYDRA] Initializing ray with config: {'num_cpus': 1, 'num_gpus': 0}
    2020-09-28 21:52:47,573 INFO resource_spec.py:223 -- Starting Ray with 8.74 GiB memory available for workers and up to 4.38 GiB for objects. You can adjust these settings with ray.init(memory=<bytes>, object_store_memory=<bytes>).
    Exception ignored in: <_io.FileIO name='/tmp/ray/session_2020-09-28_21-52-47_566018_90415/logs/redis-shard_0.err' mode='ab' closefd=True>
    Traceback (most recent call last):
      File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/ray/node.py", line 746, in start_head_processes
        self.start_redis()
    ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/ray/session_2020-09-28_21-52-47_566018_90415/logs/redis-shard_0.err' mode='a' encoding='utf-8'>
    Exception ignored in: <_io.FileIO name='/tmp/ray/session_2020-09-28_21-52-47_566018_90415/logs/redis-shard_0.out' mode='ab' closefd=True>
    Traceback (most recent call last):
      File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/ray/node.py", line 746, in start_head_processes
        self.start_redis()
    ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/ray/session_2020-09-28_21-52-47_566018_90415/logs/redis-shard_0.out' mode='a' encoding='utf-8'>
    Exception ignored in: <_io.FileIO name='/tmp/ray/session_2020-09-28_21-52-47_566018_90415/logs/redis.err' mode='ab' closefd=True>
    Traceback (most recent call last):
      File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/ray/node.py", line 746, in start_head_processes
        self.start_redis()
    ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/ray/session_2020-09-28_21-52-47_566018_90415/logs/redis.err' mode='a' encoding='utf-8'>
    Exception ignored in: <_io.FileIO name='/tmp/ray/session_2020-09-28_21-52-47_566018_90415/logs/redis.out' mode='ab' closefd=True>
    Traceback (most recent call last):
      File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/ray/node.py", line 746, in start_head_processes
        self.start_redis()
    ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/ray/session_2020-09-28_21-52-47_566018_90415/logs/redis.out' mode='a' encoding='utf-8'>
    Exception ignored in: <_io.FileIO name='/tmp/ray/session_2020-09-28_21-52-47_566018_90415/logs/gcs_server.out' mode='ab' closefd=True>
    Traceback (most recent call last):
      File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/ray/node.py", line 748, in start_head_processes
        self.start_gcs_server()
    ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/ray/session_2020-09-28_21-52-47_566018_90415/logs/gcs_server.out' mode='a' encoding='utf-8'>
    Exception ignored in: <_io.FileIO name='/tmp/ray/session_2020-09-28_21-52-47_566018_90415/logs/gcs_server.err' mode='ab' closefd=True>
    Traceback (most recent call last):
      File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/ray/node.py", line 748, in start_head_processes
        self.start_gcs_server()
    ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/ray/session_2020-09-28_21-52-47_566018_90415/logs/gcs_server.err' mode='a' encoding='utf-8'>
    Exception ignored in: <_io.FileIO name='/tmp/ray/session_2020-09-28_21-52-47_566018_90415/logs/monitor.out' mode='ab' closefd=True>
    Traceback (most recent call last):
      File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/ray/node.py", line 750, in start_head_processes
        self.start_monitor()
    ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/ray/session_2020-09-28_21-52-47_566018_90415/logs/monitor.out' mode='a' encoding='utf-8'>
    Exception ignored in: <_io.FileIO name='/tmp/ray/session_2020-09-28_21-52-47_566018_90415/logs/monitor.err' mode='ab' closefd=True>
    Traceback (most recent call last):
      File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/ray/node.py", line 750, in start_head_processes
        self.start_monitor()
    ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/ray/session_2020-09-28_21-52-47_566018_90415/logs/monitor.err' mode='a' encoding='utf-8'>
    
    INTERNALERROR> Traceback (most recent call last):
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/_pytest/main.py", line 191, in wrap_session
    INTERNALERROR>     session.exitstatus = doit(config, session) or 0
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/_pytest/main.py", line 247, in _main
    INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
    INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec
    INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>
    INTERNALERROR>     self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/pluggy/callers.py", line 208, in _multicall
    INTERNALERROR>     return outcome.get_result()
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
    INTERNALERROR>     raise ex[1].with_traceback(ex[2])
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
    INTERNALERROR>     res = hook_impl.function(*args)
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/_pytest/main.py", line 272, in pytest_runtestloop
    INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
    INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec
    INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>
    INTERNALERROR>     self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/pluggy/callers.py", line 208, in _multicall
    INTERNALERROR>     return outcome.get_result()
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
    INTERNALERROR>     raise ex[1].with_traceback(ex[2])
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
    INTERNALERROR>     res = hook_impl.function(*args)
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/_pytest/runner.py", line 85, in pytest_runtest_protocol
    INTERNALERROR>     runtestprotocol(item, nextitem=nextitem)
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/_pytest/runner.py", line 100, in runtestprotocol
    INTERNALERROR>     reports.append(call_and_report(item, "call", log))
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/_pytest/runner.py", line 188, in call_and_report
    INTERNALERROR>     report = hook.pytest_runtest_makereport(item=item, call=call)
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
    INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec
    INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>
    INTERNALERROR>     self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/pluggy/callers.py", line 203, in _multicall
    INTERNALERROR>     gen.send(outcome)
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/_pytest/skipping.py", line 129, in pytest_runtest_makereport
    INTERNALERROR>     rep = outcome.get_result()
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
    INTERNALERROR>     raise ex[1].with_traceback(ex[2])
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
    INTERNALERROR>     res = hook_impl.function(*args)
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/_pytest/runner.py", line 260, in pytest_runtest_makereport
    INTERNALERROR>     return TestReport.from_item_and_call(item, call)
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/_pytest/reports.py", line 294, in from_item_and_call
    INTERNALERROR>     longrepr = item.repr_failure(excinfo)
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/_pytest/python.py", line 1511, in repr_failure
    INTERNALERROR>     return self._repr_failure_py(excinfo, style=style)
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/_pytest/nodes.py", line 355, in _repr_failure_py
    INTERNALERROR>     return excinfo.getrepr(
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/_pytest/_code/code.py", line 635, in getrepr
    INTERNALERROR>     return fmt.repr_excinfo(self)
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/_pytest/_code/code.py", line 880, in repr_excinfo
    INTERNALERROR>     reprtraceback = self.repr_traceback(excinfo_)
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/_pytest/_code/code.py", line 824, in repr_traceback
    INTERNALERROR>     reprentry = self.repr_traceback_entry(entry, einfo)
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/_pytest/_code/code.py", line 774, in repr_traceback_entry
    INTERNALERROR>     source = self._getentrysource(entry)
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/_pytest/_code/code.py", line 685, in _getentrysource
    INTERNALERROR>     source = entry.getsource(self.astcache)
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/_pytest/_code/code.py", line 246, in getsource
    INTERNALERROR>     astnode, _, end = getstatementrange_ast(
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/_pytest/_code/source.py", line 384, in getstatementrange_ast
    INTERNALERROR>     astnode = ast.parse(content, "source", "exec")
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/ast.py", line 47, in parse
    INTERNALERROR>     return compile(source, filename, mode, flags,
    INTERNALERROR>   File "/Users/jieru/opt/anaconda3/envs/pytest38/lib/python3.8/site-packages/ray/worker.py", line 869, in sigterm_handler
    INTERNALERROR>     sys.exit(signum)
    INTERNALERROR> SystemExit: 15
    mainloop: caught unexpected SystemExit!
    
    

    4. install conda in circleCI linux docker

    Previously we pin the circleCI linux docker image to be python:3.8. however, the image runs on python 3.8.6 which is not yet available to be installed in conda. As a result, the ray launcher tests fails (cloudpickle requires the exact same version of python used on pickle and unpickle side) To be consistent with how tests are run in MACOS and WIN, I added the miniconda installation for linux machines as well. The installation takes a few secs, so I didn't add cache for it.

    Update 09/21

    Now that #815 has finally landed. This PR is unblocked finally! This is my priority this week. TODO items.

    • [x] rebase onto latest master
    • [x] upload latest wheels to S3 for installation during integration tests. In order to upload and install latest wheels in the integration, I want to:
    1. list all the plugins that's going to be tested (by getting the PLUGINS env variable), build wheels, and scp them all to the ec2 instance.
    2. Install all the wheels on the ec2 instance. This way, we can remove all outbound traffic of the testing ec2 instances.
    • [x] Address omry's comments
    • [ ] Update circleCI test user creds. and finish all the TODO items outlined in the proposal quip.

    Update 09/08 edit: moved the TODO items to the latest update.

    Update 09/01

    This PR has been blocked by #815. Now that we've figured out a good solution for #815, I will go ahead and get 815 in first and then circle back here.

    Also I'm going to create data class for both ray init, ray remote and boto configs (we will only add typing for common boto fields, and the boto config will extend Dict[str, Any])

    For the integration tests to work on the latest code, we are going to build wheels and upload to S3 with each integration test run. This will be likely be a a separate PR.


    Motivation

    This is built on https://github.com/facebookresearch/hydra/pull/515, sorry I had to open a new pull requests. I still need to figure out what's a better workflow with forking & syncing.

    This PR address some comments from PR515:

    1. Add local mode for ray launcher
    2. Add docker options
    3. refactor the Launcher class, group all file syncing together.

    Plan to add in next PR(s):

    1. Add Integration test
    2. Add an option for users to update the cluster if they need.
    3. Remote cluster return results to laptop.
    4. make _dump_func_params better/less hard coded.

    Update 04/10 Add Integration tests Ray up automatically update cluster so no need for us to provide an option for update. Now JobReturns are copied back to laptop refactor _dump_func_params a bit more.

    Next:

    1. Fix LOCAL mode to run RAY directly.
    2. Add integration tests for both LOCAL and AWS mode.

    Have you read the Contributing Guidelines on pull requests?

    Yes/No

    Test Plan

    Integration tests Run launcher in both local and AWS mode

    Run the

    Related Issues and PRs

    (Is this PR part of a group of changes? Link the other relevant PRs and Issues here. Use https://help.github.com/en/articles/closing-issues-using-keywords for help on GitHub syntax)

    CLA Signed 
    opened by jieru-hu 38
  • [Bug] I can't see any log with pytorch DDP

    [Bug] I can't see any log with pytorch DDP

    🐛 Bug

    Description

    When I use PyTorch's Distributed Data Parallel I can't see any logs in system out and log file is empty except wandb log like below.

    [2020-11-06 01:32:08,629][wandb.internal.internal][INFO] - Internal process exited
    

    Checklist

    • [x] I checked on the latest version of Hydra
    • [x] I created a minimal repro

    To reproduce

    You can reproduce by running this repo(https://github.com/ryul99/pytorch-project-template/tree/a80f0284c5b22fba2d4892bb906a9bc2b6075838) with python trainer.py train.working_dir=$(pwd) train.train.dist.gpus=1(DDP with one gpu) I'm sorry that this is not that minimal code 😅 ** Stack trace/error message **

    ❯ python trainer.py train.working_dir=$(pwd) train.train.dist.gpus=1
    /home/ryul99/.pyenv/versions/LWD/lib/python3.8/site-packages/hydra/core/utils.py:204: UserWarning: 
    Using config_path to specify the config name is deprecated, specify the config name via config_name
    See https://hydra.cc/docs/next/upgrades/0.11_to_1.0/config_path_changes
      warnings.warn(category=UserWarning, message=msg)
    /home/ryul99/.pyenv/versions/LWD/lib/python3.8/site-packages/hydra/plugins/config_source.py:190: UserWarning: 
    Missing @package directive train/default.yaml in file:///home/ryul99/Workspace/pytorch-project-template/config.
    See https://hydra.cc/docs/next/upgrades/0.11_to_1.0/adding_a_package_directive
      warnings.warn(message=msg, category=UserWarning)
    Downloading http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz to dataset/meta/MNIST/raw/train-images-idx3-ubyte.gz
    100.1%Extracting dataset/meta/MNIST/raw/train-images-idx3-ubyte.gz to dataset/meta/MNIST/raw
    Downloading http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz to dataset/meta/MNIST/raw/train-labels-idx1-ubyte.gz
    113.5%Extracting dataset/meta/MNIST/raw/train-labels-idx1-ubyte.gz to dataset/meta/MNIST/raw
    Downloading http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz to dataset/meta/MNIST/raw/t10k-images-idx3-ubyte.gz
    100.4%Extracting dataset/meta/MNIST/raw/t10k-images-idx3-ubyte.gz to dataset/meta/MNIST/raw
    Downloading http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz to dataset/meta/MNIST/raw/t10k-labels-idx1-ubyte.gz
    180.4%Extracting dataset/meta/MNIST/raw/t10k-labels-idx1-ubyte.gz to dataset/meta/MNIST/raw
    Processing...
    /home/ryul99/.pyenv/versions/LWD/lib/python3.8/site-packages/torchvision/datasets/mnist.py:480: UserWarning: The given NumPy array is not writeable, and PyTorch does not support non-writeable tensors. This means you can write to the underlying (supposedly non-writeable) NumPy array using the tensor. You may want to copy the array to protect its data or make it writeable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at  /pytorch/torch/csrc/utils/tensor_numpy.cpp:141.)
      return torch.from_numpy(parsed.astype(m[2], copy=False)).view(*s)
    Done!
    

    Expected Behavior

    If you run with python trainer.py train.working_dir=$(pwd) train.train.dist.gpus=0(not using DDP), you can see many logs like this.

    ❯ python trainer.py train.working_dir=$(pwd) train.train.dist.gpus=0
    /home/ryul99/.pyenv/versions/LWD/lib/python3.8/site-packages/hydra/core/utils.py:204: UserWarning: 
    Using config_path to specify the config name is deprecated, specify the config name via config_name
    See https://hydra.cc/docs/next/upgrades/0.11_to_1.0/config_path_changes
      warnings.warn(category=UserWarning, message=msg)
    /home/ryul99/.pyenv/versions/LWD/lib/python3.8/site-packages/hydra/plugins/config_source.py:190: UserWarning: 
    Missing @package directive train/default.yaml in file:///home/ryul99/Workspace/pytorch-project-template/config.
    See https://hydra.cc/docs/next/upgrades/0.11_to_1.0/adding_a_package_directive
      warnings.warn(message=msg, category=UserWarning)
    [2020-11-06 01:48:33,990][trainer.py][INFO] - Config:
    train:
      name: First_training
      working_dir: /home/ryul99/Workspace/pytorch-project-template
      data:
        train_dir: dataset/meta/train
        test_dir: dataset/meta/test
        file_format: '*.file_extension'
        use_background_generator: true
        divide_dataset_per_gpu: true
      train:
        random_seed: 3750
        num_epoch: 10000
        num_workers: 4
        batch_size: 64
        optimizer:
          mode: adam
          adam:
            lr: 0.001
            betas:
            - 0.9
            - 0.999
        dist:
          master_addr: localhost
          master_port: '12355'
          mode: nccl
          gpus: 0
          timeout: 30
      test:
        num_workers: 4
        batch_size: 64
      model:
        device: cuda
      log:
        use_tensorboard: true
        use_wandb: false
        wandb_init_conf:
          name: ${train.name}
          entity: null
          project: null
        summary_interval: 1
        chkpt_interval: 10
        chkpt_dir: chkpt
      load:
        wandb_load_path: null
        network_chkpt_path: null
        strict_load: false
        resume_state_path: null
    
    [2020-11-06 01:48:33,991][trainer.py][INFO] - Set up train process
    [2020-11-06 01:48:33,991][trainer.py][INFO] - BackgroundGenerator is turned off when Distributed running is on
    Downloading http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz to dataset/meta/MNIST/raw/train-images-idx3-ubyte.gz
    100.1%Extracting dataset/meta/MNIST/raw/train-images-idx3-ubyte.gz to dataset/meta/MNIST/raw
    Downloading http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz to dataset/meta/MNIST/raw/train-labels-idx1-ubyte.gz
    113.5%Extracting dataset/meta/MNIST/raw/train-labels-idx1-ubyte.gz to dataset/meta/MNIST/raw
    Downloading http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz to dataset/meta/MNIST/raw/t10k-images-idx3-ubyte.gz
    100.4%Extracting dataset/meta/MNIST/raw/t10k-images-idx3-ubyte.gz to dataset/meta/MNIST/raw
    Downloading http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz to dataset/meta/MNIST/raw/t10k-labels-idx1-ubyte.gz
    180.4%Extracting dataset/meta/MNIST/raw/t10k-labels-idx1-ubyte.gz to dataset/meta/MNIST/raw
    Processing...
    /home/ryul99/.pyenv/versions/LWD/lib/python3.8/site-packages/torchvision/datasets/mnist.py:480: UserWarning: The given NumPy array is not writeable, and PyTorch does not support non-writeable tensors. This means you can write to the underlying (supposedly non-writeable) NumPy array using the tensor. You may want to copy the array to protect its data or make it writeable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at  /pytorch/torch/csrc/utils/tensor_numpy.cpp:141.)
      return torch.from_numpy(parsed.astype(m[2], copy=False)).view(*s)
    Done!
    [2020-11-06 01:48:38,886][trainer.py][INFO] - Making train dataloader...
    [2020-11-06 01:48:38,905][trainer.py][INFO] - Making test dataloader...
    [2020-11-06 01:48:40,366][trainer.py][INFO] - Starting new training run.
    [2020-11-06 01:48:40,467][train_model.py][INFO] - Train Loss 2.3010 at step 1
    [2020-11-06 01:48:40,473][train_model.py][INFO] - Train Loss 2.3133 at step 2
    

    System information

    • Hydra Version : 1.0.3
    • Python version : 3.8.5
    • Virtual environment type and version : pyenv 1.2.21
    • Operating system : Ubuntu server 18.04

    Additional context

    Add any other context about the problem here.

    bug question 
    opened by ryul99 34
  • [Feature Request] [Submitit-Plugin] (Potentially a bug) Impossible to set certain flags in submitit launcher

    [Feature Request] [Submitit-Plugin] (Potentially a bug) Impossible to set certain flags in submitit launcher

    🚀 Feature Request

    Motivation

    This could be read as a feature request or a bug report, I'm not sure how you want to consider it, I'm going with feature request. Currently theres some flags that you cannot set in the submitit launcher. I practice "gpu centric" scheduling, so I like to specify mem_per_gpu and cpus_per_gpu and then I can just use gpus_per_task to always get the optimal settings.

    For example on "mystery cluster" (you know the one), we can use 10 cpus and 64GB RAM per GPU. These settings allow me to only have to change gpus_per_task for example if I need to have 2 GPUs for 2 different models, then I'll automatically get 20 cpus and 128GB RAM for each of the tasks without having to change all of the settings. I've already PRed stuff related to this into submitit.

    The problem occurs when you try to set, via additional parameters, something like mem_per_gpu. You can't set mem and mem_per_gpu, slurm just crashes when you do that. Similarly, if you try to set cpus_per_gpu via additional_parameters you'll wind up setting that in addition to cpus_per_task.

    Pitch

    I tried making a simple patch that fixes this, but it hits issues with the AutoExecutor which I never updated in submitit to be aware of the options which conflict with each other. I think in general auto is missing some of the recent work in submitit, and it feels like a semi-hacky workaround to me.

    Submitit already has pretty good validation logic so my pitch is to (1) let submitit handle everything by calling the correct executor for the job instead of using Auto. This is going to require a revamp of how the parameters are named/passed however and will likely be a breaking change to the API. (2) It would be nice if we could allow people to pass whatever parameters are supported by submitit without needing to update the hydra schema each time. These are my two major goals, so they sound reasonable/feasible? Point (2) may not be possible I guess.

    Other options:

    • Use auto but try to include our own validation logic (needs exploration), I don't like this because it requires us to duplicate logic that submitit has already and also it may not even be possible depending on what Auto decides to do (looked iffy on my quick pass)
    • Punt this to submitit to revamp the auto executor to do the right stuff and be more flexible. I don't like this because I think the auto executor is more of a convenience hack and more complex/flexible code would be calling the executors directly (this is what I was doing previously with my own submitit hydra wrapper thing). I also think its going to be a more more complex PR.

    Are you willing to open a pull request? (See CONTRIBUTING)

    Yes, but I want feedback first on the best way to go about it

    Additional context

    Add any other context or screenshots about the feature request here.

    enhancement 
    opened by Queuecumber 33
  • upgrade isort to v5.5.2

    upgrade isort to v5.5.2

    Motivation

    Fix issue #751

    Have you read the Contributing Guidelines on pull requests?

    Yes

    Test Plan

    (How should this PR be tested? Do you require special setup to run the test or repro the fixed bug?) Run tests as per the contributing documentation.

    $ nox -s lint
    $ FIX=1 nox -s lint_plugins
    $ pytest
    $ pre-commit run --all-files  # to check the new isort hooks pass
    

    Related Issues and PRs

    (Is this PR part of a group of changes? Link the other relevant PRs and Issues here. Use https://help.github.com/en/articles/closing-issues-using-keywords for help on GitHub syntax) issue #751

    CLA Signed 
    opened by vporta 33
  • Add a Nevergrad Sweeper plugin

    Add a Nevergrad Sweeper plugin

    Motivation

    This is a proof of concept for a Nevergrad sweeper pluging.

    I won't have time to work much on it so if anyone is willing to take it from there, feel free :D The current concerns I have:

    • the documentation should be improved, in particular how to choose an optimizer. The simplest solution is "OnePlusOne" for now. It's incredibly simple and very robust, so I made it the default optimizer.
    • I don't have ideas for a nice commandline syntax. There are a lot of possible ways to define the parametrization of a problem in nevergrad (probably too many, then again, it's a research framework so we need some flexibility for now :s). I've included a hack to be able to use the full nevergrad syntax, but that won't be very robust :D . For now only choices and standard bounded scalars are supported without the hack, we would at least need a way to define log-distributed scalars.
    • the launchers seem to only support batches, I suppose there is no way to check if some evaluations have finished so that we could make use of the free workers and launch more evaluations without waiting? That could make the sweep faster, and as far as I know with close to no performance loss.
    • Minimizing on integers is probably not as robust as minimizing on floats, I'm a bit concerned that anyone writting 0:10 in the commandline would get integers only and may not realize it, maybe the default should be float, and we'd need another way to cast to integers.

    Have you read the Contributing Guidelines on pull requests?

    Yes

    Test Plan

    Unit tests are included, as well as a runnable example

    Related Issues and PRs

    Closes #330

    CLA Signed 
    opened by jrapin 33
  • Add Joblib Launcher for parallel execution (multi-process and multi-threaded)

    Add Joblib Launcher for parallel execution (multi-process and multi-threaded)

    Motivation

    Launcher for local parallel sweeps using Joblib.Parallel, as proposed in #357, and discussed with @omry.

    Have you read the Contributing Guidelines on pull requests?

    Yes

    Test Plan

    Added tests following the example_launcher_plugin.

    Related Issues and PRs

    Implements #357

    CLA Signed 
    opened by jan-matthis 32
  • Add Ax plugin for Hydra

    Add Ax plugin for Hydra

    opened by shagunsodhani 32
  • [Ax Sweeper]: Integrate override parser

    [Ax Sweeper]: Integrate override parser

    Motivation

    Integrate override parser.

    Todo:

    • [x] Clarify how to integrate fixed-params
    • [x] Update documentation
    • [x] Remove type inference logic
    • [x] Add news entry

    Have you read the Contributing Guidelines on pull requests?

    Yes

    Test Plan

    CI

    Related Issues and PRs

    (Is this PR part of a group of changes? Link the other relevant PRs and Issues here. Use https://help.github.com/en/articles/closing-issues-using-keywords for help on GitHub syntax)

    #870

    CLA Signed 
    opened by shagunsodhani 30
  • Allow configuring the search path via the config file

    Allow configuring the search path via the config file

    Design doc outlining consideration and possible implementations:

    https://docs.google.com/document/d/1Dx77SThg1ugnGHvZ8Dq1FQusXDvGn0tyyWBeJ3nXvro/edit?usp=sharing

    enhancement 
    opened by omry 30
  • Fix for docker support in Ray AWS Launcher

    Fix for docker support in Ray AWS Launcher

    Motivation

    This PR fixes this issue , and patches a small bug that crashes Docker containers launched with the plugin. Some redundant hidden behavior has been removed from EnvSetupConf.

    Have you read the Contributing Guidelines on pull requests?

    Yes

    Test Plan

    All the core tests pass, and the same number of plugin tests fail as on the main branch (22 passed, 20 errors). Testing containerized jobs managed with Ray on EC2 is pretty tricky, I'm not sure how to design a production-level test for something like that. You'd need an AWS account and something like DockerHub serving an image Ray could download.

    Related Issues and PRs

    (Is this PR part of a group of changes? Link the other relevant PRs and Issues here. Use https://help.github.com/en/articles/closing-issues-using-keywords for help on GitHub syntax)

    https://github.com/facebookresearch/hydra/issues/1191

    CLA Signed 
    opened by samuelstanton 26
  • [Bug] MissingConfigException cannot be correctly deserialized, due to lack of  missing_cfg_file ctor default

    [Bug] MissingConfigException cannot be correctly deserialized, due to lack of missing_cfg_file ctor default

    🐛 Bug

    Description

    in https://github.com/facebookresearch/hydra/blob/main/hydra/errors.py the missing_cfg_file parameter of the MissingConfigException should be defaulted to None since it is optional, otherwise deserialization will fail.

    Checklist

    • [x] I checked on latest commit [7bc2b1a] of errors.py (https://github.com/facebookresearch/hydra/commit/7bc2b1ad66da91a12c6158f9413c908b211bff1e)
    • [x] I created a minimal repro (See this for tips).

    To reproduce

    ** Minimal Code/Config snippet to reproduce ** import hydra e=hydra.errors.MissingConfigException('missing', 'file') import pickle x=pickle.dumps(e) y=pickle.loads(x) ** Stack trace/error message **

    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: __init__() missing 1 required positional argument: 'missing_cfg_file'
    

    Expected Behavior

    successful deserialization:

    >>> y
    MissingConfigException('missing')
    

    System information

    • Hydra Version : hydra-core==1.3.1
    • Python version : Python 3.8.13
    • Virtual environment type and version : None
    • Operating system : Ubuntu 22.04.1 LT

    Additional context

    This exception was serialized/deserialized when using ray tune.

    bug 
    opened by gazonk 0
  • [Documentation Bug] Use of the term 'duck type' in documentation

    [Documentation Bug] Use of the term 'duck type' in documentation

    This may be me being a stickler but I was super confused by the use of the term duck-typing on this (and related pages):

    https://hydra.cc/docs/tutorials/structured_config/minimal_example/

    The official Python documentation refers to this functionality as type hinting. I understand duck typing as a concept is all about testing for functionality rather than being explicit about type. So in short, I'm super confused about the documentation using the term 'duck typing' when referring to the cfg: MySQLConfig code.

    That being said the official Python page also uses the term duck typing in various places on the page, but the overarching term to me still appears to be type hinting, unless I'm missing something.

    bug 
    opened by Gazoo101 0
  • Remove usages of legacy importlib API.

    Remove usages of legacy importlib API.

    Motivation

    The Python >= 3.10 compatible usages of importlib added in 277ff54b71e31531923a51459b328391d76bb5b3 can be safely applied to any version of Python >= 3.5 which covers the full range that Hydra supports.

    Getting rid of the old deprecated API, asides from cleaning up, will keep Hydra compatible with PyInstaller if PyInstaller doesn't get cold feet and revert its dropping of support for the legacy API (https://github.com/pyinstaller/pyinstaller/pull/7344).

    Have you read the Contributing Guidelines on pull requests?

    Yes

    Test Plan

    (How should this PR be tested? Do you require special setup to run the test or repro the fixed bug?)

    Standard CI/CD testing should be sufficient.

    Related Issues and PRs

    (Is this PR part of a group of changes? Link the other relevant PRs and Issues here. Use https://help.github.com/en/articles/closing-issues-using-keywords for help on GitHub syntax)

    None.

    CLA Signed 
    opened by bwoodsend 1
  • docs: reorganize sections in Configuring Hydra page

    docs: reorganize sections in Configuring Hydra page

    This PR reorders sections on the https://hydra.cc/docs/1.3/configure_hydra/intro/ webpage. I've moved the section on top-level hydra config settings higher up on the page, and I've merged the section on hydra.mode into the section on top-level hydra settings. Additionally, I've added a clarifying sentence to the entry regarding. hydra.mode.

    CLA Signed 
    opened by Jasha10 0
  • improve hydra.utils.get_{class,method,object}

    improve hydra.utils.get_{class,method,object}

    Implement hydra.utils.get_object for an easier way to look up objects from a dotpath.

    Commits:

    • improve err msg for get_class failure
    • improve tests for get_{class,method}
    • implement hydra.utils.get_object (Closes #2139)
    • document hydra.utils.get_{class,method,object} (Closes #1972)
    CLA Signed 
    opened by Jasha10 0
  • [Bug] instantiate: top-level `_target_` has inconsistent behavior with `_convert_`

    [Bug] instantiate: top-level `_target_` has inconsistent behavior with `_convert_`

    🐛 Bug

    Description

    The _convert_ flag has no effect when instantiating a config that has a _target_ at the top level.

    To reproduce

    from dataclasses import dataclass
    
    import hydra
    from omegaconf import DictConfig
    from pytest import raises
    
    @dataclass
    class MyDataclass:
        ...
    
    cfg = {"_target_": "__main__.MyDataclass"}
    
    obj = hydra.utils.instantiate(cfg, _convert_="none")
    with raises(AssertionError):
        assert isinstance(obj, DictConfig)  # got MyDataclass
    
    obj = hydra.utils.instantiate(cfg, _convert_="partial")
    with raises(AssertionError):
        assert isinstance(obj, DictConfig)  # got MyDataclass
    
    obj = hydra.utils.instantiate(cfg, _convert_="object")
    assert isinstance(obj, MyDataclass)  # Ok
    
    obj = hydra.utils.instantiate(cfg, _convert_="all")
    with raises(AssertionError):
        assert isinstance(obj, dict)  # got MyDataclass
    

    Expected Behavior

    None of the above assertions should raise an AssertionError; _convert_ should have the same effect for top-level configs as for nested configs.

    System information

    • Hydra Version : 1.4.0.dev0
    • Python version : 3.10.8

    Additional context

    Based on bug report #2504.

    bug instantiate_api structured config 
    opened by Jasha10 0
Releases(v1.3.1)
  • v1.3.1(Dec 21, 2022)

  • v1.3.0(Dec 8, 2022)

    1.3.0 (2022-12-08)

    Features:

    • Implement _convert_="object" option for instantiate, enabling conversion of non-_target_ structured configs to instances of the backing dataclass / attr class. (#1719)
    • Enable layering of the @hydra.main decorator on top of other decorators produced using functools.wraps. (#2303)
    • Allow for non-leading dashes in override keys (#2363)
    • support specifying an absolute path with --config-path (#2368)
    • Support python3.11 (#2443)

    Bug Fixes:

    • Fix an issue where Hydra's exception-handling logic could raise an AssertionError (#2342)

    Links:

    Source code(tar.gz)
    Source code(zip)
  • v1.2.0(May 17, 2022)

    1.2.0 (2022-05-17)

    Bug fixes

    • hydra.runtime.choices is now updated correctly during multi-run (#1882)
    • hydra.verbose=True now works with multirun. (#1897)
    • Fix a resolution error occurring when a nested class is passed as a _target_ keyword argument to instantiate (#1914)
    • It is now possible to pass other callable objects (besides functions) to hydra.main. (#2042)

    New features

    • Add support to Hydra's instantiation API for creation of functools.partial instances via a _partial_ keyword. (#1283)
    • Support defining basic sweeping in input config. (#1376)
    • Improve error message with more context when an omegaconf exception occurs during the config merge step. (#1697)
    • Add --experimental-rerun command-line option to reproduce pickled single runs (#1805)
    • Add experimental Callback for pickling job info. (#2092)
    • Implement tab completions for appending to the defaults list (+group=option) and deleting from the defaults list (~group). (#1841)
    • Enable the use of the pipe symbol | in unquoted strings when parsing command-line overrides. (#1850)
    • Support for Python 3.10 (#1856)
    • Improve clarity of error messages when hydra.utils.instantiate encounters a _target_ that cannot be located (#1863)
    • The instantiate API now accepts ListConfig/list-type config as top-level input. (#1950)
    • Improve error messages raised in case of instantiation failure. (#2099)
    • Add callback for logging JobReturn. (#2100)
    • Support disable changing working directory at runtime. (#910)
    • Support setting hydra.mode through config. (#394)

    Behavior changes

    • The antlr version requirement is updated from 4.8 to 4.9, to align better with current antlr versions
    • If user code raises an exception when called by instantiate, raise an InstantiateError exception instead of an instance of the same exception class that was raised by the user code. (#1911)
    • Remove support for deprecated arg config_loader to Plugin.setup, and update signature of run_job to require hydra_context. (#1953)

    The remaining changes are protected by the new version_base support, which allows one to either configure Hydra to support older setups / config, or configure Hydra to use the following more modern defaults:

    • Remove deprecated "old optional" defaults list syntax (#1952)
    • Remove support for the legacy hydra override syntax (see deprecation notice). (#2056)
    • Remove support for old hydra.experimental.{compose,initialize} interface
    • Remove support for _name_ and _group_ from package header (see deprecation notice)
    • Remove support for legacy default list interpolation format (see deprecation notice)
    • Remove support for TargetConf class
    • Remove support for strict flag from compose API (see deprecation notice)
    • Remove support for ".yml" extensions, requiring ".yaml" instead.
    • Default to not changing the working directory at runtime. Use hydra.job.chdir=True to reinstate old behavior.
    • Default to not adding any directory to the config path. (see config_path options)
    Source code(tar.gz)
    Source code(zip)
  • v1.1.2(Apr 12, 2022)

    1.1.2 (2022-04-12)

    Features

    • Add support to Hydra's instantiation API for creation of functools.partial instances via a _partial_ keyword. (#1283)
    • The instantiate API now accepts ListConfig/list-type config as top-level input. (#1950)
    • Improve error messages raised in case of instantiation failure. (#2099)
    • Add callback for logging JobReturn. (#2100)

    API Change (Renames, deprecations and removals)

    • Fix an internal key collision to prevent an exception when - group@_global_: choice is used in the same defaults list as - group: choice. (#1784)

    Bug Fixes

    • Improve error message when a missing default must be specified at the command line (#1742)
    • Fix an edge case where a defaults list defined in a missing dataclass node causes a ConfigCompositionException. (#1765)
    Source code(tar.gz)
    Source code(zip)
  • v1.1.1(Aug 19, 2021)

    1.1.1 (2021-08-19)

    Features

    • Allow range() in override grammar to have only one argument (the stop value), e.g. range(3) (#1664)
    • Add support for a HYDRA_DEPRECATION_WARNINGS_AS_ERRORS envorinment variable. When it is set, using deprecated features causes an exception instead of a warning. (#1689)
    • To make migration from Hydra 1.0 to 1.1 easier, Hydra will now issue a warning if the primary config defines config values and Defaults List if the Defaults List does not specify _self_ (#1755)

    API Change (Renames, deprecations and removals)

    • Re-introduced a deprecated strict flag in the Compose API (#1694)
    • Relax handling of legacy hydra overrides in the defaults list to make migration from Hydra 1.0 to 1.1 easier (#1748)

    Bug Fixes

    • Allow Defaults List interpolation in nested configs and document that the interpolation keys must be absolute (#1668)
    • instantiate API now supports target as a parameter name (#1669)
    • Fix --cfg=job --resolve and --help --resolve so that the ${hydra:...} resolver now prints properly (#1681)
    • Fix unexpected changes to defaults list in some cases when appending an experiment (+experiment=test) (#1706)
    • Fixed composition where top level of a config composed from a config group is a list (#1724)
    • Fix bug where overriding hydra config groups more than once without using the override keyword resulted in an error instead of deprecation warnings (#1730)
    • Fix failure when sanitizing stack traces resulting from job exceptions (#1739)
    Source code(tar.gz)
    Source code(zip)
  • v1.0.7(Jul 15, 2021)

    1.0.7 (2021-07-14)

    This release contains a few small changes to make Hydra 1.0 a bit more compatible with OmegaConf 2.1 and Hydra 1.1 to enable easier migration. There is no risk in using it if you are using 1.0.6 now as it just makes the migration a bit smoother in some scenarios:

    1. If you are upgrading OmegaConf to 2.1 before upgrading Hydra to 1.1.
    2. It enables some configs to be compatible with both versions in some rare cases related to the change in the default composition order in Hydra 1.1.

    Maintenance Changes

    • Enables Hydra 1.0 to work with OmegaConf 2.1 (Manual installation of OmegaConf 2.1 is required) (#1634)
    • Hydra 1.0 ignores _self_ in Defaults List for partial future compatibility with Hydra 1.1 (#1712)
    Source code(tar.gz)
    Source code(zip)
  • v1.1.0(Jun 10, 2021)

    1.1.0 (2021-06-09)

    This is the biggest Hydra release yet.

    Highlights

    • OmegaConf 2.1 supports relative interpolations, nested interpolations, more powerful resolvers and better compatibility with plain Python dict and list.
    • Recursive defaults list: Every config can now have a Defaults List.
    • Recursive instantiation: When instantiating objects using the instantiate API, nested defined objects are instantiated automatically.

    There have also been many bug fixes and performance improvements, as well of as some breaking changes - both in Hydra and in OmegaConf. Please check the API changes and deprecation sections in these release notes and in the OmegaConf release notes.

    Features

    General enhancements

    • Upgrade to OmegaConf 2.1. Please check the release notes for it (#1426)
    • Support for Python 3.9. (#1062)
    • Improve performance of config composition in a benchmark by 64% (#1328)
    • Allow @, $ and ? symbols in unquoted values in overrides (#1074, #1437, #1597)
    • Add a --resolve flag that can be used with the --cfg and --help flags to resolve interpolations before the config is printed. (#1585,#1482)
    • It is now possible to disable Hydra's logging configuration (#1130)
    • Support for Zsh tab completion (#347)
    • Support for force-add of config values via ++key=value (force-add overrides if the value exists and adds it otherwise) (#1049)
    • New experimental Callback API (#1402)

    Config composition enhancements

    • Support for Defaults List in any config (Recursive relative defaults) (#1170)
    • Composition order of a config with a Defaults List can be specified with the _self_ keyword. (#326)
    • Support for configuring the config search path from the primary config (#274)
    • Add support for selecting multiple configs from the same Config Group (#499)
    • Final choices of defaults list are retained in the dictionary hydra.runtime.choices (#956)

    Object Instantiation enhancements

    • Support for recursive instantiation with hydra.utils.instantiate() (#566)
    • Instantiate now fully supports positional arguments (#1432)
    • Support for converting parameters to primitive containers during instantiation (#1015)
    • It is now possible to override the _target_ of instantiation with a Python type or a string (#1017)

    API Change (Renames, deprecations and removals)

    General changes

    • Default composition order change, see this for details (#1217)
    • Remove deprecated strict flag from @hydra.main and the Compose API (#1010)
    • Passing a config name as config_path to @hydra.main is now an error (#1010)
    • Promote hydra.experimental.{compose,initialize,initialize_config_dir,initialize_config_module} out from the hydra.experimental module to the hydra module. (#1030)
    • The override grammar now requires that, in quoted strings, any sequence of \ preceding a quote (either an escaped quote, or the closing quote) must be escaped (#1600)
    • Support partial failures in MULTIRUN mode (#1377)
    • Add HydraContext to run_job and Launcher/Sweeper's setup (#1498)

    Instantiate changes

    • Instantiate is now recursive by default, use _recursive_=False to disable recursive instantiation. (#566)
    • Deprecated TargetConf, you should no longer be extending or annotating with it (#1010)
    • Remove ObjectConf and deprecated params support that was deprecated in Hydra 1.0 (#1010)

    Plugins API changes

    • HydraContext required in run_job, Launcher and Sweeper's setup methods, see issue for details (#1498)
    • ConfigSourcePlugins needs to be modified to support recursive defaults, see link for details (#1080)

    Bug Fixes

    • Hydra no longer erroneously changes the USER environment variable in pytest unit tests once installed (#1059)
    • Fix a bug where Structured Config has a field like list : Optional[List[int]] = None (#1117)
    • No longer modifies exception stack trace when running under a debugger (#1237)
    • hydra.job.{id,num} are now properly passed to jobs in multirun (#1270)
    • Add support for %f directive (microseconds) to the ${now:PATTERN} resolver (#1287)
    • Fixed a bug where tab completion did not work if the Defaults List had a missing (???) item. (#1381)
    • Fix + overrides to properly insert new values into Structured Configs. (#1515)
    • Fix edge cases where using the command line to set a key to a value containing a string ending with a backslash could crash (#1600)
    • --cfg=hydra now works for read-only config (#1461)
    • Change hydra.job_logging and hydra.hydra_logging to be non-optional (#1656)
    • Configs with unicode characters are now working on Windows (#1659)

    Plugins

    Improved Documentation

    Source code(tar.gz)
    Source code(zip)
  • v1.1.0.rc1(May 13, 2021)

    1.1.0.rc1 (2021-05-13)

    This is the biggest Hydra release yet.

    Highlights

    • OmegaConf 2.1 supports relative interpolations, nested interpolations, more powerful resolvers and better compatibility with plain Python dict and list.
    • Recursive defaults list: Every config can now have a Defaults List.
    • Recursive instantiation: When instantiating objects using the instantiate API, nested defined objects are instantiated automatically.

    There have also been many bug fixes and performance improvements, as well of as some breaking changes - both in Hydra and in OmegaConf. Please check the API changes and deprecation sections in these release notes and in the OmegaConf release notes.

    Features

    General enhancements

    • Upgrade to OmegaConf 2.1. Please check the release notes for it (#1426)
    • Support for Python 3.9. (#1062)
    • Improve performance of config composition in a benchmark by 64% (#1328)
    • Allow @, $ and ? symbols in unquoted values in overrides (#1074, #1437, #1597)
    • Add a --resolve flag that can be used with the --cfg flag to resolve interpolations before the config is printed. (#1585)
    • It is now possible to disable Hydra's logging configuration (#1130)
    • Support for Zsh tab completion (#347)
    • Support for force-add of config values via ++key=value (force-add overrides if the value exists and adds it otherwise) (#1049)

    Config composition enhancements

    • Support for Defaults List in any config (Recursive relative defaults) (#1170)
    • Composition order of a config with a Defaults List can be specified with the _self_ keyword. (#326)
    • Support for configuring the config search path from the primary config (#274)
    • Add support for selecting multiple configs from the same Config Group (#499)
    • Final choices of defaults list are retained in the dictionary hydra.runtime.choices (#956)

    Object Instantiation enhancements

    • Support for recursive instantiation with hydra.utils.instantiate() (#566)
    • Instantiate now fully supports positional arguments (#1432)
    • Support for converting parameters to primitive containers during instantiation (#1015)
    • It is now possible to override the _target_ of instantiation with a Python type or a string (#1017)

    API Change (Renames, deprecations and removals)

    General changes

    • Default composition order change, see this for details (#1217)
    • Remove deprecated strict flag from @hydra.main and the Compose API (#1010)
    • Passing a config name as config_path to @hydra.main is now an error (#1010)
    • Promote hydra.experimental.{compose,initialize,initialize_config_dir,initialize_config_module} out from the hydra.experimental module to the hydra module. (#1030)
    • The override grammar now requires that, in quoted strings, any sequence of \ preceding a quote (either an escaped quote, or the closing quote) must be escaped (#1600)

    Instantiate changes

    • Instantiate is now recursive by default, use _recursive_=False to disable recursive instantiation. (#566)
    • Deprecated TargetConf, you should no longer be extending or annotating with it (#1010)
    • Remove ObjectConf and deprecated params support that was deprecated in Hydra 1.0 (#1010)

    Plugins API changes

    • HydraContext required in run_job, Launcher and Sweeper's setup methods, see issue for details (#1498)
    • ConfigSourcePlugins needs to be modified to support recursive defaults, see link for details (#1080)

    Bug Fixes

    • Hydra no longer erroneously changes the USER environment variable in pytest unit tests once installed (#1059)
    • Fix a bug where Structured Config has a field like list : Optional[List[int]] = None (#1117)
    • No longer modifies exception stack trace when running under a debugger (#1237)
    • hydra.job.{id,num} are now properly passed to jobs in multirun (#1270)
    • Add support for %f directive (microseconds) to the ${now:PATTERN} resolver (#1287)
    • Fixed a bug where tab completion did not work if the Defaults List had a missing (???) item. (#1381)
    • Fix + overrides to properly insert new values into Structured Configs. (#1515)
    • Fix edge cases where using the command line to set a key to a value containing a string ending with a backslash could crash (#1600)

    Plugins

    Improved Documentation

    Source code(tar.gz)
    Source code(zip)
  • v1.1.0.dev6(Apr 28, 2021)

    The following are informal release notes for Hydra 1.1 as of the publication of 1.1.0.dev6. Note that there are many changes in OmegaConf 2.1 that are not covered by these release notes. Once OmegaConf 2.1 is officially release it will have formal release notes.

    Features

    • Support for converting parameters to primitive containers during instantiation (#1015)
    • It is now possible to override the target of instantiation with a type or a string (#1017)
    • Support for force-add of config values via ++key=value (force-add overrides if the value exists and adds it otherwise) (#1049)
    • Support Python 3.9. (#1062)
    • It is now possible to disable Hydra's logging configuration (#1130)
    • Support for Defaults List in any config (Recursive relative defaults) (#1170)
    • Improve performance of config composition in a benchmark by 64% (#1328)
    • Can now add keys to fields annotated as Dict[K,V] from the command line without + prefix (#1421)
    • Upgrade to OmegaConf 2.1 (#1426)
    • Instantiate now fully supports positional arguments (#1432)
    • Support for configuring the config search path from the primary config (#274)
    • Composition order of a config with a Defaults List can be specified with the self keyword. (#326)
    • Support for Zsh tab completion (#347)
    • Add support for selecting multiple configs from the same Config Group (#499)
    • Support for recursive instantiation with hydra.utils.instantiate() (#566)
    • Final choices of defaults list are retained in the dictionary hydra.runtime.choices (#956)

    API Change (Renames, deprecations and removals)

    • Deprecated TargetConf, you should no longer be extending or annotating with it (#1010)
    • Remove ObjectConf and deprecated params support that was deprecated in Hydra 1.0 (#1010)
    • Remove deprecated strict flag from @hydra.main and the Compose API (#1010)
    • Passing a config name as config_path to @hydra.main is now an error (#1010)
    • Promote hydra.experimental.{compose,initialize,initialize_config_dir,initialize_config_module} out from the hydra.experimental module to the hydra module. (#1030)
    • ConfigSourcePlugins needs to be modified to support recursive defaults, see link for details (#1080)
    • Default composition order change, see this for details (#1217)
    • Instantiate is now recursive by default, use recursive=False to disable recursive instantiation. (#566)

    Bug Fixes

    • Hydra no longer errorenously changes the USER environment variable in pytest unit tests once installed (#1059)
    • Allow @ symbol in unquoted values in overrides (#1074)
    • Fix a bug where Structured Config has a field like 'list : Optional[List[int]] = None` (#1117)
    • No longer modifies exception stack trace when running under a debugger (#1237)
    • Fixed hydra.job.id and hydra.job.num not getting passed to jobs in multirun (#1270)
    • Add support for %f directive (microseconds) to the ${now:} resolver (#1287)
    • Fix interpolation in Hydra config node (#1335)
    • Fixed a bug where tab completion did not work if the Defaults List had a missing (???) item. (#1381)
    • Fix add overrides to properly insert new values into Structured Configs. (#1515)

    Plugins

    • Add Optuna Sweeper plugin
    • Add support for multi-objective optimization to Optuna sweeper

    Improved Documentation

    Source code(tar.gz)
    Source code(zip)
  • v1.0.6(Feb 1, 2021)

  • v1.0.5(Jan 7, 2021)

    1.0.5 (2021-01-07)

    Features

    • Support Python 3.9 . (#1062)

    API Change (Renames, deprecations and removals)

    • Deprecate support for renaming packages via the command line. (#1140)

    Bug Fixes

    • Fixed hydra.job.id and hydra.job.num not getting passed to jobs in multirun (#1270)

    Plugins

    • Support additional_parameters as an optional param in the Submitit launcher plugin.
    • Add Optuna Sweeper plugin

    Maintenance Changes

    • Limit OmegaConf depedency to 2.0 versions (#1253)
    Source code(tar.gz)
    Source code(zip)
  • v1.0.4(Nov 18, 2020)

    1.0.4 (2020-11-17)

    Bug Fixes

    • Hydra no longer errorenously changes the USER environment variable in pytest unit tests once installed (#1059)
    • Allow @ symbol in unquoted values in overrides (#1074)
    • Fix a bug where Structured Config has a field like 'list : Optional[List[int]] = None` (#1117)

    Plugins

    • Switch Ax Sweeper plugin to use new Hydra command line syntax
    • Switch Nevergrad Sweeper plugin to use new Hydra command line syntax
    • Revert the use of "_" to separate the path element in keys for the Ax sweeper plugin.
    Source code(tar.gz)
    Source code(zip)
  • v1.0.3(Sep 23, 2020)

  • v1.0.2(Sep 20, 2020)

    1.0.2 (2020-09-20)

    This is a small update improving support for config dataclasses generated by configen.

    Features

    • Overridden parameters annotated as Any in the config are not type checked by instantiate() (#982)
    Source code(tar.gz)
    Source code(zip)
  • v1.0.1(Sep 15, 2020)

    1.0.1 (2020-09-15)

    Features

    • Add ability to escape special characters in unquoted command line values (#954)

    Bug Fixes

    • Add support for merging dicts and lists specified in the commend line (#939)
    • Fix appending dict values with new fields to config with + (#946)
    • Fix for Override Grammar integer parsing: Integers are now compatible with Python integers ('+' prefix, correct handling of '_') (#954)

    Maintenance Changes

    • Upgrade to OmegaConf 2.0.2 (#755)
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Sep 3, 2020)

    1.0.0 (2020-09-03)

    Hydra 1.0 is out! See blog post for high level details.

    Major new features in Hydra 1.0

    • Config type safety via Structured Configs
    • More powerful command line
    • New plugins enabling remote launching and hyper parameter optimization
    • Improved error reporting
    • Reduce nesting levels with config packages

    These release notes are covering the changes since 1.0.0rc4.

    To see the complete release notes for 1.0 take a look at the release notes of:

    Features

    • Add support for casting interval to ints and floats (#915)

    Bug Fixes

    • Fix to flush logging instead of shutting it down at job end (#833)
    • compose() no longer initialized logging subsystem (#833)
    • Fix overriding of hydra.job.env_set from the command line (#854)
    • Fix tab completion to not output errors in some cases when using --multirun (#856)
    • Fix OmegaConf custom resolvers not being propagated to Sweepers properly (#861)
    • Interpolation accepts any char between ${ and } (#891)
    • Update the signature of hydra.utils.instantiate() allow input configs of Any type (#896)
    • Fix instantiate to work correctly when parameters are interpolations into a parent node (#904)
    • Apps will now raise underlying exception if env HYDRA_FULL_ERROR=1 (#926)

    Plugins

    • Fix integer/float choice from spec in the Nevergrad plugin

    Improved Documentation

    • New page in Structured Configs tutorial: Static schema with many configs (#918)
    • New page in Structured Configs tutorial: Dynamic schema with many configs (#918)
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0rc4(Aug 18, 2020)

    1.0.0rc4 (2020-08-18)

    Features

    • Upgrade to OmegaConf 2.0.1rc12 (#889)

    Bug Fixes

    • Fix bug with bash autocompletion for the users who has . in their PATH environment variable (#868)
    • Fix instantiate to return None when None config is passed (#887)
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0rc3(Aug 17, 2020)

    1.0.0rc3 (2020-08-17)

    Features

    • Extended Override grammar supports range(),glob(),type casts,shuffle, sort and more. (#752)
    • Add support for specifying an additional config dir in the command line (#874)
    • Allow overriding of the defaults and hydra nodes in primary Structured Configs that does not mentioned defaults and hydra. (#877)

    API Change (Renames, deprecations and removals)

    • ObjectConf is deprecated for TargetConf. See upgrade page. (#882)
    • All plugins updated to use TargetConf. Be sure to update all your Hydra plugins (#882)
    • Instantiated objects no longer have a params node in the conf. keys like hydra.launcher.params.foo are changed to hydra.launcher.foo. Update your configs and overrides if you were overriding such parameters. (#882)

    Bug Fixes

    • Fixed parsing of two nested lists with whitespace between them: [[a], [b]] (#836)

    Improved Documentation

    • New Extended command line syntax page (#752)
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0rc1(Aug 18, 2020)

    1.0.0-rc1 (2020-05-31)

    Hydra 1.0 is a major release introducing many new features and breaking some compatibility.

    Features

    • Upgrade to OmegaConf 2.0 (Release notes) (#630)
    • Optional config type safety via Structured Configs (#629)
    • Improve command line and config composition error reporting (#349)
    • Hydra config can now be accessed through interpolation using ${hydra:key}, for example ${hydra:job.name} (#325)
    • Support for setting environment variable of running job (#7)
    • Changes command line processing (requiring + and ~ prefixes for appending and removing items) (#598)
    • Introducing @package header for config files (#586)
    • Add command line override flags for config_path and config_name (--config-path and --config-name) (#386)
    • hydra.main() now take an optional cfg object to passthrough to the function (#575)
    • Add hydra.experimental.{initialize_with_file, initialize_with_module} (#574)
    • Support for disabling the creation of the .hydra subdirectory by overriding "hydra.output_subdir" to "null" (#324)
    • Add hydra.utils.call() to call methods and functions as well as instantiate objects. Search module paths more generically. (#498)
    • Add support for overriding package from command line and defaults list (#235)
    • Config source is now abstracted, allowing additional config sources to be used (#257)
    • New ConfigSource plugin API allowing configs to be provided by external plugins (#367)
    • Add isort to ensure imports are always sorted (#340)
    • Codebase is now passing mypy --strict type checking (#342)
    • Improve performance of plugin discovery and instantiation (#489)
    • Modules whose name starts with "_" are skipped during plugin discovery (#494)

    Plugins

    API Change (Renames, deprecations and removals)

    • Drop support Python 2.7 and 3.5 (#313)
    • hydra.main() now takes an additional optional config_name and composite-style config_path is deprecated (#395)
    • Launcher API launch method now takes an additional initial_job_idx indicating the id of the first job in the batch (#284)
    • Singleton metaclass is now exposed at hydra.core.Singleton (#371)
    • Moved HydraConfig from hydra.plugins.common.utils to hydra.core (#371)
    • Move several formerly internal APIs to hydra/core to ensure plugins does not need to use internal APIs (#371)
    • Plugin import now requires explicit name (from hydra.plugins.launcher import Launcher) (#371)
    • Object Config "class" field is deprecated in favor of "cls" and will be removed in a future version. (#389)
    • Experimental compose API config_file changed to config_name (#395)
    • User plugins should be modified to not import twice during plugin discovery. see issue for details. (#482)
    • Change hydra.core.plugins.Plugins class to a Singleton. access should be changed to the pattern Plugins.instance().foo() (#489)
    • Plugins should now include test fixtures (sweep_runner, task_runner) via a standardized conftest.py (#521)
    • Switch Python 3 native namespace packages for plugins (See task for details) (#534)
    • Packaged configuration directories now requires an __init__.py at their top level (#536)
    • Appending config groups to the defaults list via the command line now requires a + prefix (#598)
    • Removing an item from the defaults list by assigning null (db=null) is deprecated, use ~db instead (#598)
    • Installed Hydra applications no longer need have an additional entry() function on the stack (#92)

    Bug Fixes

    • Fix a bug causing sys.exit() error code to not be propagated (#351)
    • Shutdown logging subsystem aftter job finishes to ensure log files are flushed and closed (#378)
    • Fix a bug with utils.instantiate() failing if params contains interpolated values. (#388)
    • Allow hydra.utils.instantiate() to accept non primitive objects for passthrough by name (#400)
    • Fix to work when an Hydra app is executed in Jupyter notebook using the %run command (#481)
    • Plugins are no longer imported twice during plugin discovery (#482)
    • to_absolute_dir(path) now converts relative path to be relative to os.cwd() when used outside of Hydra (#496)

    Improved Documentation

    • Working examples are provided for all Hydra plugins in plugins/examples (#253)
    • The basic tutorial was rewritten to reflect many changes (#602)
    • Add a new tutorial covering Structured Configs (#628)
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0rc2(Jul 18, 2020)

    1.0.0rc2 (2020-07-18)

    Features

    • Introducing a DSL for the command line override syntax (#797)
    • Sanitize exception messages by default, showing only interesting stack frames (#646)
    • Add a new --info flag to show Hydra debug information without running the user function. (#662)
    • Add --package flag, can be used with --cfg to print a specific config package (#674)
    • Improve the Compose API initialization methods (#702)
    • Switch internal package resource loader from pkg_resources to importlb_resources (#719)
    • Allow interpolation in the Hydra config node to access the application config (#771)
    • Hydra provides pytest fixtures (hydra_sweep_runner, hydra_task_runner, hydra_restore_singletons) (#687)
    • Added contexts to help initialize Hydra in a localized context (Mostly for Unit Tests and Jupyter Notebooks) (#687)
    • Prints error when command line override looks like a sweep but --multirun is not specified (#712)
    • Frozen Structured Configs are respected during composition command line overrides (#724)

    API Change (Renames, deprecations and removals)

    • Hydra argparse flags are now consistently using dash-style. (#661)
    • Restructure the configuration of the Submitit launcher (#682)
    • Deprecated cls in favor of target in hydra.utils.{instantiate()/call{}} (#721)

    Bug Fixes

    • Add hydra/py.typed to pip package to enable type checking in downstream projects (#657)
    • Fix initilzation of Hydra in a module imported from a Jupyter Notebook (#695)
    • Fix handling of main module override via HYDRA_MAIN_MODULE (#717)
    • Fix interpoaltions in overrides to evaluate lazily (#725)
    • Fixed handling of multirun when target config node is introduced by composition (#726)
    • Sweepers are now validating config composition before launching (#775)
    • Save .hydra/*.yaml before task execution (#678)

    Plugins

    • Add Redis Queue Launcher plugin (Jan-Matthis)
    • Upgrade ax-platform used by Ax sweeper plugin to 0.1.13 or newer

    Improved Documentation

    Maintenance Changes

    • Integrate yamllint (#693)
    • Upgrade to OmegaConf 2.0.1rc11 which solves multiple bugs (#755)
    Source code(tar.gz)
    Source code(zip)
  • v0.11.3(Aug 18, 2020)

    0.11.3 (2019-12-29)

    Bug Fixes

    • Pin Hydra 0.11 to OmegaConf 1.4 to avoid breaking compatibility when OmegaConf 2.0 is released (#334)

    Improved Documentation

    • Document a simple Ray example (#317)
    Source code(tar.gz)
    Source code(zip)
Owner
Facebook Research
Facebook Research
Yamale (ya·ma·lē) - A schema and validator for YAML.

Yamale (ya·ma·lē) ⚠️ Ensure that your schema definitions come from internal or trusted sources. Yamale does not protect against intentionally maliciou

23andMe 534 Dec 21, 2022
🤫 Easily manage configs and secrets in your Python projects (with CLI support)

Installation pip install confidential How does it work? Confidential manages secrets for your project, using AWS Secrets Manager. First, store a secr

Candid™️ 63 Oct 30, 2022
Strict separation of config from code.

Python Decouple: Strict separation of settings from code Decouple helps you to organize your settings so that you can change parameters without having

Henrique Bastos 2.3k Dec 30, 2022
A slightly opinionated template for iPython configuration for interactive development

A slightly opinionated template for iPython configuration for interactive development. Auto-reload and no imports for packages and modules in the project.

Seva Zhidkov 24 Feb 16, 2022
Load Django Settings from Environmental Variables with One Magical Line of Code

DjEnv: Django + Environment Load Django Settings Directly from Environmental Variables features modify django configuration without modifying source c

Daniel J. Dufour 28 Oct 01, 2022
Read configuration settings from python configuration files.

Maison Read configuration settings from python configuration files. Motivation When developing a python application, e.g a command-line tool, it can b

9 Jan 04, 2023
Hydra is a framework for elegantly configuring complex applications

Python Decouple: Strict separation of settings from code Decouple helps you to organize your settings so that you can change parameters without having

Facebook Research 6.6k Jan 04, 2023
Tools to assist with the configuration and maintenance of fapolicyd.

Tools to assist with the configuration and maintenance of fapolicyd.

Concurrent Technologies Corporation (CTC) 7 Dec 27, 2022
A modern simfile parsing & editing library for Python 3

A modern simfile parsing & editing library for Python 3

ash garcia 38 Nov 01, 2022
Organize Django settings into multiple files and directories. Easily override and modify settings. Use wildcards and optional settings files.

Organize Django settings into multiple files and directories. Easily override and modify settings. Use wildcards in settings file paths and mark setti

Nikita Sobolev 942 Jan 05, 2023
Generate config files and qr codes for wireguard vpn

wireguard config generator for python Generate config files and qr codes for wireguard vpn You will need to install qrcode and pillow in python and yo

18 Dec 02, 2022
sqlconfig: manage your config files with sqlite

sqlconfig: manage your config files with sqlite The problem Your app probably has a lot of configuration in git. Storing it as files in a git repo has

Pete Hunt 4 Feb 21, 2022
Sync any your configuration file to remote. Currently only support gist.

Sync your configuration to remote, such as vimrc. You can use EscSync to manage your configure of editor, shell, etc.

Me1onRind 0 Nov 21, 2022
Pyleri is an easy-to-use parser created for SiriDB

Python Left-Right Parser Pyleri is an easy-to-use parser created for SiriDB. We first used lrparsing and wrote jsleri for auto-completion and suggesti

Cesbit 106 Dec 06, 2022
filetailor is a peer-based configuration management utility for plain-text files such as dotfiles.

filetailor filetailor is a peer-based configuration management utility for plain-text files (and directories) such as dotfiles. Files are backed up to

5 Dec 23, 2022
A lightweight Traits like module

Traitlets home https://github.com/ipython/traitlets pypi-repo https://pypi.org/project/traitlets/ docs https://traitlets.readthedocs.io/ license Modif

IPython 532 Dec 27, 2022
Secsie is a configuration language made for speed, beauty, and ease of use.

secsie-conf pip3 install secsie-conf Secsie is a configuration language parser for Python, made for speed and beauty. Instead of writing config files

Noah Broyles 3 Feb 19, 2022
Simple dataclasses configuration management for Python with hocon/json/yaml/properties/env-vars/dict support.

Simple dataclasses configuration management for Python with hocon/json/yaml/properties/env-vars/dict support, based on awesome and lightweight pyhocon parsing library.

Teo Stocco 62 Dec 23, 2022
This Ivy plugin adds support for TOML file headers.

This Ivy plugin adds support for TOML file headers as an alternative to YAML.

Darren Mulholland 1 Nov 09, 2021
Chinese-specific configuration to improve your favorite DNS server

Dnsmasq-china-list - Chinese-specific configuration to improve your favorite DNS server. Best partner for chnroutes.

Felix Yan 4.6k Jan 03, 2023