Skip to content

fix(cache): stabilize solver task hashes - #1462

Open
jovial-liu wants to merge 1 commit into
huggingface:mainfrom
jovial-liu:fix/stable-solver-cache-hash
Open

jovial-liu wants to merge 1 commit into
huggingface:mainfrom
jovial-liu:fix/stable-solver-cache-hash

Conversation

@jovial-liu

Copy link
Copy Markdown

Task configs are hashed from LightevalTaskConfig.__str__(lite=True). Inspect solver pipelines are stored as lists of functions, whose default repr includes a process-specific address. As a result, the same task gets a different sample-cache hash in each process and cannot reuse cached samples across runs.

Represent solver callables using their module and qualified name, code, defaults, and captured values. Equivalent closures now produce the same hash, while different captured prompt text still produces a different hash.

Related to the cross-run cache observation in #1291.

Validation:

  • pytest tests/unit/tasks/test_registry.py -q — 9 passed
  • ruff check and ruff format --check on the two changed files — passed
  • git diff --check — passed

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.

1 participant