Skip to content

Add LinearUnderScalingProperty#255

Merged
ValerianRey merged 7 commits intomainfrom
add_LUS_property_tester
Mar 22, 2025
Merged

Add LinearUnderScalingProperty#255
ValerianRey merged 7 commits intomainfrom
add_LUS_property_tester

Conversation

@PierreQuinton
Copy link
Copy Markdown
Contributor

@PierreQuinton PierreQuinton commented Feb 22, 2025

  • Add LinearUnderScalingProperty
  • Make all non-random LUS aggregator testers extend LinearUnderScalingProperty

I think that the code is self explanatory, we could if needed add a docstring to explain what this tests, but this is rather directly the LUS property. Note that Config seems to fail it, we need to investigate why (and on what matrices).

Note that UPGrad is not too good at this test, and it is the aggregator that pushed the atol to 0.008, this is probably due to linear approx.

@PierreQuinton PierreQuinton added cc: test Conventional commit type for changes to tests. package: aggregation labels Feb 22, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@PierreQuinton PierreQuinton added cc: chore Conventional commit type for changes to some configuration files of the project. and removed cc: chore Conventional commit type for changes to some configuration files of the project. labels Feb 23, 2025
@ValerianRey ValerianRey force-pushed the add_LUS_property_tester branch from 61dc5e2 to 1db3093 Compare March 20, 2025 13:09
pre-commit-ci bot and others added 2 commits March 20, 2025 13:12
- With the new way we generate matrices, this test seems to pass.
@ValerianRey
Copy link
Copy Markdown
Contributor

I rebased your commits onto main (with the new input matrix generation). I chose to test LUS property on strong stationary matrices + matrices.

Now, ConFIG passes the LUS tests, so I added its property back in the documentation and I readded its LUS test. Are there special cases where ConFIG is not LUS in theory? @PierreQuinton

@ValerianRey
Copy link
Copy Markdown
Contributor

ValerianRey commented Mar 20, 2025

Currently we use the following inputs:

  • ExpectedStructureProperty: scaled_matrices + zero_matrices
  • NonConflictingProperty: weak_stationary_matrices + matrices
  • PermutationInvarianceProperty: matrices
  • LinearUnderScalingProperty: strong_stationary_matrices + matrices

This is very confusing. In reality, the only "problematic" matrices are the scaled matrices. They make the NonConflictingProperty, PermutationInvarianceProperty and LinearUnderScalingProperty fail for most aggregators. But we could have:

  • ExpectedStructureProperty: scaled_matrices + M
  • NonConflictingProperty: M
  • PermutationInvarianceProperty: M
  • LinearUnderScalingProperty: M

with M = matrices + zero_matrices + weak_stationary_matrices + strong_stationary_matrices.
With this, all tests pass and coverage increases.

Of course, names could be improved. This could also come in another PR.

@ValerianRey ValerianRey changed the title Add linear under scaling property tester Add LinearUnderScalingProperty Mar 20, 2025
@ValerianRey
Copy link
Copy Markdown
Contributor

There's something that is a bit weird in my opinion. For the PermutationInvarianceProperty, we do not test random aggregators, and therefore we do not have to reset any seed during its operations. For LinearUnderScalingProperty, we do test random aggregators and reset the seed in the middle of operations. I think we should either do one or the other.

I think we can consider random aggregators to be some kind of stateful aggregators whose state (the current random state) is held globally. I think we could improve our support for those aggregators in the future without touching the global state (messing with the torch seed) in the property testers. So IMO we should:

  • Remove LinearUnderScalingProperty from RGW and PCGrad testers.
  • Remove all lines related to storing and setting the seed in LinearUnderScalingProperty.

- Remove seed resetting
- Remove LinearUnderScalingProperty from TestPCGrad and TestRGW
@ValerianRey ValerianRey merged commit 4b97b96 into main Mar 22, 2025
14 checks passed
@ValerianRey ValerianRey deleted the add_LUS_property_tester branch March 22, 2025 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cc: test Conventional commit type for changes to tests. package: aggregation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants