[SYSTEMDS-3922] Fix federated quantile VALUEPICK averaging for even-length input#2497
Open
MegaByteTron wants to merge 1 commit into
Open
Conversation
…ength input
The federated QuantilePickFEDInstruction only enabled the even-length
averaging branch for MEDIAN, while the CP reference path
(QuantilePickCPInstruction) applies the same averaging convention for
VALUEPICK by passing matBlock.getLength()%2==0 to MatrixBlock.pickValue.
As a result, quantile(A, p) on a federated matrix with an even row count
diverged from the CP reference (which compareResults(1e-9) rejects),
causing the federatedQuantile{1,2,3}{CP,SP} tests to fail. They were
previously marked @ignore to hide the failure.
Extend the average flag to also cover VALUEPICK so the federated path
mirrors the CP averaging contract. The existing guard
average = average && (... rows ...) % 2 == 0
keeps averaging disabled for odd-length input, matching CP. IQM is
intentionally excluded because it has its own interpolation path.
Un-ignore the six previously-disabled tests.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The federated
QuantilePickFEDInstructiononly enabled the even-lengthaveraging branch for
MEDIAN, while the CP reference path(
QuantilePickCPInstruction) applies the same averaging convention forVALUEPICKby passingmatBlock.getLength() % 2 == 0toMatrixBlock.pickValue.As a result,
quantile(A, p)on a federated matrix with an even rowcount diverged from the CP reference (which
compareResults(1e-9)rejects), causing the
federatedQuantile{1,2,3}{CP,SP}tests to fail.They were previously marked
@Ignoreto hide the failure.Change
averageflag inprocessRowQPickto also coverVALUEPICKso the federated path mirrors the CP averaging contract.The existing guard
IQMisintentionally excluded because it has its own interpolation path.
(
federatedQuantile{1,2,3}{CP,SP}) and drop the unusedorg.junit.Ignoreimport.Test plan
FederatedQuantileTest— all 12 tests pass locally (CP + SP),including the six previously-ignored ones.
federatedMedian{CP,SP},federatedIQR{CP,SP},federatedQuantiles{CP,SP}still pass —IQMandMEDIANpaths untouched.
Resolves https://issues.apache.org/jira/browse/SYSTEMDS-3922