Can I get guild to recognize the flags specified in model_flags.yml? It would be cool if I could do something like:
guild run example x=2 y=10
guild run example # Just use default values in model_flags.yml
The way I do this now is by specifying x and y through argparse and then use $include operator in my guild.yml file for the model_flags.yml flags, but I still have to specify x and y through argparse.
This is definitely something that we want. There are cases where you want to separate types of params because they don’t mix well — e.g. system related vs. model related or meta config vs op-specific config, etc.
I think your proposal is a good one. It is a bit more complicated because we really need a per-flag args-dest attr, so you can direct any given flag to the appropriate interface.
Short of having this feature, I would consider using a wrapper that used a single interface (e.g. argparse or globals) that generates the required YAML/config files + calls the wrapped script with the appropriate flag values. This is the classic “use Python to hack it!” approach, which you can often fall back on.
PyTorch Lightning uses the Argument Parser / JSONArgParse. Thanks to the others I was able to combine Guild and the Lightning CLI successfully, see Guild.ai x Lightning CLI - #6 by Alessandro
From there it shouldn’t be hard to build your own parser if you don’t want to use Lightning CLI
Hi @Alessandro . I tried to follow your solution at the link you provided but I can’t wrap my head around it at the moment. It looks like you solved a similar, but more complex , problem as mine, currently. Would you care to give me more pointers? I apologise in advance if this is not the right way to ask questions.
Guild complains when used with pytorch-lightning : guild: No module named --batch_size
Specifically I want to format the below in a way lightning expects. >>guild run train0 max_epochs=1 batch_size=4 --print-cmd /root/.local/share/virtualenvs/???/bin/python -um guild.op_main /app/scripts/???/train0 -- --batch_size 4 --max_epochs 1