Skip to content

Commit 37f2a26

Browse files
committed
Merge branch 'master' into rocm-release
2 parents c196bc4 + f5794b3 commit 37f2a26

File tree

4 files changed

+139
-18
lines changed

4 files changed

+139
-18
lines changed

docker/gpu/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM --platform=$BUILDPLATFORM nvidia/cuda:12.8.1-base-ubuntu24.04
1+
FROM --platform=$BUILDPLATFORM nvcr.io/nvidia/cuda:12.9.1-cudnn-devel-ubuntu24.04
22

33
# Install Python and other dependencies
44
RUN apt-get update -y && \
@@ -12,7 +12,7 @@ RUN apt-get update -y && \
1212
useradd -m -u 1001 appuser && \
1313
mkdir -p /app/api/src/models/v1_0 && \
1414
chown -R appuser:appuser /app
15-
15+
1616
USER appuser
1717
WORKDIR /app
1818

@@ -40,7 +40,7 @@ ENV PATH="/app/.venv/bin:$PATH" \
4040
PHONEMIZER_ESPEAK_DATA=/usr/share/espeak-ng-data \
4141
ESPEAK_DATA_PATH=/usr/share/espeak-ng-data \
4242
DEVICE="gpu"
43-
43+
4444
ENV DOWNLOAD_MODEL=true
4545
# Download model if enabled
4646
RUN if [ "$DOWNLOAD_MODEL" = "true" ]; then \

