Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ __pycache__/
ext/
env/
.kubespray/
.cpu-pinning-operator/
*.log

# Helm subchart packages — rebuilt from Chart.lock by dependency_update
Expand Down
11 changes: 11 additions & 0 deletions configs/components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,17 @@ components:
# keycloak: Grafana sign-in (observability_grafana_sso).
depends_on: [cert_manager, metallb, seaweedfs, keycloak]

# kubernetes_cpu_policy: cpu-pinning-operator, the alternative to nri_cpu_balloons
# (its chart bundles the same balloons plugin). Platform, like nri_cpu_balloons: its
# webhook pins model pods, so `teardown inference` keeps it. After observability so
# the chart finds the ServiceMonitor CRD. teardown: role, for helm uninstall's hooks.
# On any kubernetes_accelerator: it pins GPU pods too (balloon-device).
- name: cpu_pinning_operator
layer: platform
teardown: role
enabled: "{{ (kubernetes_cpu_policy | default('nri-balloons')) == 'cpu-pinning-operator' }}"
depends_on: [cert_manager, observability]

# Event-driven autoscaling (external.metrics.k8s.io); triggers query the platform
# Prometheus. On OpenShift it uses the Custom Metrics Autoscaler, which preflight checks.
- name: keda
Expand Down
2 changes: 1 addition & 1 deletion configs/defaults/global_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ seaweedfs_volume_storage_size: "10Gi"

node_topology_enabled: true # platform pods on control-plane nodes, inference on workers (soft)
enforce_pss: true # Pod Security labels on every namespace the installer creates
kubernetes_cpu_policy: "nri-balloons" # keep: model-manager and inference need NRI CPU pinning
kubernetes_cpu_policy: "nri-balloons" # or cpu-pinning-operator (docs/configuration/cpu-pinning-operator.md), kubelet-static, best-effort
kubernetes_accelerator: "cpu" # cpu: the kubelet CPU/NUMA tuning for Xeon
rack_scale_enabled: false # rack-scale fabric; needs env/<name>/rack-profile.yaml
envoy_gateway_upgrade: true # Envoy Gateway 1.9.3 with ListenerSets; false: 1.7.5. Never downgrades
Expand Down
3 changes: 2 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Start with the table. Each row is one job and one page. The sections under it ar
| Use the Kubernetes cluster dashboard and platform sign-in | [Kubernetes cluster dashboard (Headlamp)](configuration/headlamp.md) |
| Open Grafana and read the dashboards | [Observability](configuration/observability.md) |
| Place platform and inference pods on different nodes | [Node topology](configuration/node-topology.md) |
| Pin inference pods to CPU cores | [NRI CPU balloons](configuration/nri-cpu-balloons.md) |
| Pin inference pods to CPU cores | [NRI CPU balloons](configuration/nri-cpu-balloons.md) or [CPU Pinning Operator](configuration/cpu-pinning-operator.md) |
| Connect my application or framework | [Integration guide](reference/integration.md) |
| Look up a command or flag | [CLI reference](reference/cli.md) |
| See how a request reaches a model | [Network architecture](reference/networking.md) |
Expand Down Expand Up @@ -84,6 +84,7 @@ Edit the YAML under `env/<name>/` and re-run `install`.
| [Observability](configuration/observability.md) | Opening Grafana and signing in: local admin or Keycloak, roles, and the validate checks |
| [Node topology](configuration/node-topology.md) | Separating platform and inference workloads on multi-node clusters |
| [NRI CPU balloons](configuration/nri-cpu-balloons.md) | NUMA-aware CPU pinning for inference pods |
| [CPU Pinning Operator](configuration/cpu-pinning-operator.md) | The same pinning, run by an operator that pins model pods at admission |

## Connect an application

