docker-compose.yml 3.17 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

# Worker count is controlled by COMPOSE_PROFILES (1-8).
# COMPOSE_PROFILES=4 starts backend-0..backend-3 on GPUs 0..3.

x-backend-base: &backend-base
  build:
    context: ..
    dockerfile: Dockerfile
11
12
13
    args:
      TORCH_CUDA_ARCH_LIST: ${TORCH_CUDA_ARCH_LIST:-10.0 10.0a}
      MAX_JOBS: ${MAX_JOBS:-4}
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
  image: dynamo-fastvideo-diffusers:latest
  restart: on-failure
  command: python worker.py
  environment:
    - DYN_DISCOVERY_BACKEND=file
    - DYN_FILE_KV=/tmp/dynamo-discovery
    - LD_LIBRARY_PATH=
    - TORCHINDUCTOR_CACHE_DIR=/cache/torchinductor
    - TRITON_CACHE_DIR=/cache/triton
  volumes:
    - dynamo-discovery:/tmp/dynamo-discovery
    - huggingface-cache:/root/.cache/huggingface
  ipc: host
  shm_size: 8g
  ulimits:
    memlock: -1
    stack: 67108864
  depends_on:
    - frontend

services:
  frontend:
    build:
      context: ..
      dockerfile: Dockerfile
39
40
41
      args:
        TORCH_CUDA_ARCH_LIST: ${TORCH_CUDA_ARCH_LIST:-10.0 10.0a}
        MAX_JOBS: ${MAX_JOBS:-4}
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
    image: dynamo-fastvideo-diffusers:latest
    restart: on-failure
    command: >
      python -m dynamo.frontend
        --http-port 8000
        --discovery-backend file
    environment:
      - DYN_FILE_KV=/tmp/dynamo-discovery
    volumes:
      - dynamo-discovery:/tmp/dynamo-discovery
    ports:
      - "8000:8000"

  backend-0:
    <<: *backend-base
    profiles: ["1", "2", "3", "4", "5", "6", "7", "8"]
    deploy:
      resources:
        reservations:
          devices:
            - { driver: nvidia, device_ids: ["0"], capabilities: [gpu] }

  backend-1:
    <<: *backend-base
    profiles: ["2", "3", "4", "5", "6", "7", "8"]
    deploy:
      resources:
        reservations:
          devices:
            - { driver: nvidia, device_ids: ["1"], capabilities: [gpu] }

  backend-2:
    <<: *backend-base
    profiles: ["3", "4", "5", "6", "7", "8"]
    deploy:
      resources:
        reservations:
          devices:
            - { driver: nvidia, device_ids: ["2"], capabilities: [gpu] }

  backend-3:
    <<: *backend-base
    profiles: ["4", "5", "6", "7", "8"]
    deploy:
      resources:
        reservations:
          devices:
            - { driver: nvidia, device_ids: ["3"], capabilities: [gpu] }

  backend-4:
    <<: *backend-base
    profiles: ["5", "6", "7", "8"]
    deploy:
      resources:
        reservations:
          devices:
            - { driver: nvidia, device_ids: ["4"], capabilities: [gpu] }

  backend-5:
    <<: *backend-base
    profiles: ["6", "7", "8"]
    deploy:
      resources:
        reservations:
          devices:
            - { driver: nvidia, device_ids: ["5"], capabilities: [gpu] }

  backend-6:
    <<: *backend-base
    profiles: ["7", "8"]
    deploy:
      resources:
        reservations:
          devices:
            - { driver: nvidia, device_ids: ["6"], capabilities: [gpu] }

  backend-7:
    <<: *backend-base
    profiles: ["8"]
    deploy:
      resources:
        reservations:
          devices:
            - { driver: nvidia, device_ids: ["7"], capabilities: [gpu] }

volumes:
  dynamo-discovery:
  huggingface-cache: