Skip to content

[Perf] Update labelGPUNodes() to reset updateLabels inside loop#2113

Open
smalleni wants to merge 1 commit intoNVIDIA:mainfrom
smalleni:fix_updateLabels
Open

[Perf] Update labelGPUNodes() to reset updateLabels inside loop#2113
smalleni wants to merge 1 commit intoNVIDIA:mainfrom
smalleni:fix_updateLabels

Conversation

@smalleni
Copy link

As a golden rule of performance, we should never do work that is not necessary. In the current implementation where updateLabels is declared outside the for loop, if updateLabels becomes true for the first node in a large GPU cluster, it triggers a PATCH request to the API for every subsequent node even when not necessary. This maybe a cheap call but we should never do work that is not necessary. Moving updateLabels inside of the for loop, reduces APi calls and load, along with improving reconcilliation time.

Description

Checklist

  • No secrets, sensitive information, or unrelated changes
  • Lint checks passing (make lint)
  • Generated assets in-sync (make validate-generated-assets)
  • Go mod artifacts in-sync (make validate-modules)
  • Test cases are added for new code paths

Testing

As a golden rule of performance, we should never do work that is not necessary.
In the current implementation where updateLabels is declared outside the for loop,
if updateLabels becomes true for the first node in a large GPU cluster, it triggers
a PATCH request to the API for every subsequent node even when not necessary. This
maybe a cheap call but we should never do work that is not necessary. Moving updateLabels
inside of the for loop, reduces APi calls and load, along with improving reconcilliation time.

Signed-off-by: Sai Sindhur Malleni <smalleni@nvidia.com>
@copy-pr-bot
Copy link

copy-pr-bot bot commented Feb 10, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant