Skip to content

Deployment guide

This guide provides step-by-step instructions for deploying AMD Inference Microservice (AIM) container for google/gemma-3n-E4B-it model in various environments. Follow these instructions to quickly get started with running an AI model on AMD accelerators. This guide assumes W7900 accelerator on the target system.

Prerequisites

  • AMD Radeon™ Pro GPU with ROCm support (e.g., W7900, R9700)
  • Docker installed and configured with GPU support
  • Access to model repositories (Hugging Face account with appropriate permissions for gated models)

Docker deployment

Running the container

Terminal window
docker run \
-e HF_TOKEN=<YOUR_HUGGINGFACE_TOKEN> \
--device=/dev/kfd --device=/dev/dri \
-p 8000:8000 \
amdenterpriseai/aim-radeon-google-gemma-3n-e4b-it:0.12.0-preview

Where <YOUR_HUGGINGFACE_TOKEN> is your Hugging Face access token (required for gated models)

Customizing deployment with environment variables

Customize your deployment with optional environment variables:

Terminal window
docker run \
-e AIM_PRECISION=bf16 \
-e AIM_ACCELERATOR_COUNT=1 \
-e AIM_METRIC=throughput \
-e AIM_PORT=8080 \
--device=/dev/kfd --device=/dev/dri \
-p 8080:8080 \
amdenterpriseai/aim-radeon-google-gemma-3n-e4b-it:0.12.0-preview

Kubernetes deployment

Deployment

It is possible to deploy AIM using Kubernetes. In this doc a sample Kubernetes deployment manifest is provided.

Create deployment.yaml with the following content:

apiVersion: apps/v1
kind: Deployment
metadata:
name: minimal-aim-deployment
labels:
app: minimal-aim-deployment
spec:
progressDeadlineSeconds: 3600
replicas: 1
selector:
matchLabels:
app: minimal-aim-deployment
template:
metadata:
labels:
app: minimal-aim-deployment
spec:
containers:
- name: minimal-aim-deployment
image: amdenterpriseai/aim-radeon-google-gemma-3n-e4b-it:0.12.0-preview
imagePullPolicy: Always
env:
- name: AIM_PRECISION
value: "auto"
- name: AIM_ACCELERATOR_COUNT
value: "1"
- name: AIM_ACCELERATOR_MODEL
value: "auto"
- name: AIM_ENGINE
value: "vllm"
- name: AIM_METRIC
value: "latency"
- name: AIM_LOG_LEVEL_ROOT
value: "INFO"
- name: AIM_LOG_LEVEL
value: "INFO"
- name: AIM_PORT
value: "8000"
- name: HF_TOKEN
valueFrom:
secretKeyRef:
name: hf-token
key: hf-token
ports:
- name: http
containerPort: 8000
resources:
requests:
memory: "16Gi"
cpu: "4"
amd.com/gpu: "1"
limits:
memory: "16Gi"
cpu: "4"
amd.com/gpu: "1"
startupProbe:
httpGet:
path: /v1/models
port: http
periodSeconds: 10
failureThreshold: 360
livenessProbe:
httpGet:
path: /health
port: http
readinessProbe:
httpGet:
path: /v1/models
port: http
volumeMounts:
- name: ephemeral-storage
mountPath: /tmp
- name: dshm
mountPath: /dev/shm
volumes:
- name: ephemeral-storage
emptyDir:
sizeLimit: 256Gi
- name: dshm
emptyDir:
medium: Memory
sizeLimit: 32Gi

Create a service configuration in service.yaml file:

apiVersion: v1
kind: Service
metadata:
name: minimal-aim-deployment
labels:
app: minimal-aim-deployment
spec:
type: ClusterIP
ports:
- name: http
port: 80
targetPort: 8000
selector:
app: minimal-aim-deployment

The deployment can be customized further based on your requirements. It can be applied to Kubernetes cluster using kubectl:

Terminal window
kubectl apply -f . -n <YOUR_K8S_NAMESPACE>

This page covers Docker and Kubernetes. The full deployment guide also covers model caching for production, testing your deployment, advanced deployment scenarios, monitoring and troubleshooting, and security considerations.

View full deployment guide