Skip to content

fix: don't expand an exact task name into its own subsets - #1487

Open
KhalidKhan541 wants to merge 1 commit into
huggingface:mainfrom
KhalidKhan541:fix/1024-exact-task-match
Open

KhalidKhan541 wants to merge 1 commit into
huggingface:mainfrom
KhalidKhan541:fix/1024-exact-task-match

Conversation

@KhalidKhan541

Copy link
Copy Markdown

What

Registry(tasks="boolq|0") loads both boolq and boolq:contrastset. The same happens for bbq, bold, imdb and lsat_qa: each is a registered task whose name is also the prefix of its own subsets.

Why

_expand_task_definition checks _task_superset_dict before considering that the requested name may itself be a task. _task_superset_dict groups tasks by the part before :, so boolq and boolq:contrastset land 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 over bbq, bold, boolq, imdb and lsat_qa, asserts each name loads only itself.
  • test_base_task_and_its_subset_are_not_duplicated asserts boolq|0,boolq:contrastset|0 loads each config exactly once.
  • The existing storycloze and mmlu superset 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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] LightevalTaskConfig doesn't support comparison, but Cache management uses sorted on it

1 participant