Search code examples
fb-hydra

Hydra config for cascade processing


I am new to python and hydra and i am using hydra multirun for a cascade image processing.

Trying to use hydra-config as something like preset.

Considering an application using cascade functions which all of them read parameters from hydra cfg

functionA output is an input for functionB and FunctionB output is an input for functionC and functionC output is the desired Result. But with every run All the process start from functionA

Can i do this: at end of first run, execute functionC with defined configs and then functionB with defined config? such recursive way?

i see everything works fine with current mode and at the other hand i know that i have to manage recursive computing by code but there is anyway in splitting code and then connect with hydra to do this?

it is time and energy consuming while running the app from start.

Thanks


Solution

  • It sounds like you want to launch a DAG. this is something Hydra does not cover, but you can look at other libraries like Ray or Airflow.

    In principle, you can use Hydra's multirun to launch first job, which in turn will launch the dag, probably based on Hydra composed config.

    One thing that might be useful is the instantiate API, which can allow you to construct a dag definition powered by the configuration. In particular, Hydra 1.1 instantiate is recursive. Take a look at the docs for it.