Expand Down
7 changes: 4 additions & 3 deletions docs/configuration/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ is left as it is (or commented out).
| `node_topology_enabled` | Prefer control-plane nodes for platform pods and worker nodes for models (a preference, not a rule). Default `true` — see [Node Topology](node-topology.md) |
| `enforce_pss` | Pod Security labels on every namespace the installer creates. Default `true` — see [Namespace Security Labels](../reference/labels.md) |
| `kubernetes_cpu_policy` | CPU pinning strategy for inference workloads. Default `nri-balloons` — see [CPU policy](#cpu-policy) |
| `kubernetes_accelerator` | Compute target for inference workloads. Default `cpu` (Intel® Xeon®: tune the kubelet's CPU/NUMA settings); CPU pinning is turned off for any other value |
| `kubernetes_accelerator` | Compute target for inference workloads. Default `cpu` (Intel® Xeon®: tune the kubelet's CPU/NUMA settings); CPU pinning is turned off for any other value, unless `kubernetes_cpu_policy: cpu-pinning-operator` |
| `rack_scale_enabled` | Rack-scale fabric; needs `env/<name>/rack-profile.yaml`. Default `false` — see [Rack-scale deployment](../deployment/rack-scale.md) |
| `envoy_gateway_upgrade` | `true` (default): install Envoy Gateway 1.9.3 instead of 1.7.5 (and upgrade an older one in place); the inference layer then installs KServe 0.21. `false`: 1.7.5. Never downgrades |
| `rook_ceph_devices`, `rook_ceph_teardown_wipe_devices` | `storage_backend: ceph` only — see [Storage](#storage) |
Expand Down Expand Up @@ -358,11 +358,12 @@ from it.
| Value | What it does | When to use |
|---|---|---|
| `nri-balloons` (default) | Installs the NRI balloons plugin: NUMA-aware pinning with hyperthread isolation. Pods keep normal (Burstable) QoS | Recommended — best performance on multi-socket Xeon nodes |
| `cpu-pinning-operator` | Installs the [CPU Pinning Operator](cpu-pinning-operator.md): the same NRI balloons plugin, with an admission webhook that pins model pods and a Grafana per-core map | Pinning kept in step with the nodes by an operator, with dashboards |
| `kubelet-static` | Configures the kubelet's static CPU manager (`full-pcpus-only`). Pods become Guaranteed QoS. No NRI plugin | Clusters that cannot run NRI |
| `best-effort` | No pinning: the scheduler places threads | Development, or small clusters |

Any other value stops preflight. Pinning only applies with `kubernetes_accelerator: cpu`. See
[NRI CPU Balloons](nri-cpu-balloons.md) for per-node balloon sizing.
Any other value stops preflight. Pinning only applies with `kubernetes_accelerator: cpu`, except `cpu-pinning-operator`, which pins GPU pods too. See
[NRI CPU Balloons](nri-cpu-balloons.md) for per-node balloon sizing, or [CPU Pinning Operator](cpu-pinning-operator.md).

---

Expand Down
97 changes: 97 additions & 0 deletions docs/configuration/cpu-pinning-operator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# CPU Pinning Operator

[← Docs index](../README.md)

`kubernetes_cpu_policy: cpu-pinning-operator` pins model servers to their own NUMA-local cores with the [CPU Pinning Operator](https://github.com/intel/cpu-pinning-operator) instead of the `nri_cpu_balloons` role. Both run the same NRI balloons plugin. The difference is who decides the pinning:

| | `nri-balloons` | `cpu-pinning-operator` |
|---|---|---|
| Per-node `BalloonsPolicy` | written by the installer at install and `add-node` | written by the operator, kept in step with every node it sees |
| Model pod annotation | added by `model-manager` | added by the operator's admission webhook |
| Plugin namespace | `kube-system` | `cpu-pinning-operator-system` |
| GPU model pods | not pinned | pinned to dedicated cores (`balloon-device`) |
| Dashboards | — | Grafana per-core map per node, plus a cluster overview |

Unlike the other policies, this one also applies when `kubernetes_accelerator` is not `cpu`.

## Enable it

In `env/<name>/global_config.yaml`, before `install platform`:

```yaml
kubernetes_cpu_policy: "cpu-pinning-operator"
```

`install platform` (or any layer above) then installs the chart from a checkout of the operator's release tag (`cpu_pinning_operator_version`, default `v1.0.0`) into `.cpu-pinning-operator/`. The kubelet stays on `cpuManagerPolicy: none`, as with `nri-balloons`. To install or re-apply the operator on its own:

```bash
./toolkit_manager.sh install cpu_pinning_operator --env <name>
./toolkit_manager.sh validate cpu_pinning_operator --env <name>
```

**Switching from `nri-balloons`:** undeploy the models and run `./toolkit_manager.sh teardown nri_cpu_balloons` while the policy is still `nri-balloons`. Then change the policy, install, and deploy the models again. The install stops while the `nri_cpu_balloons` plugin still runs, because two balloons plugins on one node fight over the same cores. To switch back, do the reverse with `teardown cpu_pinning_operator`.

## What gets pinned

The operator pins model-manager's serving containers in `llm-inference`: `main` (vLLM, `LLMInferenceService`) and `kserve-container` (OVMS, `InferenceService`). It reads the number of NUMA nodes from `--tensor-parallel-size`, or from the pod annotation `cpu-pinning-operator.intel.com/tp`. `model-manager deploy` needs no change. Check a model:

```bash
POD=$(kubectl -n llm-inference get pod -l app.kubernetes.io/name=qwen3-0-6b -o name | head -1)
kubectl -n llm-inference get $POD -o jsonpath='{.metadata.annotations}' | tr , '\n' | grep balloon
kubectl -n llm-inference exec $POD -c main -- grep Cpus_allowed_list /proc/self/status
```

**GPU models** (`vllm-cuda`, `vllm-xpu`) are pinned too. model-manager gives the pod a CPU limit equal to its request, in whole cores, and the operator puts any pod that requests a device (`nvidia.com/gpu`, `gpu.intel.com/xe`) in its `balloon-device` type. Those cores are dedicated, but they are not steered to the GPU's NUMA node. That needs the kubelet's alpha `KubeletPodResourcesGet` feature gate, which the installer does not turn on (upstream advises against it).

## Reserved CPUs

Every pod that is not pinned runs on the reserved pool. It is sized by the same settings as `nri-balloons` ([Reserved CPU sizing](nri-cpu-balloons.md#3-reserved-cpu-sizing)), so switching policy keeps the split:

| Setting | Operator gets |
|---|---|
| `nri_deployment_profile: siblings` (default) | physical cores for models; every hyperthread sibling reserved |
| `minimal` / `standard` / `observability` / `full` | 8 / 12 / 16 / 20 CPUs reserved; models may get hyperthreads |
| `nri_reserved_cpu_list: "0-3,64-67"` | that many CPUs reserved (8). The operator picks the CPU IDs. |

The operator keeps each node's reservation between 4 CPUs and 25% of its physical cores.

## Settings

| Variable | Default | |
|---|---|---|
| `cpu_pinning_operator_version` | `v1.0.0` | Release tag of the chart and image |
| `cpu_pinning_operator_containers` | `["main", "kserve-container"]` | Container names to pin (globs allowed) |
| `cpu_pinning_operator_namespaces` | `["llm-inference"]` | Namespaces the webhook watches |
| `cpu_pinning_operator_pct_enabled` | `true` | Intel® Priority Core Turbo, see below |
| `cpu_pinning_operator_extra_values` | `{}` | Any other [chart value](https://github.com/intel/cpu-pinning-operator/blob/main/deploy/cpu-pinning-operator/values.yaml), merged last |

For example, to refuse a model pod that does not fit instead of only warning about it:

```yaml
cpu_pinning_operator_extra_values:
balloonPinningPolicy:
capacityCheck:
mode: enforce
```

## Intel® Priority Core Turbo

On by default. The operator gives every policy two CPU classes, applied through Intel® Speed Select Technology – Core Power (SST-CP):

- `gpu-hp` (high priority) for GPU pods' cores (`balloon-device`)
- `cpu-lp` (low priority) for CPU model balloons

The reserved pool gets no class. PCT takes effect only on Xeon® processors that support it, with SST enabled in the BIOS and the kernel's `isst_if` driver providing `/dev/isst_interface`. Elsewhere the plugin logs `pct: SST not supported on this host; ignoring PCT fields in cpuClasses` and pins as usual.

To apply the classes, the balloons plugin runs **privileged** with the host's `/dev` mounted (the `allowPCT` chart value). On OpenShift it then gets the `privileged` SCC. Turn it off with `cpu_pinning_operator_pct_enabled: false`, which returns the plugin to a hostPath-only, unprivileged pod.

On a node with SST, CPU model balloons are low priority, so on a CPU-only inference node they can run at a lower turbo frequency than platform pods. Measure tokens per second with PCT on and off before relying on it for CPU inference.

## Limitations

- `model-manager` runs no placement pre-flight under this policy, so the operator's capacity check (`warn` by default) is the only one. A model-manager older than this policy logs `Invalid MM_CPU_POLICY='cpu-pinning-operator'` and deploys as `best-effort`; the webhook still pins the pod.
- A pod created before a node is provisioned is admitted unpinned or denied (`enforcePinning`), so the install waits until `BalloonsClusterConfig/cluster` is `Ready`.
- `nri_reserved_cpu_list` keeps only its size: the operator chooses which CPUs.
- Helm does not upgrade CRDs. If a new operator release changes its CRDs, apply them from the new checkout first.

Troubleshooting, architecture and every chart value: the operator's [documentation](https://github.com/intel/cpu-pinning-operator/tree/main/docs).
2 changes: 1 addition & 1 deletion docs/configuration/nri-cpu-balloons.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Two terms used throughout:
- **Balloon**: a named set of CPU cores. A container placed in a balloon runs only on those cores.

> [!NOTE]
> `kubernetes_cpu_policy: nri-balloons` is the default on CPU clusters (`kubernetes_accelerator: cpu`). With `kubelet-static` or `best-effort`, or on a GPU cluster, the components below are not deployed and models are scheduled without balloon pinning.
> `kubernetes_cpu_policy: nri-balloons` is the default on CPU clusters (`kubernetes_accelerator: cpu`). With `cpu-pinning-operator` ([its own guide](cpu-pinning-operator.md)), `kubelet-static` or `best-effort`, or on a GPU cluster, the components below are not deployed and models are scheduled without balloon pinning.

---

Expand Down
3 changes: 2 additions & 1 deletion docs/reference/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ infrastructure → platform → inference → erag / agent-toolkit (opt-in
| Layer | Components (in [configs/components.yaml](../../configs/components.yaml) unless noted) | Installed by |
|---|---|---|
| `infrastructure` | `kubernetes`, `storage`; `kata_containers` (`kata_containers_enabled`); rack-scale only (`rack_scale_enabled`): `fabric_inventory`, `fabric_netplan`, `fabric_sysctl`, `fabric_bgp`, `fabric_validate` | `install` of any layer |
| `platform` | `node_feature_discovery`, `nri_cpu_balloons`, `intel_gpu_plugin`, `cert_manager`, `istio`, `metallb`, `metrics_server`, `gateway` (alias `envoy_gateway`), `postgresql`, `keycloak`, `object_store`, `seaweedfs`, `observability`, `headlamp`; opt-in: `keda`, `velero`; rack-scale: `nvidia_gpu_operator`, `gpu_observability` | `install` of `platform` or any layer above |
| `platform` | `node_feature_discovery`, `nri_cpu_balloons` or `cpu_pinning_operator`, `intel_gpu_plugin`, `cert_manager`, `istio`, `metallb`, `metrics_server`, `gateway` (alias `envoy_gateway`), `postgresql`, `keycloak`, `object_store`, `seaweedfs`, `observability`, `headlamp`; opt-in: `keda`, `velero`; rack-scale: `nvidia_gpu_operator`, `gpu_observability` | `install` of `platform` or any layer above |
| `inference` | from inference-toolkit's `components.yaml`: `keycloak_config`, `envoy_ai_gateway`, `kserve`, `litellm`, `langfuse`, `llm_services`, `vllm_sr` (opt-in) | `install inference`, or a layer above it |
| `erag` | from enterprise-rag's `components.yaml` (the `app_*` roles) | `install erag`, after `init erag` |
| `agent-toolkit` | from enterprise-agent-toolkit's `components.yaml` | `install agent-toolkit`, after `init agent-toolkit` |
Expand Down Expand Up @@ -432,6 +432,7 @@ All roles follow the same pattern: `defaults/main.yaml` for config, `tasks/main.
| `velero` | Cluster backups (opt-in, `velero_enabled`; needs snapshot-capable storage). |
| `nvidia_gpu_operator`, `gpu_observability` | NVIDIA GPU nodes on rack-scale: the GPU Operator, DCGM metrics and dashboards. |
| `nri_cpu_balloons` | NRI CPU-balloons plugin. Generates per-node `BalloonsPolicy` CRs based on NUMA topology. Enabled only when `kubernetes_cpu_policy=nri-balloons` and `kubernetes_accelerator=cpu` ([NRI CPU Balloons](../configuration/nri-cpu-balloons.md)). |
| `cpu_pinning_operator` | [CPU Pinning Operator](https://github.com/intel/cpu-pinning-operator): the same balloons plugin, with per-node policies and an admission webhook that pins matched model pods. Enabled only when `kubernetes_cpu_policy=cpu-pinning-operator`, on any `kubernetes_accelerator`: it pins GPU pods too ([CPU Pinning Operator](../configuration/cpu-pinning-operator.md)). |
| `ownership` | Library role: labels what each component creates and deletes it on teardown. |
| `layer_checks` | Library role: deployment records, run classes and the checks before an install or teardown. |
| `backup` | Library role used by `playbooks/backup.yaml`. |
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ refuses a blocking verdict. See [Upgrade a Layer](../deployment/upgrade.md).
| Target | What it covers |
|---|---|
| `infrastructure` | `kubernetes`, `storage`; plus `kata_containers` (`kata_containers_enabled`) and the `fabric_*` rack-scale networking components (`rack_scale_enabled`) when switched on |
| `platform` | `cert_manager`, `istio`, `metallb`, `gateway` (also accepted as `envoy_gateway`), `postgresql`, `keycloak`, `object_store`, `seaweedfs`, `observability`, `metrics_server`, `node_feature_discovery`, `nri_cpu_balloons`, `intel_gpu_plugin` (Intel GPU nodes only); plus `headlamp`, `keda` and `velero` when switched on, and `nvidia_gpu_operator` / `gpu_observability` on rack-scale |
| `platform` | `cert_manager`, `istio`, `metallb`, `gateway` (also accepted as `envoy_gateway`), `postgresql`, `keycloak`, `object_store`, `seaweedfs`, `observability`, `metrics_server`, `node_feature_discovery`, `nri_cpu_balloons` (or `cpu_pinning_operator`, by `kubernetes_cpu_policy`), `intel_gpu_plugin` (Intel GPU nodes only); plus `headlamp`, `keda` and `velero` when switched on, and `nvidia_gpu_operator` / `gpu_observability` on rack-scale |
| `inference` | `keycloak_config`, `envoy_ai_gateway`, `kserve`, `llm_services`; plus `litellm` and `langfuse` (with `auth_type: litellm_vkey` or `litellm_enabled: true`), and `vllm_sr` when switched on. Comes from the inference repository |
| `erag` | The Intel® Chatbot Toolkit components (vector databases, document ingestion, chat UI, …). Comes from its repository; opt-in |
| `agent-toolkit` | The Intel® Agent Toolkit components (agent sandboxes, memory stores, …). Comes from its repository; opt-in |
Expand Down
1 change: 1 addition & 0 deletions docs/reference/labels.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Includes the infrastructure-layer storage namespaces (`csi-driver-nfs`, `rook-ce
| `intel-gpu-plugin` | `privileged` | `privileged` | `privileged` | — | `intel_gpu_plugin` | `intel_gpu_plugin_enabled: true` and a node has an Intel GPU |
| `headlamp` | `restricted` | `restricted` | `restricted` | `ambient` | `headlamp` | `headlamp_enabled: true` |
| `keda` | `restricted` | `restricted` | `restricted` | `ambient` | `keda` | `keda_enabled: true` |
| `cpu-pinning-operator-system` | `privileged` | `privileged` | `privileged` | — | `cpu_pinning_operator` | `kubernetes_cpu_policy: cpu-pinning-operator` |
| `velero` | `baseline` | `baseline` | `baseline` | `ambient` | `velero` | `velero_enabled: true` |
| `csi-driver-nfs` | `privileged` | `privileged` | `privileged` | — | `nfs_storage` | `storage_backend: nfs` |
| `rook-ceph` | `privileged` | `privileged` | `privileged` | — | `rook_ceph_storage` | `storage_backend: ceph` |
Expand Down
Loading