Repository navigation
fix: don't expand an exact task name into its own subsets - #1487
Open
KhalidKhan541 wants to merge 1 commit into
Open
KhalidKhan541 wants to merge 1 commit into
KhalidKhan541 wants to merge 1 commit into
Conversation
boolq, bbq, bold, imdb and lsat_qa are each both a registered task and the prefix of their own subsets. `_expand_task_definition` consulted the superset map first, so `boolq|0` also loaded `boolq:contrastset`, and asking for both loaded the subset twice. Return the exact task when its name is registered and only fall back to superset expansion otherwise. Genuine supersets such as storycloze and mmlu keep expanding.
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.
What
Registry(tasks="boolq|0")loads bothboolqandboolq:contrastset. The same happens forbbq,bold,imdbandlsat_qa: each is a registered task whose name is also the prefix of its own subsets.Why
_expand_task_definitionchecks_task_superset_dictbefore considering that the requested name may itself be a task._task_superset_dictgroups tasks by the part before:, soboolqandboolq:contrastsetland in the same group - and the group includes the base task. Requesting the base task therefore expands to base + subsets, and requesting both explicitly appends the subset twice, which is what the cache was previously sorting.Fix
Return the requested name unchanged when it is a registered task, and only fall back to superset expansion when it is not. Genuine supersets (
storycloze,mmlu, ...) are not registered under the prefix name, so they keep expanding exactly as before.This keeps public task names stable. The alternative discussed in #1024 - renaming the base tasks to
X:default- also fixes it but changes names users already refer to. Happy to switch if maintainers prefer that route.Tests
test_exact_task_name_is_not_expanded_into_its_subsets, parametrized overbbq,bold,boolq,imdbandlsat_qa, asserts each name loads only itself.test_base_task_and_its_subset_are_not_duplicatedassertsboolq|0,boolq:contrastset|0loads each config exactly once.storyclozeandmmlusuperset tests are unchanged.I could not run the suite locally on Windows because the repository contains fixture paths that are invalid on NTFS (
tests/reference_details/...:...|...parquet), so the tests have not been executed here; the change is confined to the branch selection in_expand_task_definition.Fixes #1024