8000 feat(ui): offer generic accelerator parents in resource type picker by janzak-dev · Pull Request #1526 · google/xmc · GitHub
[go: up one dir, main page]

Skip to content

feat(ui): offer generic accelerator parents in resource type picker - #1526

Merged
janzak-dev merged 2 commits into
mainfrom
feat/rod-generic-accelerator-picker-options
Nov 2, 2026
Merged

janzak-dev merged 2 commits into
mainfrom
feat/rod-generic-accelerator-picker-options

Conversation

@janzak-dev
@janzak-dev janzak-dev commented Nov 2, 2026 •
Copy link
Copy Markdown
Collaborator

Summary

Enables users to select generic accelerator parents (such as nvidia.com/gpu or google.com/tpu) in the Resource Observability Dashboard (ROD) "Smart Resource Finder" resource-type picker, even when cluster queues report only specific compound models (e.g. nvidia.com/gpu: nvidia-tesla-a100).

Motivation & Context

In PR #605, the backend ROD data provider was updated to resolve generic accelerator resources into compound specific names like nvidia.com/gpu: nvidia-tesla-a100 via ResourceFlavor node labels. In PR #643, hierarchical filtering was introduced in matchesResourceFilter, enabling a generic filter selection like nvidia.com/gpu to match both generic queues and all specific models of that accelerator family.

However, the dropdown options in ResourceDashboard were directly populated from the raw reported capacities in availableResourceTypes. On production environments where every GPU or TPU ClusterQueue uses a labeled flavor, only specific compound types appeared in the dropdown, preventing users from searching across all GPU or TPU models with a single generic filter.

Screenshots

All possible options - both generic and specific

image

When choosing generic

image

When choosing specific

image

Key Changes

  • Parent Derivation: Added expandResourceTypesWithParents in cmd/ui/app/resource_dashboard/resource_filter.ts. For every type containing the ": " delimiter emitted by formatCompoundAccelerator, it adds the parent (e.g. nvidia.com/gpu), deduplicates, and sorts so each parent precedes its models.
  • Dropdown Options: Updated availableResourceTypes in cmd/ui/app/resource_dashboard/resource_dashboard.ts to pass raw capacity resource types through expandResourceTypesWithParents.
  • Unit Testing:
    • Added expandResourceTypesWithParents cases in cmd/ui/app/resource_dashboard/resource_filter_test.ts covering parent synthesis/ordering, deduplication against an already-reported parent, and non-compound types (GPU and TPU).
    • Added an integration unit test in cmd/ui/app/resource_dashboard/resource_dashboard_test.ts verifying that when a queue only reports nvidia.com/gpu: nvidia-tesla-a100, the dropdown offers nvidia.com/gpu, and selecting it displays the matching queue card.

Assumptions

  • Only the ": " delimiter produced by formatCompoundAccelerator (cmd/rod_data_provider/kueue_resource_extractor.go) is handled. Its / passthrough branch only fires when the model already starts with <resource>/, which cannot happen because the model comes from a Kubernetes label value or ResourceFlavor name, neither of which may contain /. If the backend format changes, the picker simply won't synthesize a parent (no wrong filtering).

Verification & Testing

  • Commands Executed:
    • bazel test //cmd/ui:ui_unit_tests (Passed: 694 of 694 Karma specs).
    • ./.githooks/pre-commit (Passed: Prettier, ESLint, license headers, affected-test scope none for UI-only change).
    • ./tools/analyze_diff_size.py --base-ref origin/main... (Split verifier not triggered; total diff is 4 files, +86/-11).
  • Coverage & Test Status: All branches of expandResourceTypesWithParents are exercised by resource_filter_test.ts; the end-to-end picker behavior is covered in resource_dashboard_test.ts. Screenshot baselines unchanged (mock data has no compound resource types).
  • Manual Deployment: Deployed to the private ... dev environment via tools/dev_env/dev_env.py gke-upgrade; all pods healthy and verify_xmc.py passed.

Related Issues / Bugs

Follow-up to #605 and #643.

TAG=agy
CONV=deb14588-e33d-42bb-b180-9ad652e1a8fa

Offer generic parent accelerator options (e.g. nvidia.com/gpu, google.com/tpu) in the Resource Observability Dashboard (ROD) Smart Resource Finder dropdown when cluster queues report only specific compound models (e.g. nvidia.com/gpu: nvidia-tesla-a100).

- PR #605 resolves generic resources to compound names in the ROD data provider backend using formatCompoundAccelerator with a ": " delimiter.
- PR #643 implemented hierarchical resource filtering (matchesResourceFilter) allowing generic filters like nvidia.com/gpu to match both generic and specific compound queues.
- This change introduces extractParentResourceType and expandResourceTypesWithParents in resource_filter.ts to synthesize parent options, deduplicate entries, and sort parents before specific models.
- Updates availableResourceTypes in resource_dashboard.ts to use expandResourceTypesWithParents.
- Adds comprehensive unit tests in resource_filter_test.ts and resource_dashboard_test.ts.

TAG=agy
CONV=deb14588-e33d-42bb-b180-9ad652e1a8fa
@gemini-code-assist gemini-code-assist Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces functionality to extract and synthesize parent resource types from compound resource identifiers (e.g., extracting "nvidia.com/gpu" from "nvidia.com/gpu: nvidia-tesla-a100") to improve resource filtering and dropdown options in the resource dashboard. Unit and integration tests have been added to verify this behavior. A review comment suggests adding a defensive guard in expandResourceTypesWithParents to handle cases where the input iterable might be null or undefined.

Match the exact ": " delimiter emitted by formatCompoundAccelerator, drop
trim/empty guards already handled by the caller, keep the parent helper
module-private, and consolidate unit tests.

TAG=agy
CONV=deb14588-e33d-42bb-b180-9ad652e1a8fa
@janzak-dev
janzak-dev marked this pull request as ready for review November 2, 2026 12:43
@github-actions
github-actions Bot requested a review from AntonTyb November 2, 2026 12:43
@janzak-dev
janzak-dev enabled auto-merge November 2, 2026 14:58
@janzak-dev
janzak-dev added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 4ceb0e3 Nov 2, 2026
15 checks passed
@janzak-dev
janzak-dev deleted the feat/rod-generic-accelerator-picker-options branch November 2, 2026 15:27
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.

2 participants

0