Skip to content

Add DCGM data source and extractor for GPU utilization#1895

Merged
elevran merged 4 commits into
llm-d:mainfrom
noalimoy:dcgm/datasource-and-extractor
Jul 21, 2026
Merged

Add DCGM data source and extractor for GPU utilization#1895
elevran merged 4 commits into
llm-d:mainfrom
noalimoy:dcgm/datasource-and-extractor

Conversation

@noalimoy

@noalimoy noalimoy commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?
/kind feature

What this PR does / why we need it:

The EPP routes requests using application-level metrics (KV cache, queue
depth) but has no GPU hardware utilization signal. This adds the
data-layer infrastructure to collect GPU metrics from a DCGM Exporter endpoints:

  • HTTPDataSource port override to scrape a different port on the same
    pod IP (backward-compatible, default 0 preserves existing behavior)
  • dcgm-data-source plugin that polls and parses Prometheus metrics
  • dcgm-extractor plugin that reads DCGM_FI_DEV_GPU_UTIL, aggregates
    across GPUs (max), and stores normalized utilization in the endpoint's
    AttributeMap
  • GPUUtilization attribute type with Produces/Consumes data key

A follow-up PR adds a filter and scorer that consume this attribute.

Which issue(s) this PR fixes:
Part of #1706

Release note (write NONE if no user-facing change):

NONE

@noalimoy
noalimoy requested a review from a team as a code owner July 5, 2026 14:42
@noalimoy
noalimoy requested review from ahg-g and elevran July 5, 2026 14:42
@github-actions github-actions Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. labels Jul 5, 2026
@noalimoy
noalimoy force-pushed the dcgm/datasource-and-extractor branch from c45c304 to 81e187d Compare July 6, 2026 11:55
func NewHTTPDataSource[T any](scheme, path string, skipCertVerification bool,
// portOverride, when non-zero, makes the source scrape podIP:portOverride
// instead of the endpoint's MetricsHost.
func NewHTTPDataSource[T any](scheme, path string, portOverride int, skipCertVerification bool,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we create an Option struct for optional args such as the port override, so NewHTTPDataSource(existingargs, opts... Option)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@noalimoy
noalimoy force-pushed the dcgm/datasource-and-extractor branch from 81e187d to 0c4d7cf Compare July 7, 2026 10:16
@elevran

elevran commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

@noalimoy PR has been review and needs rebase/conflict resolution to progress.

@elevran elevran left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, well-tested addition - the extractor logic (missing metric, empty samples, multi-GPU max aggregation, normalization) is covered thoroughly, and the port-override mechanism on HTTPDataSource is backward-compatible for existing callers (variadic option, no signature break for source/metrics or source/models).

Comment thread pkg/epp/framework/plugins/datalayer/source/dcgm/datasource.go
@noalimoy

Copy link
Copy Markdown
Contributor Author

Thanks @elevran for the review!
I've been out sick since last Tuesday (fell on my way to work:( ) - and just got back today. I already have a local patch ready from last week for the DaemonSet support (useNodeAddress + pod-label filtering in the extractor), will push it soon along with source/dcgm factory tests.

@noalimoy
noalimoy force-pushed the dcgm/datasource-and-extractor branch from 0c4d7cf to 0efefb0 Compare July 20, 2026 09:43

@elevran elevran left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR is well scoped and follows repo's conventions.
A few points below worth a look before merge; none are hard blockers.

Comment thread pkg/epp/framework/plugins/datalayer/source/http/datasource.go
Comment thread pkg/epp/framework/plugins/datalayer/extractor/dcgm/extractor.go
Comment thread pkg/epp/framework/plugins/datalayer/source/dcgm/datasource.go
Comment thread pkg/epp/framework/plugins/datalayer/source/dcgm/datasource.go
Comment thread pkg/epp/framework/plugins/datalayer/extractor/dcgm/extractor.go
Comment thread pkg/epp/framework/plugins/datalayer/extractor/dcgm/extractor.go
noalimoy added 3 commits July 21, 2026 12:41
The EPP has no visibility into GPU hardware pressure. This adds
the data-layer plugins that poll DCGM Exporter and store per-endpoint
GPU utilization, along with an HTTPDataSource portOverride to target
sidecar containers on a different port.

Part of llm-d#1706

Signed-off-by: noalimoy <nlimoy@redhat.com>
Add WithUseNodeAddress option to HTTPDataSource, scraping NodeAddress:port
instead of PodIP:port for node-level exporters (DCGM DaemonSet).
The extractor filters samples by pod label when present.
Add source/dcgm factory tests covering defaults, custom params, and
invalid-scheme validation.

Signed-off-by: noalimoy <nlimoy@redhat.com>
- Reject WithUseNodeAddress without a non-zero WithPortOverride at
  construction time.
- gaugeValue returns an error for non-gauge metrics instead of silent 0.
- Add direct tests for NewHTTPDCGMDataSource.

Signed-off-by: noalimoy <nlimoy@redhat.com>
@noalimoy
noalimoy force-pushed the dcgm/datasource-and-extractor branch from 0efefb0 to f95e9de Compare July 21, 2026 09:41
@elevran
elevran enabled auto-merge (squash) July 21, 2026 10:01
elevran
elevran previously approved these changes Jul 21, 2026
fix lint issue

Signed-off-by: Noa Limoy <84776878+noalimoy@users.noreply.github.com>
auto-merge was automatically disabled July 21, 2026 10:34

Head branch was pushed to by a user without write access

@noalimoy
noalimoy requested a review from elevran July 21, 2026 10:36
@elevran
elevran enabled auto-merge (squash) July 21, 2026 10:37
@elevran
elevran merged commit 05fbe86 into llm-d:main Jul 21, 2026
39 of 60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Categorizes issue or PR as related to a new feature. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants