question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compose parameters for DEBUG mode

See original GitHub issue

Description

I found it due to the config file, I cannot do dynamic stuff like

if DEBUG:
  epochs=1
else:
  epochs=100

One way of doing so is leverage the environment and create a debug environment. However, it is only composable for additional key, if identical keys exist, the debug enviornment will overwrite completely.

Context

This is very common usage to have a debug mode running fast development

Possible Implementation

Instead of overwrite the key, it should merge them, the provided environment should have higher priority. It also avoids duplicate the parameters, especially for ML project the # of parameters can be large. We should only specify the parameters that is changed.

What I wanted:

base

model:
   layer: 32
   epochs: 100

debug

model:
   epochs: 1

result

model:
  layer: 32 
  epochs: 1

Current behavior

base

model:
   layer: 32
   epochs: 100

debug

model:
   epochs: 1

result

model:
  epochs: 1

Possible Alternatives

A library like hydra provides the ability to compose two configuration file. We just need to merge two dictionary instead of overwriting it.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
lorenabalancommented, Nov 20, 2020

Yeah I agree with you, I had made a note of this for a future team discussion. 😃 There might’ve been an “explicit is better than implicit” motivation back when this was implemented, though.

1reaction
lorenabalancommented, Nov 19, 2020

Hi @noklam I think you can achieve this currently using the TemplatedConfigLoader. Assuming you have a base config

model:
    layer: 32
    epochs: ${model_epochs}

Then you can dedicate globals.yml in each environment:

debug/globals.yml

model_epochs: 1

base/globals.yml

model_epochs: 100

You can find an example in the documentation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I debug recompositions in Jetpack Compose?
The easiest way to debug recompositions is to use good ol' log statements to see which composables functions are being called and the ......
Read more >
Compose performance - Jetpack - Android Developers
Jetpack Compose aims to deliver great performance out of the box. This page shows you how to write and configure your app for...
Read more >
How to pass command line when debugging docker-compose ...
I want to debug it in VS so I set the project docker-compose as the startup project and debug run "Docker Compose" in...
Read more >
Docker Compose build settings - Visual Studio (Windows)
Learn how to edit the Docker Compose build properties to ... The Debug configuration is Fast mode by default and Regular mode otherwise....
Read more >
Overview of docker compose CLI
Overview of the Docker Compose CLI. ... Show more output --log-level LEVEL DEPRECATED and not working from 2.0 - Set log level (DEBUG,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found