mlcommons / mlcommons/mlcube

Passing a file as an output path

Open
#200 3 comments 0 reactions 1 assignee View on GitHub

@sergey-serebryakov is already working on this.

Since Sep 15, 2021.

Dominant language
Python
Stars
160
Forks
31
PR merge metrics
No merged PRs in 30d

Description

Right now it is not possible to pass a file as output parameter to a task if that file doesn't exist already.

In this cases, the only solution I've found was to specify the path where the file should exist as the output parameter like so

mlcube.yaml

tasks:
  infer:
    parameters:
      inputs: {parameters_file: parameters.yaml
      outputs: {out_dir: ./}

And inside the parameters.yaml provide the name of the file to be created

parameters.yaml

out_file: inferences.yaml

This can be problematic, as the parameters.yaml file is cube-specific, and there's no easy way to know which key is being used to point to the output file of interest.

MedPerf needs to unwind the location of some output files in order to execute operations like dataset registration, and this requires the assumption that the output file for a given cube will use a determined key inside the parameters.yaml

Additionally, from a user perspective, being able to point to files directly in the input parameters but not in the outputs makes it confusing.

A good solution would be to identify if the user is trying to point to a non-existent file as an output and if that's the case create the file prior to running the cube.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.