-
Notifications
You must be signed in to change notification settings - Fork 693
feat: add supported/experimental tier classification to model-selection algorithms (#1514) #1693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
c8646bd
docs: add design spec for algorithm tier classification (#1514)
szedan-rh f50c93a
docs: add implementation plan for algorithm tier classification (#1514)
szedan-rh 9570050
feat(selection): add AlgorithmTier and Dependency types to Selector i…
szedan-rh 799d8fb
feat(selection): implement Tier() for supported algorithms (#1514)
szedan-rh ddae4fc
feat(selection): implement Tier() for experimental algorithms (#1514)
szedan-rh 3032c73
feat(selection): add startup tier logging and dependency health check…
szedan-rh d183c5f
feat(selection): add tier label to Prometheus metrics and dependency …
szedan-rh 9353bc0
feat(config): replace flat algorithm list with structured tier catalo…
szedan-rh 8ba4d8e
feat(extproc): wire tier warnings and health checks into router start…
szedan-rh 015396a
feat(selection): populate Tier in SelectionResult (#1514)
szedan-rh 6245d4e
fix: eliminate empty tier labels in selection metrics recording
szedan-rh ba434d0
Merge branch 'main' into issues_1514
szedan-rh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/semantic-router/pkg/config/routing_surface_catalog_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| package config | ||
|
|
||
| import "testing" | ||
|
|
||
| func TestDecisionAlgorithmCatalog_AllTypesHaveTier(t *testing.T) { | ||
| catalog := DecisionAlgorithmCatalog() | ||
| if len(catalog) == 0 { | ||
| t.Fatal("DecisionAlgorithmCatalog() returned empty catalog") | ||
| } | ||
|
|
||
| for _, entry := range catalog { | ||
| if entry.Type == "" { | ||
| t.Error("Catalog entry has empty Type") | ||
| } | ||
| if entry.Tier != "supported" && entry.Tier != "experimental" { | ||
| t.Errorf("Catalog entry %q has invalid Tier %q", entry.Type, entry.Tier) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| func TestDecisionAlgorithmCatalog_BackwardsCompatible(t *testing.T) { | ||
| previousTypes := []string{ | ||
| "automix", "confidence", "elo", "gmtrouter", "hybrid", | ||
| "kmeans", "knn", "latency_aware", "ratings", "remom", | ||
| "rl_driven", "router_dc", "static", "svm", | ||
| } | ||
|
|
||
| for _, algType := range previousTypes { | ||
| if !IsSupportedDecisionAlgorithmType(algType) { | ||
| t.Errorf("Previously supported algorithm type %q is no longer supported", algType) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| func TestGetAlgorithmTier(t *testing.T) { | ||
| tests := []struct { | ||
| algType string | ||
| expectedTier string | ||
| }{ | ||
| {"static", "supported"}, | ||
| {"elo", "supported"}, | ||
| {"router_dc", "supported"}, | ||
| {"latency_aware", "supported"}, | ||
| {"hybrid", "supported"}, | ||
| {"automix", "experimental"}, | ||
| {"rl_driven", "experimental"}, | ||
| {"gmtrouter", "experimental"}, | ||
| {"knn", "experimental"}, | ||
| {"kmeans", "experimental"}, | ||
| {"svm", "experimental"}, | ||
| {"mlp", "experimental"}, | ||
| } | ||
|
|
||
| for _, tt := range tests { | ||
| t.Run(tt.algType, func(t *testing.T) { | ||
| tier := GetAlgorithmTier(tt.algType) | ||
| if tier != tt.expectedTier { | ||
| t.Errorf("GetAlgorithmTier(%q) = %q, want %q", tt.algType, tier, tt.expectedTier) | ||
| } | ||
| }) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.