patrick-kidger / patrick-kidger/jaxtyping

dataset.map(jaxtyped_function, fn_kwargs={"model": model}) will be very slow.

Open
#375 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.9k
Forks
96
PR merge metrics
No merged PRs in 30d

Description

dataset is Dataset from datasets

if we use @jaxtyped(typechecker=typechecker where typechecker is beartype, we need to press CTRL+C and get this error. Without this, the iteration will not start.

warnings.warn( ^CParameter 'function'=<function generate_entity_description_with_patching at 0x7740e09aa4d0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the call to Dataset.map with a jaxtyped function using beartype and fn_kwargs, then inspect datasets.arrow_dataset.Dataset._map_single and the emitted hashing warning. Compare behavior with and without the decorator; done means the iteration starts normally and dataset fingerprinting and caching no longer trigger the reported interruption or excessive delay.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
performance, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.