Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escaping: Escape characters +-&|!(){}[]^"~*?:\ with \, e.g. \+
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
Hi All! I'M Using Clearml With Hydra As Configuration Manager. I'M Trying To Rerun A Task By Overriding Some Of The Configurations From The Ui. I Tried To Change The Config_Name Args In The Args Section And Also The Omegaconf Configuration In Configuratio

Hi all! I'm using ClearML with Hydra as configuration manager. I'm trying to rerun a task by overriding some of the configurations from the UI. I tried to change the config_name args in the Args section and also the OmegaConf configuration in Configuration Objects and they work as expected. What it doesn't seem to work is overriding the args inside overrides. As an example, if I run my experiment the first time with : overrides = ['training.max_epochs=2'] and later I clone the same experiment and modify this with something like overrides = ['training.max_epochs=1000'] this change is not reflected in the new experiment at run time. If instead I modified directly the OmegaConf from the UI it works. Any idea why?

  
  
Posted 3 years ago
Votes Newest

Answers 25


I'm using Hydra 1.0.6

  
  
Posted 3 years ago

If I edit directly the OmegaConf in the UI than the port changes correctly

This will only work if you change the Hydra/allow_omegaconf_edit to True in the UI. Did you?

  
  
Posted 3 years ago

Ohh so you are saying you can store it properly, but only editing in the UI is limited ? (Maybe this is just a UI thing)

  
  
Posted 3 years ago

Yes I think it's only related to the UI. Do you think It can be fixed somehow? It would be the easiest way to launch new experiments with a different configuration

  
  
Posted 3 years ago

Actually I had the same issue even with that value set to False

  
  
Posted 3 years ago

Also, if I want to modify another parameter, e.g. ui.height I have this problem:

  
  
Posted 3 years ago

Yep I changed it

  
  
Posted 3 years ago

Thank you!!

  
  
Posted 3 years ago

Hi AgitatedDove14 , I noticed that in the Hydra parameters section it is not possible to add as parameters keys string with dots: .(dot) $(dollar) and space are not allowed in parameter key. However, it's very useful to add parameters with the dot to change something in a sub-configuration as, for example, training.max_epochs=10 . Do you think it's possible to allow this?

  
  
Posted 3 years ago

` # ClearML - Hydra Example

from clearml import Task

from dataclasses import dataclass

import hydra
from hydra.core.config_store import ConfigStore
from omegaconf import OmegaConf

@dataclass
class MySQLConfig:
host: str = "localhost"
port: int = 3306

cs = ConfigStore.instance()

Registering the Config class with the name 'config'.

cs.store(name="config", node=MySQLConfig)

@hydra.main(config_name="config")
def my_app(cfg: MySQLConfig) -> None:
# type (DictConfig) -> None
task = Task.init(project_name="examples", task_name="hydra configuration")
logger = task.get_logger()
logger.report_text("You can view your full hydra configuration under Configuration tab in the UI")
print(OmegaConf.to_yaml(cfg))

if cfg.port == 80:
    print("Is this a webserver?!")

if name == "main":
my_app() `

  
  
Posted 3 years ago

I'm using ClearML 0.17.5

  
  
Posted 3 years ago

Yep I changed it

This means it will totally ignore the overrides and just take the OmegaConf, this is by design. You either use the overrides, or you configure the OmegaConf. LovelyHamster1 Does that make sense ?

  
  
Posted 3 years ago

However, If I edit directly the OmegaConf in the UI than the port changes correctly. I'd still prefer to override the Args so I can change entire sub-configuration e.g. ['dataset=cifar'] to ['dataset=imagenet'] instead of having to change all the parameters inside the OmegaConf

  
  
Posted 3 years ago

Ok now I noticed that If I change the value of the port inside the Hydra parameters section ( not the overrides) It does actually change also in the experiment. The overrides doesn't seem to be working

  
  
Posted 3 years ago

LovelyHamster1 verified, this is a UI bug with old limitation enforced.
I will make sure they know about it, it should be fixed for the upcoming release šŸ™‚

  
  
Posted 3 years ago

Hi LovelyHamster1
Could you think of a toy code that reproduces this issue ?

  
  
Posted 3 years ago

Hi AgitatedDove14 , sorry for the late reply. Btw, I tried with the latest RC and the issue is still there. So if I clone an experiment, modify an overrides params eg ['training.max_epochs=10'] my experiment run the old configuration. Therefore it seems that it doesn't change the OmegaConf configuration.

  
  
Posted 3 years ago

Hi LovelyHamster1
As you noted, passing overrides in Args/overrides , for example ['training.max_epochs=1000']
should work when running with the agent.

Could you verify with the latest RC, there was a fix to support the latest hydra version
pip install clearml==0.17.5rc5

  
  
Posted 3 years ago

Hi AgitatedDove14 , you can try with this toy example. If i run the task with python example.py ui.width=2048 the task will run correctly and print Title=My app, size=2048x768 pixels . However, in the UI I'm not allowed to change the ui.width in the Hydra parameters section: the 'Save' button is frozen

  
  
Posted 3 years ago

Hi LovelyHamster1
You mean when as a section name or a variable?
Could you change this example to include a variable that breaks the support ?
https://github.com/allegroai/clearml/blob/master/examples/frameworks/hydra/hydra_example.py

  
  
Posted 3 years ago

` from clearml import Task

from dataclasses import dataclass

import hydra
from hydra.core.config_store import ConfigStore
from omegaconf import OmegaConf

@dataclass
class MySQLConfig:
host: str = "localhost"
port: int = 3306

@dataclass
class UserInterface:
title: str = "My app"
width: int = 1024
height: int = 768

@dataclass
class MyConfig:
db: MySQLConfig = MySQLConfig()
ui: UserInterface = UserInterface()

cs = ConfigStore.instance()
cs.store(name="config", node=MyConfig)

@hydra.main(config_name="config")
def my_app(cfg: MyConfig) -> None:
task = Task.init(project_name="examples", task_name="hydra configuration")
logger = task.get_logger()
logger.report_text("You can view your full hydra configuration under Configuration tab in the UI")
print(f"Title={cfg.ui.title}, size={cfg.ui.width}x{cfg.ui.height} pixels")

if name == "main":
my_app() `

  
  
Posted 3 years ago

Do you think It can be fixed somehow? It would be theĀ easiest way to launch new experiments with a different configuration

Let me check, it might be it.

It would be theĀ easiest way to launch new experiments with a different configuration

Definitely

  
  
Posted 3 years ago

I created this toy example so you don't need any external conf files. Btw if I first launch the task as python example.py port=80 than the task will print the message "Is this a webserver" correctly. If then in the UI I clone the same task, overrides the port with ['port=43'] , for example, and run the experiment, I will still get the message "Is this a webserver" so the port didn't change

  
  
Posted 3 years ago

Hmm. What's the Hydra version you have?

  
  
Posted 3 years ago
1K Views
25 Answers
3 years ago
one year ago
Tags