docker/rocm/Dockerfile

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM rocm/dev-ubuntu-24.04:6.4.3
1+
FROM rocm/dev-ubuntu-24.04:6.4.3-complete
22
ENV DEBIAN_FRONTEND=noninteractive \
33
PHONEMIZER_ESPEAK_PATH=/usr/bin \
44
PHONEMIZER_ESPEAK_DATA=/usr/share/espeak-ng-data \
@@ -16,6 +16,7 @@ RUN apt-get update && apt upgrade -y && apt-get install -y --no-install-recommen
1616
wget \
1717
nano \
1818
g++ \
19+
zstd \
1920
&& apt-get clean \
2021
&& rm -rf /var/lib/apt/lists/* \
2122
&& mkdir -p /usr/share/espeak-ng-data \
@@ -32,7 +33,6 @@ RUN apt-get update && apt upgrade -y && apt-get install -y --no-install-recommen
3233
&& chown -R appuser:appuser /app \
3334
# Models folder
3435
&& mkdir -p /app/api/src/models/v1_0
35-
WORKDIR /app
3636

3737
USER appuser
3838
WORKDIR /app
@@ -46,13 +46,26 @@ ENV PHONEMIZER_ESPEAK_PATH=/usr/bin \
4646

4747
# Install dependencies with GPU extras (using cache mounts)
4848
RUN --mount=type=cache,target=/root/.cache/uv \
49-
uv venv --python 3.10 && \
49+
uv venv --python 3.12 && \
5050
uv sync --extra rocm
5151

52+
# Run kbd files
53+
ENV ROCM_VERSION=6.4.3
54+
COPY --chown=appuser:appuser docker/rocm/kbd_install.sh /tmp/
55+
RUN /tmp/kbd_install.sh
56+
57+
# Support older GFX Arch
58+
RUN cd /tmp && wget https://archlinux.org/packages/extra/x86_64/rocblas/download -O rocblas.tar.zst \
59+
&& pwd && ls -lah ./ \
60+
&& tar --zstd -xvf rocblas.tar.zst && rm rocblas.tar.zst \
61+
&& rm -rf /app/.venv/lib/python3.12/site-packages/torch/lib/rocblas/library/ \
62+
&& mv ./opt/rocm/lib/rocblas/library/ /app/.venv/lib/python3.12/site-packages/torch/lib/rocblas/
63+
5264
# Copy project files including models
5365
COPY --chown=appuser:appuser api ./api
5466
COPY --chown=appuser:appuser web ./web
5567
COPY --chown=appuser:appuser docker/scripts/ ./
68+
5669
RUN chmod +x ./entrypoint.sh
5770

5871
# Set all environment variables in one go

docker/rocm/kbd_install.sh

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
ver() {
6+
printf "%3d%03d%03d%03d" $(echo "$1" | tr '.' ' ');
7+
}
8+
9+
# Sets GFX_ARCH to default if not set
10+
if [ -z "$GFX_ARCH" ]; then
11+
echo "WARNING: missing env var GFX_ARCH, using default (this will take longer)"
12+
GFX_ARCHS=("gfx900" "gfx906" "gfx908" "gfx90a" "gfx942" "gfx1030")
13+
else
14+
# Convert ; seperated string to array
15+
IFS=';' read -ra GFX_ARCHS <<< "$GFX_ARCH"
16+
fi
17+
18+
# Sets ROCM_VERSION to "latest" if not set
19+
if [ -z "$ROCM_VERSION" ]; then
20+
echo "WARNING: missing env var ROCM_VERSION, using latest kdb repo (NOT RECOMMENDED)"
21+
ROCM_VERSION="latest"
22+
fi
23+
24+
# Set PyTorch version and wheel install path
25+
TORCH_INSTALL_PATH=$(uv pip show torch | grep Location | cut -d" " -f 2)
26+
27+
# Check if Torch installation path exists
28+
if [ ! -d "$TORCH_INSTALL_PATH" ]; then
29+
echo "Error: Torch installation path '$TORCH_INSTALL_PATH' does not exist."
30+
exit 1
31+
fi
32+
33+
# Print variable overview
34+
echo "ROCM version: $ROCM_VERSION"
35+
echo "GFX architectures: ${GFX_ARCHS[@]}"
36+
echo "PyTorch installation path: $TORCH_INSTALL_PATH"
37+
38+
# Create directory for extraction
39+
EXTRACT_DIR=extract_miopen_dbs
40+
rm -rf $EXTRACT_DIR
41+
mkdir -p "$EXTRACT_DIR" && cd "$EXTRACT_DIR"
42+
43+
if [[ -f /etc/lsb-release ]]; then
44+
# Exit if not 20.04, 22.04, or 24.04
45+
source /etc/lsb-release
46+
echo "DISTRIB_RELEASE: $DISTRIB_RELEASE"
47+
if [[ "$DISTRIB_RELEASE" != "20.04" && "$DISTRIB_RELEASE" != "22.04" ]]; then
48+
if [[ "$ROCM_VERSION" != "latest" && $(ver $ROCM_VERSION) -lt $(ver 6.2) && "$DISTRIB_RELEASE" == "24.04" ]]; then
49+
echo "ERROR: Unsupported Ubuntu version."
50+
exit 1
51+
fi
52+
fi
53+
54+
for arch in "${GFX_ARCHS[@]}"; do
55+
# Download MIOpen .kdbs for ROCm version and GPU architecture on ubuntu
56+
echo "Downloading .kdb files for rocm-$ROCM_VERSION ($arch arch) ..."
57+
wget -q -r -np -nd -A miopen-hip-$arch*kdb_*$DISTRIB_RELEASE*deb \
58+
https://repo.radeon.com/rocm/apt/$ROCM_VERSION/pool/main/m/
59+
60+
# Check if files were downloaded. No KDB files in repo.radeon will result in error.
61+
if ! ls miopen-hip-$arch*kdb_*$DISTRIB_RELEASE*deb 1> /dev/null 2>&1; then
62+
echo -e "ERROR: No MIOpen kernel database files found for $arch\nPlease check https://repo.radeon.com/rocm/apt/$ROCM_VERSION/pool/main/m/ for supported architectures"
63+
exit 1
64+
fi
65+
done
66+
67+
# Extract all .deb files to local directory
68+
echo "Extracting deb packages for ${GFX_ARCHS[@]} ..."
69+
for deb_file in `ls *deb`; do
70+
echo "Extracting $deb_file..."
71+
dpkg-deb -xv "$deb_file" . > /dev/null 2>&1
72+
done
73+
74+
elif [[ -f /etc/centos-release || -f /etc/redhat-release ]]; then
75+
# Centos kdbs
76+
source /etc/os-release && RHEL_VERSION="$VERSION_ID"
77+
RHEL_MAJOR_VERSION=${RHEL_VERSION%%.*}
78+
echo "RHEL_VERSION: $RHEL_VERSION; RHEL_MAJOR_VERSION: $RHEL_MAJOR_VERSION"
79+
if [[ ! "$RHEL_VERSION" =~ ^(8|9) ]]; then
80+
echo "ERROR: Unsupported CentOS/RHEL release"
81+
fi
82+
for arch in "${GFX_ARCHS[@]}"; do
83+
# Download MIOpen .kdbs for ROCm version and GPU architecture on centos
84+
echo "Downloading .kdb files for rocm-$ROCM_VERSION ($arch arch) ..."
85+
wget -q -r -np -nd -A miopen-hip-$arch*kdb-[0-9]*rpm \
86+
https://repo.radeon.com/rocm/rhel${RHEL_MAJOR_VERSION}/$ROCM_VERSION/main
87+
88+
# Check if files were downloaded. No KDB files in repo.radeon will result in error.
89+
if ! ls miopen-hip-$arch*kdb-*rpm 1> /dev/null 2>&1; then
90+
echo -e "ERROR: No MIOpen kernel database files found for $arch\nPlease check https://repo.radeon.com/rocm/rhel${RHEL_MAJOR_VERSION}/$ROCM_VERSION/main for supported architectures"
91+
exit 1
92+
fi
93+
done
94+
95+
# Extract all RPM files to current directory
96+
echo "Extracting rpm packages for ${GFX_ARCHS[@]} ..."
97+
for rpm_file in `ls *rpm`; do
98+
echo "Extracting $rpm_file..."
99+
rpm2cpio "$rpm_file" | cpio -idmv 2> /dev/null
100+
done
101+
else
102+
echo "ERROR: Unsupported operating system."
103+
exit 1
104+
fi
105+
106+
# Copy miopen db files to PyTorch installation path
107+
echo "Copying kdb files to ${TORCH_INSTALL_PATH}/torch/share"
108+
cp -ra opt/rocm-*/share/miopen $TORCH_INSTALL_PATH/torch/share
109+
110+
# Remove downloaded files and extract directory
111+
cd .. && rm -rf $EXTRACT_DIR
112+
echo "Successfully installed MIOpen kernel database files"

