Fix flaky ReproUtilTest by adding fallback lookup for trainers#425
Open
lbh930 wants to merge 2 commits intooracle:mainfrom
Open
Fix flaky ReproUtilTest by adding fallback lookup for trainers#425lbh930 wants to merge 2 commits intooracle:mainfrom
lbh930 wants to merge 2 commits intooracle:mainfrom
Conversation
Member
|
I think I'd prefer to try and fix this in OLCUT (which is also maintained by our group), but that's lower down on the list of priorities. I'll look into it in the new year. |
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.
Description
Modified ReproUtil.recoverTrainer to include a fallback when looking up trainer components. If lookup by name fails due to mismatched component names, it now attempts to look up the component by its class type. It sorts the candidate components by their numeric suffix to ensure deterministic mapping between the provenance and configuration list.
Motivation
NonDex detected test flakiness in:
org.tribuo.reproducibility.ReproUtilTest.reproduceTransformTrainerorg.tribuo.reproducibility.ReproUtilTest#testBaggingTrainerorg.tribuo.reproducibility.ReproUtilTest.testBaggingTrainerAllInvocationsChangeOne of the cause is possibly the non-deterministic component naming in OLCUT. ProvenanceUtil generates component names like logisticregressiontrainer-1 vs logisticregressiontrainer-2 based on iteration order, which relies on HashMap/HashSet and has no guarantee in determinism. The PR allow ReproUtil to recover the trainer based on its type when the name lookup fails and enforces a strict sorting order to guarantee the correct component is selected. This should improve robustness of those tests. An example of NonDex output attached.
NonDex_ReproUtilTests.txt