Skip to content

[SYSTEMDS-3922] Fix federated quantile VALUEPICK averaging for even-length input#2497

Open
MegaByteTron wants to merge 1 commit into
apache:mainfrom
MegaByteTron:SYSTEMDS-3922-federated-quantile-valuepick
Open

[SYSTEMDS-3922] Fix federated quantile VALUEPICK averaging for even-length input#2497
MegaByteTron wants to merge 1 commit into
apache:mainfrom
MegaByteTron:SYSTEMDS-3922-federated-quantile-valuepick

Conversation

@MegaByteTron

Copy link
Copy Markdown

Summary

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.

Change

  • Extend the average flag in processRowQPick 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
    (federatedQuantile{1,2,3}{CP,SP}) and drop the unused
    org.junit.Ignore import.

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 — IQM and MEDIAN
    paths untouched.

Resolves https://issues.apache.org/jira/browse/SYSTEMDS-3922

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

1 participant