Note
This guide assumes you want to contribute code changes to ModelGauge. If you only want to use it as a library to run evaluations, please read the User Quick Start instead.
- Python 3.10: It is recommended to use Python version 3.10 with ModelGauge.
- Poetry: ModelGauge uses Poetry for dependency management. Install it if it's not already on your machine.
Warning
Poetry and other python virtual environment tooling may not play nicely together. As such we recommend you let Poetry manage the venv, and not try to run it within a venv.
-
Download the repository:
git clone https://github.com/mlcommons/modelgauge.git cd modelgauge -
Install the default dependencies:
poetry installThis will instruct poetry to install the default dependencies into this project's environment. An isolated environment will be created, unless another virtual environment is already activated. After you install, future
poetry runcommands will use that environment.
You can run our command line tool with:
poetry run modelgaugeThat should provide you with a list of all commands available. A useful command to run is list, which will show you
all known Tests, System Under Tests (SUTs), and installed plugins.
poetry run modelgauge listModelGauge uses a plugin architecture, so by default the list should be pretty empty. To see this in
action, we can instruct poetry to install the demo plugin:
poetry install --extras demo
poetry run modelgauge listYou should now see a list of all the modules in the demo_plugin/ directory. For more info on the demo
see here.
The plugins/ directory contains many useful plugins. However, those have a lot of transitive dependencies, so they can
take a while to install. To install them all:
poetry install --extras all_plugins
poetry run modelgauge listFinally note that any extras not listed in a poetry install call will be uninstalled.
Here is an example of running a Test, using the demo plugin:
poetry run modelgauge run-test --sut demo_yes_no --test demo_01If you want additional information about existing tests, you can run:
poetry run modelgauge list-testsTo obtain detailed information about the existing Systems Under Test (SUTs) in your setup, you can execute the following command:
poetry run modelgauge list-sutsWhen ModelGauge is installed using Poetry, in order to run the modelgauge command line tool, the command must be
prefixed by poetry run e.g. poetry run modelgauge list. You can also start your session with poetry shell, which
makes poetry run unnecessary thereafter. For simplicity, the rest of the documentation may omit the poetry run
prefix for modelgauge commands.
If you have any further questions, please feel free to ask them in the #engineering-support discord / file a github issue. Also if you see a way to make our documentation better, please submit a pull request. We'd love your help!