Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -272,16 +272,23 @@ describe('Model Catalog Performance Filters API Behavior', () => {

cy.findByTestId(PERFORMANCE_FILTER_TEST_IDS.hardwareTable).should('exist');

// Change a filter to ensure something is set
// Change workload type filter
changeWorkloadTypeFilter();

// Click Clear all filters button in the toolbar (PatternFly's native button)
// Apply cold start filter (applies with default max value)
modelCatalog.openColdStartLatencyFilter();
modelCatalog.applyColdStartLatencyFilter();

// Click Reset all defaults button in the toolbar
cy.findByRole('button', { name: 'Reset all defaults' }).click();

// Verify filters are reset to defaults - workload type should NOT show Code Fixing
// Verify workload type is reset - should NOT show Code Fixing
cy.findByTestId(PERFORMANCE_FILTER_TEST_IDS.workloadType)
.should('be.visible')
.and('not.contain.text', 'Code Fixing');

// Verify cold start filter is still visible and reset to default
cy.findByTestId(PERFORMANCE_FILTER_TEST_IDS.coldStartLoadTime).should('be.visible');
});

it('should reset latency filter when Reset all filters is clicked', () => {
Expand Down Expand Up @@ -321,25 +328,6 @@ describe('Model Catalog Performance Filters API Behavior', () => {
});
});

it('should NOT include cold_start_time_to_load_seconds after toggle is turned OFF', () => {
visitWithPerformanceToggle(true);

modelCatalog.openColdStartLatencyFilter();
modelCatalog.applyColdStartLatencyFilter();

modelCatalog.togglePerformanceView();
modelCatalog.findLoadingState().should('not.exist');

cy.intercept('GET', '**/model_catalog/models*').as('getModelsWithoutColdStart');

triggerFilterRefresh();

cy.wait('@getModelsWithoutColdStart').then((interception) => {
const decodedUrl = decodeURIComponent(interception.request.url);
expect(decodedUrl).to.not.include('cold_start_time_to_load_seconds');
});
});

it('should pass cold_start_time_to_load_seconds as orderBy when cold start sort is selected', () => {
visitWithPerformanceToggle(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ function useModelCatalogSetup(providerState: CatalogProviderState) {
baseSetFilterData(latencyKey, undefined);
});
baseSetFilterData(ModelCatalogStringFilterKey.HARDWARE_CONFIGURATION, []);
baseSetFilterData(ModelCatalogNumberFilterKey.MAX_RPS, undefined);
baseSetFilterData(ModelCatalogNumberFilterKey.COLD_START_LOAD_TIME, undefined);
baseSetFilterData(ModelCatalogNumberFilterKey.MIN_VRAM, undefined);
baseSetFilterData(ModelCatalogNumberFilterKey.IMAGE_SIZE, undefined);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { Content, ContentVariants, Flex } from '@patternfly/react-core';
import { Content, ContentVariants, Divider, Flex } from '@patternfly/react-core';
import { ModelCatalogContext } from '~/app/context/modelCatalog/ModelCatalogContext';
import {
ModelCatalogNumberFilterKey,
Expand Down Expand Up @@ -124,6 +124,7 @@ const ModelCatalogFilters: React.FC = () => {
fallbackMin={4}
fallbackMax={480}
/>
<Divider />
<SidebarSliderFilter
filterKey={ModelCatalogNumberFilterKey.IMAGE_SIZE}
label="Container size"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const SidebarSliderFilter: React.FC<SidebarSliderFilterProps> = ({
if (option && option.range) {
const { min, max } = option.range;
if (min != null && max != null) {
return { min, max };
return { min: Math.floor(min), max: Math.ceil(max) };
}
}
return { min: fallbackMin, max: fallbackMax };
Expand Down Expand Up @@ -116,6 +116,7 @@ const SidebarSliderFilter: React.FC<SidebarSliderFilterProps> = ({
suffix={suffix}
ariaLabel={`${label} filter value`}
showBoundaries
shouldRound
/>
</FlexItem>
<FlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const SliderWithInput: React.FC<SliderWithInputProps> = ({
hasTooltipOverThumb = false,
}) => {
const roundValue = React.useCallback(
(val: number) => (shouldRound ? Math.ceil(val * 100) / 100 : val),
(val: number) => (shouldRound ? Math.round(val) : val),
[shouldRound],
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,12 @@ export const getDefaultFiltersFromNamedQuery = (
if (resolvedValue !== undefined) {
if (fieldName === ModelCatalogNumberFilterKey.MAX_RPS) {
result[ModelCatalogNumberFilterKey.MAX_RPS] = resolvedValue;
} else {
} else if (fieldName === ModelCatalogNumberFilterKey.COLD_START_LOAD_TIME) {
result[ModelCatalogNumberFilterKey.COLD_START_LOAD_TIME] = resolvedValue;
} else if (fieldName === ModelCatalogNumberFilterKey.MIN_VRAM) {
result[ModelCatalogNumberFilterKey.MIN_VRAM] = resolvedValue;
} else {
result[ModelCatalogNumberFilterKey.IMAGE_SIZE] = resolvedValue;
}
}
return;
Expand Down
8 changes: 5 additions & 3 deletions clients/ui/frontend/src/concepts/modelCatalog/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,17 +488,16 @@ export const MATCH_ALL_FILTER_KEYS: ModelCatalogStringFilterKey[] = [
export const DEPLOYMENT_RESOURCE_PREFIXES = ['vllm'];

/**
* Performance filter keys that are shown when performance view is enabled.
* Performance filter keys that are shown as chips in the performance toolbar.
* These filters should reset to default values (from namedQueries) instead of clearing.
* Note: MIN_VRAM and IMAGE_SIZE are sidebar-only filters (not shown as chips on the details page).
* Note: HARDWARE_CONFIGURATION is NOT included here because it should clear normally
* like basic filters, not reset to defaults.
*/
export const PERFORMANCE_FILTER_KEYS: ModelCatalogFilterKey[] = [
ModelCatalogStringFilterKey.USE_CASE,
ModelCatalogNumberFilterKey.MAX_RPS,
ModelCatalogNumberFilterKey.COLD_START_LOAD_TIME,
ModelCatalogNumberFilterKey.MIN_VRAM,
ModelCatalogNumberFilterKey.IMAGE_SIZE,
...ALL_LATENCY_FILTER_KEYS,
];

Expand Down Expand Up @@ -573,10 +572,13 @@ export const getAllFiltersToShow = (
const activeLatencyKeys = ALL_LATENCY_FILTER_KEYS.filter((key) => filterData[key] !== undefined);
// Use Set to deduplicate since PERFORMANCE_FILTER_KEYS already includes latency fields
// Include HARDWARE_CONFIGURATION which shows in performance toolbar but clears normally
// Include MIN_VRAM and IMAGE_SIZE which are sidebar-only filters shown on the landing page
return [
...new Set([
...BASIC_FILTER_KEYS,
...PERFORMANCE_FILTER_KEYS,
ModelCatalogNumberFilterKey.MIN_VRAM,
ModelCatalogNumberFilterKey.IMAGE_SIZE,
ModelCatalogStringFilterKey.HARDWARE_CONFIGURATION,
...activeLatencyKeys,
]),
Expand Down
Loading