Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I get nice formatted terminal logs when using hydra instead of tango's jsonnet configs #487

Open
BigRedT opened this issue Dec 8, 2022 · 4 comments · May be fixed by #491
Open
Labels
question Further information is requested

Comments

@BigRedT
Copy link
Contributor

BigRedT commented Dec 8, 2022

I have been trying to use Hydra for config management (more flexible command line interface) and therefore create step graphs and register runs & workspaces programmatically as follows:

@hydra.main(version_base=None,config_path="./exp_configs", config_name="some_exp_name")
def main(cfg):
    workspace = Workspace.from_url(cfg.tango_workspace)
    step_graph = create_step_graph(cfg)
    run = workspace.register_run(StepGraph.ordered_steps(step_graph),name=cfg.run_name)
    executor = Executor(workspace=workspace,parallelism=None)
    output = executor.execute_step_graph(step_graph)

if __name__=='__main__':
    main()

I execute this script with the usual python -m filename

Two questions:

  • Is this the right way to do tango runs when NOT using tango's jsonnet configs or is there a better way?
  • When I run experiments like this, I do not get the nicely color-coded and formatted terminal output that I get with tango run config.jsonnet. Is there a way to achieve that in this particular setup?
@BigRedT BigRedT added the question Further information is requested label Dec 8, 2022
@epwalsh
Copy link
Member

epwalsh commented Dec 8, 2022

Hey Tanmay,

For your first question, yes that's probably fine. For your second question, add this to the beginning of your script:

from tango.common.logging import initialize_logging

initialize_logging(log_level="info", enable_cli_logs=True)

@BigRedT
Copy link
Contributor Author

BigRedT commented Dec 9, 2022

Perfect!

Is there also a function that would give a summary of executed steps as follows:

Screen Shot 2022-12-09 at 1 45 20 PM

@epwalsh
Copy link
Member

epwalsh commented Dec 9, 2022

That functionality is not part of the public API, but it could be... I'd be happy to accept a PR that moves this code into a public function.

@BigRedT BigRedT linked a pull request Dec 9, 2022 that will close this issue
5 tasks
@BigRedT
Copy link
Contributor Author

BigRedT commented Dec 9, 2022

Created a PR #491

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants