Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ cat _codabench/scoring/scores.json
```

`python tools/run_docker.py` does the same inside the Docker image (needs
`pip install docker`).
`pip install docker`). Add `--gpu` to give ingestion the host GPUs, as on a
GPU worker (needs the NVIDIA Container Toolkit).

## Large data: staging it on a self-hosted worker

Expand Down
7 changes: 7 additions & 0 deletions tools/run_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@
``benchmark_utils``, the metric, next to scoring), and the hidden test labels
as ``/app/input/ref``. Prepare the data first with
``benchopt prepare benchmark -d Real`` (writes ``benchmark/data``).
``--gpu`` gives ingestion all the host GPUs (needs the NVIDIA Container
Toolkit).

Usage
-----
python tools/run_docker.py [--data <host-data-dir>] [--submission <dir>]
[--gpu]
"""

import argparse
Expand All @@ -32,6 +35,8 @@
parser.add_argument("--submission",
help="Folder holding submission.py (default: the "
"sample benchmark/solvers/random-forest.py)")
parser.add_argument("--gpu", action="store_true",
help="Run ingestion with all the host GPUs")
args = parser.parse_args()
data = Path(args.data).resolve()

Expand All @@ -50,9 +55,11 @@
)
out = REPO / "_codabench/ingestion"
out.mkdir(parents=True, exist_ok=True)
gpus = [docker.types.DeviceRequest(count=-1, capabilities=[["gpu"]])]
print("Running ingestion...")
logs = client.containers.run(
image=image, remove=True, name="ingestion", user="root",
device_requests=gpus if args.gpu else None,
command="python3 /app/program/ingestion.py",
volumes=[
f"{REPO / 'ingestion_program'}:/app/program:ro",
Expand Down
Loading