Skip to content
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

Fix snap_to_nearest on non-numeric parameters #221

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

stijnh
Copy link
Member

@stijnh stijnh commented Oct 12, 2023

Nearly all strategies (except brute-force) use snap=True which uses snap_to_nearest_config to find the nearest configuration. Unfortunately, this function does not work well with non-numeric parameters (like strings) since it calculates a distance.

This PR fixes this by first checking if there is an exact match for each parameter before attempting to calculate the distance.

After PR, it will be possible to use some of the strategies when dealing with non-numeric parameters.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@stijnh
Copy link
Member Author

stijnh commented Oct 12, 2023

LGTM!

@stijnh stijnh merged commit 97ed8ca into KernelTuner:master Oct 12, 2023
4 checks passed
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