Skip to content

A repository for integrating scripts configured with hydra and snakemake, without changing the hydra scripts.

License

Notifications You must be signed in to change notification settings

sambklein/hydra_snakemake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hydra and Snakemake

hydra snakemake

Very often we build our ML jobs such that they are configured by Hydra, and this is nice for quick development of projects. But this becomes a problem when you want to integrate this into a workflow management system like Snakemake.

This repo is trying to develop a wrapper such that Hydra and Snakemake can play nice together without needing to modify how existing scripts (completely configured with hydra) are written and called.

The proposed solution is to modify the params filed of such Snakemake rules such that they contain Hydra

rule all:
    input:
        "output1.txt",
        "output2.txt",

rule get_data:
    input:
        model = "dummy.txt"
    output:
        output_file = "output{i}.txt"
    params:
        "datamodule.batch_size={i}",
        "model.ckpt_path={input.model.split('.txt')[0]}/{output.output_file}",
        script = "scripts/train.py"
    wrapper:
        "file:hydra_cli"

TODO check this in deployed setting across jobs and once settled on a good enough set up push to the snakemake wrappers repo.

About

A repository for integrating scripts configured with hydra and snakemake, without changing the hydra scripts.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages