Repository navigation
fix(aggregation): Use squared distances for Krum scores - #835
Conversation
|
Could a maintainer add |
|
/opencode:Plan please review this. In particular:
|
|
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. |
|
|
@ValerianRey the authors' Krum repository points to AggregaThor. Its implementation computes squared distances and sums the closest In TorchJD, unsquared scoring was already present in the initial commit: |
Thanks for the confirmation, and thanks a lot for catching this. Seems like a bad mistake I've made since the first day of implementing this. I'll improve a bit the unit tests and merge this! |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.