pyproject.toml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ dependencies = [
3232
"mutagen>=1.47.0",
3333
"psutil>=6.1.1",
3434
"espeakng-loader==0.2.4",
35-
"kokoro==0.9.2",
36-
"misaki[en,ja,ko,zh]==0.9.3",
35+
"kokoro==0.9.4",
36+
"misaki[en,ja,ko,zh]==0.9.4",
3737
"spacy==3.8.5",
3838
"en-core-web-sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.8.0/en_core_web_sm-3.8.0-py3-none-any.whl",
3939
"inflect>=7.5.0",
@@ -43,23 +43,19 @@ dependencies = [
4343
]
4444

4545
[project.optional-dependencies]
46-
gpu = [
47-
"torch==2.7.1+cu128",
48-
]
46+
gpu = ["torch==2.8.0+cu129"]
4947
rocm = [
5048
"torch==2.8.0+rocm6.4",
5149
"pytorch-triton-rocm>=3.2.0",
5250
]
53-
cpu = [
54-
"torch==2.7.1",
55-
]
51+
cpu = ["torch==2.8.0"]
5652
test = [
5753
"pytest==8.3.5",
5854
"pytest-cov==6.0.0",
5955
"httpx==0.26.0",
6056
"pytest-asyncio==0.25.3",
6157
"tomli>=2.0.1",
62-
"jinja2>=3.1.6"
58+
"jinja2>=3.1.6",
6359
]
6460

6561
[tool.uv]
@@ -89,7 +85,7 @@ explicit = true
8985

9086
[[tool.uv.index]]
9187
name = "pytorch-cuda"
92-
url = "https://download.pytorch.org/whl/cu128"
88+
url = "https://download.pytorch.org/whl/cu129"
9389
explicit = true
9490

9591
[[tool.uv.index]]
@@ -102,8 +98,8 @@ requires = ["setuptools>=61.0"]
10298
build-backend = "setuptools.build_meta"
10399

104100
[tool.setuptools]
105-
package-dir = {"" = "api/src"}
106-
packages.find = {where = ["api/src"], namespaces = true}
101+
package-dir = { "" = "api/src" }
102+
packages.find = { where = ["api/src"], namespaces = true }
107103

108104
[tool.pytest.ini_options]
109105
testpaths = ["api/tests", "ui/tests"]

0 commit comments

Comments
 (0)