Remove AMD ROCm support — CPU and NVIDIA only
BREAKING: Remove Dockerfile.rocm, compose.rocm.yaml, and ROCm image build/push from the release pipeline. Remove AMD quick-start and ROCm references from README and DEVELOPER docs. Update docker-deployment and developer-docs specs to reflect CPU + NVIDIA only. The ROCm variant added significant complexity (4.2GB torch wheel, >20GB container) with limited usage. Users on AMD GPUs should stay on engine v3.2.x or switch to CPU mode. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
schema: spec-driven
|
||||
created: 2026-04-06
|
||||
@@ -0,0 +1,37 @@
|
||||
## Context
|
||||
|
||||
The project currently ships three Docker image variants: CPU, NVIDIA, and AMD ROCm. The ROCm variant requires a 4.2GB pre-built torch wheel, a multi-stage Dockerfile with ROCm-specific runtime libraries, and additional build/push steps in the release pipeline. ROCm support is less tested and adds disproportionate complexity relative to its usage.
|
||||
|
||||
## Goals / Non-Goals
|
||||
|
||||
**Goals:**
|
||||
- Remove all ROCm-specific files (Dockerfile, compose file, torch wheel)
|
||||
- Remove ROCm build/push from the release pipeline
|
||||
- Update all documentation to reflect CPU + NVIDIA only
|
||||
- Update the docker-deployment spec to remove ROCm requirements
|
||||
|
||||
**Non-Goals:**
|
||||
- Changing any engine application code (it is already GPU-vendor-agnostic via PyTorch)
|
||||
- Modifying the CPU or NVIDIA Dockerfiles (beyond what's already in-flight)
|
||||
- Providing a migration path for ROCm users (they can stay on 3.2.x or use CPU mode)
|
||||
|
||||
## Decisions
|
||||
|
||||
**1. Delete ROCm files outright rather than deprecating**
|
||||
|
||||
Remove `Dockerfile.rocm`, `compose.rocm.yaml`, and `assets/` immediately rather than marking them deprecated. There are no downstream consumers that depend on automated ROCm builds — anyone needing AMD support can pin to the last ROCm-supporting release.
|
||||
|
||||
*Alternative considered*: Keep files but stop publishing images. Rejected — dead code is confusing and still requires maintenance awareness.
|
||||
|
||||
**2. Leave archived openspec changes untouched**
|
||||
|
||||
Archived changes under `openspec/changes/archive/` contain historical ROCm references. These are historical records and should not be modified.
|
||||
|
||||
**3. Update GPU-vendor-agnostic requirement to reflect NVIDIA-only scope**
|
||||
|
||||
The existing spec requirement "Application code is GPU-vendor-agnostic" remains true at the code level (PyTorch abstracts GPU vendors), but the project no longer provides or tests ROCm images. The spec should be simplified to reflect that only NVIDIA and CPU are supported deployment targets.
|
||||
|
||||
## Risks / Trade-offs
|
||||
|
||||
- **[Breaking change for AMD users]** → Users on AMD GPUs must stay on 3.2.x or use CPU mode. Mitigated by the fact that ROCm support was already "less tested" per the original design risk assessment.
|
||||
- **[Future re-addition harder]** → If ROCm support is needed later, the Dockerfile and compose file would need to be recreated. Mitigated by git history preserving the removed files.
|
||||
@@ -0,0 +1,29 @@
|
||||
## Why
|
||||
|
||||
AMD ROCm support adds significant complexity and maintenance burden to the project — the ROCm torch wheel alone is 4.2GB, the Dockerfile requires a multi-stage build with ROCm-specific runtime libraries, and the release pipeline must build/push additional images. The final container is >20Gb. ROCm support is less tested and less commonly used than CPU or NVIDIA. Removing it keeps the project focused and manageable.
|
||||
|
||||
## What Changes
|
||||
|
||||
- **BREAKING**: Remove AMD ROCm Docker image (`Dockerfile.rocm`) and compose file (`compose.rocm.yaml`)
|
||||
- **BREAKING**: Remove ROCm image build/push/release-notes from the engine release script
|
||||
- Remove pre-built ROCm torch wheel from `assets/`
|
||||
- Remove all AMD/ROCm references from user-facing docs (README, DEVELOPER)
|
||||
- Update docker-deployment spec to reflect CPU + NVIDIA only
|
||||
|
||||
## Capabilities
|
||||
|
||||
### New Capabilities
|
||||
|
||||
_(none)_
|
||||
|
||||
### Modified Capabilities
|
||||
|
||||
- `docker-deployment`: Remove AMD ROCm Docker image requirement and all ROCm-specific scenarios. Deployment now covers CPU and NVIDIA only.
|
||||
|
||||
## Impact
|
||||
|
||||
- **Docker images**: ROCm image variant no longer published
|
||||
- **Users**: Anyone running KB on AMD GPUs will need to stay on the last version with ROCm support (3.2.x) or switch to CPU mode
|
||||
- **Release pipeline**: `release-engine.sh` simplified — only CPU and NVIDIA images
|
||||
- **Repository size**: ~4.2GB reduction by removing the torch wheel from `assets/`
|
||||
- **Docs**: README and DEVELOPER updated to remove AMD quick-start and build instructions
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
## REMOVED Requirements
|
||||
|
||||
### Requirement: AMD ROCm Docker image
|
||||
|
||||
**Reason**: AMD ROCm support removed to reduce project complexity and binary size. The ROCm torch wheel is 4.2GB and the variant is less tested than CPU or NVIDIA.
|
||||
|
||||
**Migration**: Users on AMD GPUs should stay on engine v3.2.x or switch to CPU mode (`KB_DEVICE=cpu`).
|
||||
|
||||
---
|
||||
|
||||
## MODIFIED Requirements
|
||||
|
||||
### Requirement: Application code is GPU-vendor-agnostic
|
||||
|
||||
The Python engine code SHALL NOT reference CUDA directly. GPU abstraction SHALL be handled at the Docker image level (base image selection and pip package choice). The same application code SHALL run on both NVIDIA and CPU images without modification.
|
||||
|
||||
#### Scenario: Same engine code on both platforms
|
||||
- **WHEN** the engine starts on an NVIDIA image and a CPU image with identical configuration
|
||||
- **THEN** both SHALL load the model, accept requests, and return identical search results for the same query and data
|
||||
|
||||
---
|
||||
|
||||
### Requirement: Compose files for deployment
|
||||
|
||||
The project SHALL provide Docker Compose files for single-command deployment. Compose files SHALL use `build:` context for local development. Release notes SHALL document the versioned image tag for users pulling pre-built images.
|
||||
|
||||
#### Scenario: Start NVIDIA deployment
|
||||
- **WHEN** an admin runs `docker compose -f compose.nvidia.yaml up -d`
|
||||
- **THEN** the engine SHALL start with GPU access, bind-mount the data directory, and be reachable on the configured port
|
||||
|
||||
#### Scenario: Automatic restart
|
||||
- **WHEN** the engine process crashes or the host reboots
|
||||
- **THEN** Docker SHALL automatically restart the container (restart policy `unless-stopped`)
|
||||
|
||||
#### Scenario: Configure via environment
|
||||
- **WHEN** an admin sets environment variables in the compose file (KB_MODEL, KB_API_KEY, KB_DEVICE, KB_MCP_ALLOWED_HOSTS, etc.)
|
||||
- **THEN** the engine and MCP server SHALL use those values
|
||||
|
||||
#### Scenario: Pre-built image deployment
|
||||
- **WHEN** an admin wants to use a pre-built engine image without building from source
|
||||
- **THEN** the engine release notes SHALL include the exact `docker pull` command with the versioned tag (e.g. `docker.dcglab.co.uk/dcg/kb/engine:engine-v2.1.0-nvidia`)
|
||||
|
||||
#### Scenario: MCP allowed hosts in Compose
|
||||
- **WHEN** the kb-mcp service is defined in a Compose file
|
||||
- **THEN** the environment block SHALL include `KB_MCP_ALLOWED_HOSTS` with a comment explaining its format and purpose
|
||||
|
||||
---
|
||||
|
||||
### Requirement: Bind-mount data directory
|
||||
|
||||
The engine SHALL store all persistent state (SQLite database, HF model cache, staging directory) under a single configurable data directory. This directory SHALL be mounted from the host via bind mount.
|
||||
|
||||
#### Scenario: Data directory structure
|
||||
- **WHEN** the engine starts for the first time
|
||||
- **THEN** it SHALL create the following structure under the data directory:
|
||||
- `kb.db` — SQLite database
|
||||
- `hf_cache/` — HuggingFace model cache
|
||||
- `staging/` — temporary files for queued ingestion jobs
|
||||
|
||||
#### Scenario: Portable data across hosts
|
||||
- **WHEN** an admin copies the data directory from Host A to Host B and starts the engine with the same bind mount path
|
||||
- **THEN** the engine SHALL start successfully and serve all previously ingested documents without reprocessing
|
||||
|
||||
---
|
||||
|
||||
### Requirement: CPU-only fallback
|
||||
|
||||
The Dockerfiles SHALL produce images that work without GPU access. If no GPU is available, the engine SHALL fall back to CPU for all operations.
|
||||
|
||||
#### Scenario: No GPU available
|
||||
- **WHEN** the container starts without GPU passthrough (no `--gpus`)
|
||||
- **THEN** the engine SHALL detect no GPU, load the model on CPU, and log a warning that GPU acceleration is unavailable
|
||||
|
||||
#### Scenario: Explicit CPU mode
|
||||
- **WHEN** `KB_DEVICE=cpu` and `KB_INGEST_DEVICE=cpu` are set in the environment
|
||||
- **THEN** the engine SHALL use CPU regardless of GPU availability
|
||||
@@ -0,0 +1,20 @@
|
||||
## 1. Delete ROCm files
|
||||
|
||||
- [x] 1.1 Delete `engine/Dockerfile.rocm`
|
||||
- [x] 1.2 Delete `engine/compose.rocm.yaml`
|
||||
- [x] 1.3 Delete `assets/` directory (ROCm torch wheel)
|
||||
|
||||
## 2. Update release pipeline
|
||||
|
||||
- [x] 2.1 Remove ROCm image build, tag, and push from `release-engine.sh`
|
||||
- [x] 2.2 Remove ROCm entries from release notes output in `release-engine.sh`
|
||||
|
||||
## 3. Update documentation
|
||||
|
||||
- [x] 3.1 Remove AMD GPU quick-start section and ROCm references from `README.md`
|
||||
- [x] 3.2 Remove ROCm build instructions and `compose.rocm.yaml` references from `DEVELOPER.md`
|
||||
- [x] 3.3 Remove `onnxruntime-rocm` migration note from `DEVELOPER.md`
|
||||
|
||||
## 4. Update specs
|
||||
|
||||
- [x] 4.1 Update `openspec/specs/docker-deployment/spec.md` — remove AMD ROCm requirement, remove ROCm scenarios, update GPU-agnostic requirement to CPU + NVIDIA scope
|
||||
Reference in New Issue
Block a user