Skip to content

Implement command line parsing and help printing #942

@lockshaw

Description

@lockshaw

On master, all command line parsing is done in a giant switch case in model.cc (see here). However, doing it this way prevents us from adding automatic help text generation, etc.

One way to fix this would be to use a third-party command line parsing library. However, all of the ones I (@lockshaw) have looked into do not allow arguments of the form Legion uses, e.g.,

$ ./my-executable -flag 5

as typically this would be interpreted as the same as passing

$ ./my-executable -f -l -a -g 5

Feel free to do some looking, and if you find one that I missed that would let us do that, feel free to let @lockshaw know.

Assuming this is correct, we should write a small command-line parsing library in utils that supports this syntax, and move argument parsing over to it. In addition, argument parsing for FlexFlow happens in multiple layers, i.e.,

user executable ---> user program-specific flags (model size, etc.)
    |
    |
    |
    v
flexflow runtime --> ff flags (simulator size, profiling, etc.)
    |
    |
    |
    v
legion runtime ----> legion flags (-ll:gpu, -ll:cpu, -lg:prof, etc.) 

So likely argument parsing will need to be done in a series of passes and will not be able to rely on having the full definition in a single place.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions