Repository navigation
Expand file tree
/
Copy pathcompose.cuda.yaml
More file actions
40 lines (39 loc) · 1.45 KB
/
Copy pathcompose.cuda.yaml
File metadata and controls
40 lines (39 loc) · 1.45 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
38
39
40
# Use with compose.yaml, and with compose.http.yaml when serving over HTTP. The
# `laya-serve` entry repeats the CUDA build args and device reservation because it is
# a separate service: overrides for `laya` never reach it, so it would serve on CPU.
services:
laya:
build:
args:
TORCH_INDEX: "${LAYA_TORCH_INDEX:-cu128}"
environment:
LAYA_DEVICE: "${LAYA_DEVICE:-cuda}"
# The runtime reads these when it picks the autocast dtype; empty keeps the checkpoint's
# own `amp_dtype`. README's threshold section measures what fp16 vs bf16 decides differently.
LAYA_CUDA_AMP: "${LAYA_CUDA_AMP:-}"
LAYA_CPU_AMP: "${LAYA_CPU_AMP:-}"
deploy:
resources:
reservations:
devices:
- driver: nvidia
device_ids: ["${LAYA_GPU_ID:-0}"]
capabilities: [gpu]
laya-serve:
build:
context: .
args:
TORCH_INDEX: "${LAYA_TORCH_INDEX:-cu128}"
environment:
LAYA_DEVICE: "${LAYA_DEVICE:-cuda}"
# The runtime reads these when it picks the autocast dtype; empty keeps the checkpoint's
# own `amp_dtype`. README's threshold section measures what fp16 vs bf16 decides differently.
LAYA_CUDA_AMP: "${LAYA_CUDA_AMP:-}"
LAYA_CPU_AMP: "${LAYA_CPU_AMP:-}"
deploy:
resources:
reservations:
devices:
- driver: nvidia
device_ids: ["${LAYA_GPU_ID:-0}"]
capabilities: [gpu]