You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(aggregation): Use squared distances for Krum scores - #835
Krum currently sums Euclidean distances, but the paper defines scores using squared Euclidean distances. The rankings can differ: with rows [[3,0],[0,7],[2,5],[5,0],[6,7]] and n_byzantine=1, Krum selects [3,0] instead of [2,5].
Remove the square root while retaining the roundoff clamp. Add regressions for Krum, Multi-Krum, selection boundaries, and an autograd/SGD step through both Gramian computation modes.
Validated the full CPU unit suite, focused float32/float64 aggregation and autograd tests, Ruff, full type checking, and wheel/sdist contents plus wheel-import smoke tests. The unit suite retains its existing skips and expected failures; CUDA and the full CI matrix were not run locally.
APIError: This API key has expired. Create a new API key in OpenCode Console and replace it in your client or secret store. Signing in again will not renew this key.
APIError: This API key has expired. Create a new API key in OpenCode Console and replace it in your client or secret store. Signing in again will not renew this key.
In TorchJD, unsquared scoring was already present in the initial commit: torch.cdist followed by a sum. It predates the later refactors and clamp change. Squaring preserves each row's nearest-neighbor order, but can change which row has the lowest total score, as the PR's regression demonstrates.
This branch has not been deployed
No deployments
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
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.
Krum currently sums Euclidean distances, but the paper defines scores using squared Euclidean distances. The rankings can differ: with rows
[[3,0],[0,7],[2,5],[5,0],[6,7]]andn_byzantine=1, Krum selects[3,0]instead of[2,5].Remove the square root while retaining the roundoff clamp. Add regressions for Krum, Multi-Krum, selection boundaries, and an autograd/SGD step through both Gramian computation modes.
Validated the full CPU unit suite, focused float32/float64 aggregation and autograd tests, Ruff, full type checking, and wheel/sdist contents plus wheel-import smoke tests. The unit suite retains its existing skips and expected failures; CUDA and the full CI matrix were not run locally.