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

Support Access of Dictionary Items in matrix-stages #10094

Open
mfakaehler opened this issue Nov 14, 2023 · 2 comments
Open

Support Access of Dictionary Items in matrix-stages #10094

mfakaehler opened this issue Nov 14, 2023 · 2 comments
Labels
feature request Requesting a new feature p2-medium Medium priority, should be done, but less important

Comments

@mfakaehler
Copy link

When I work with matrix-stages I would like to use further parameters for each item, specified in the params.yaml
A prototpy-stage would look like

# dvc.yaml
stages:
  eval:
    matrix:
      model: ${models}
      testset: ${testsets}
   cmd: python src/eval_script.py --model ${item.model} --evalset ${item.evalset} --model-family ${item.model.family}
...

And the params.yaml would be:

# params.yaml
models:
  m1:
    family: b21
  m2: 
    family: x22
      
testsets: [evalA, evalB]

This is similar to foreach-stages, where you can access properties by calling ${item.property}

@efiop efiop added the feature request Requesting a new feature label Nov 14, 2023
@dberenbaum
Copy link
Contributor

@skshetry Thoughts on this request?

@dberenbaum dberenbaum added the p2-medium Medium priority, should be done, but less important label Dec 1, 2023
@jogepari
Copy link

jogepari commented Dec 5, 2023

This seems a natural functionality to be present, similar to foreach indeed. I've got a two-in-one case to use. Having large data split in multiple subdirectories, and several preprocessors, I generate matrix stages, one per (preprocessor x data_subdir).

  1. I have several dict configs defining subsets of data subdirs, and would like to combine them via Hydra. But since Hydra supports only dict extension and not list extension (and matrix can't access items of dict), this seems impossible atm (requires creating additional config files for each combination).
  2. For each preprocessor (dict config), I'd like to place a dependency on file containing it's class. Once again, can't access the type from dict config in matrix. Could be accessed in via nested interpolation from main config, but that doesn't work as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requesting a new feature p2-medium Medium priority, should be done, but less important
Projects
None yet
Development

No branches or pull requests

4 participants