From c581dd480b903aa486be0c77f6f8e1e509c54331 Mon Sep 17 00:00:00 2001 From: Tai An Date: Fri, 21 Aug 2026 12:16:28 -0700 Subject: [PATCH] fix(docker): install python3.12-dev so Triton can JIT in the container (#453) The image installs triton (a cu12/cu13 dependency), which compiles its cuda_utils extension at runtime and therefore needs Python.h. Only python3.12/-venv/-pip were installed, so every JIT attempt failed with 'fatal error: Python.h: No such file or directory' and flash-linear-attention rolled back to CPU. --- docker/Dockerfile | 7 ++++++- docker/Dockerfile.cu13 | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 092e8b7c..27733945 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,12 +1,17 @@ # Use an official CUDA runtime with Ubuntu as a parent image FROM nvidia/cuda:12.8.1-runtime-ubuntu24.04 -# Install system dependencies +# Install system dependencies. python3.12-dev supplies Python.h, which Triton's +# runtime JIT needs to build its cuda_utils extension inside the container. The +# venv resolves its include path to /usr/include/python3.12, so the headers have +# to come from the system python, not from the venv. +# See: https://github.com/theroyallab/tabbyAPI/issues/453 RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ curl \ ca-certificates \ python3.12 \ + python3.12-dev \ python3-pip \ python3.12-venv \ && rm -rf /var/lib/apt/lists/* diff --git a/docker/Dockerfile.cu13 b/docker/Dockerfile.cu13 index 2ed2d422..e77cdf9d 100644 --- a/docker/Dockerfile.cu13 +++ b/docker/Dockerfile.cu13 @@ -1,12 +1,17 @@ # Use an official CUDA 13 runtime with Ubuntu as a parent image FROM nvidia/cuda:13.2.1-runtime-ubuntu24.04 -# Install system dependencies +# Install system dependencies. python3.12-dev supplies Python.h, which Triton's +# runtime JIT needs to build its cuda_utils extension inside the container. The +# venv resolves its include path to /usr/include/python3.12, so the headers have +# to come from the system python, not from the venv. +# See: https://github.com/theroyallab/tabbyAPI/issues/453 RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ curl \ ca-certificates \ python3.12 \ + python3.12-dev \ python3-pip \ python3.12-venv \ && rm -rf /var/lib/apt/lists/*