Repository navigation
Expand file tree
/
Copy pathdocker-compose.gpu.yml
More file actions
37 lines (37 loc) · 1.7 KB
/
Copy pathdocker-compose.gpu.yml
File metadata and controls
37 lines (37 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# GPU overlay: docker compose -f docker-compose.yml -f docker-compose.gpu.yml up --build
#
# (12-factor V) TORCH_INDEX_URL selects CPU vs CUDA wheels at BUILD time, so
# reserving a GPU at run time is not enough on its own. This overlay previously
# added only the device reservation, which meant the command above ran the
# CPU-wheel image on GPU hardware unless someone had separately rebuilt with the
# CUDA index — silently, at the ~100-400x slowdown classify_TEXT.py warns about.
#
# The image name is also distinct. The CPU and GPU variants are different images
# built from the same Dockerfile with different args; sharing one name meant
# whichever was built last won, and `docker compose pull` could quietly replace
# one with the other.
#
# It is a LOCAL name (atrium-project#69, roadmap B2): no workflow publishes a GPU
# image, so the old `ghcr.io/…:<version>-gpu` could never be pulled, and
# `pull_policy: build` keeps `docker compose pull` from asking a registry for it.
# ATRIUM_RUNNER_IMAGE follows the name in both places: merged onto
# docker-compose.yml, this service otherwise kept the CPU image's name, so a GPU
# run's paradata recorded an image it did not run (roadmap B3's compose half).
services:
alto:
image: atrium-ocr-postprocess-gpu:local
pull_policy: build
build:
args:
TORCH_INDEX_URL: ${TORCH_INDEX_URL:-https://download.pytorch.org/whl/cu124}
ATRIUM_RUNNER_IMAGE: atrium-ocr-postprocess-gpu:local
environment:
NVIDIA_VISIBLE_DEVICES: all
ATRIUM_RUNNER_IMAGE: atrium-ocr-postprocess-gpu:local
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]