Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] PretokenizeRunner fails with streaming=True #441

Open
1 task done
keltin13 opened this issue Mar 5, 2025 · 0 comments · May be fixed by #442
Open
1 task done

[Bug Report] PretokenizeRunner fails with streaming=True #441

keltin13 opened this issue Mar 5, 2025 · 0 comments · May be fixed by #442

Comments

@keltin13
Copy link

keltin13 commented Mar 5, 2025

Describe the bug
PretokenizeRunner throws an error when streaming=True because num_proc is not a valid argument for an IterableDataset.

Code example
Adding the following test to tests/training/test_pretokenize_runner will raise an error:

def test_pretokenize_runner_streaming_dataset():
    cfg = PretokenizeRunnerConfig(
        tokenizer_name="gpt2",
        context_size=10,
        num_proc=2,
        dataset_path="NeelNanda/c4-10k",
        split="train",
        streaming=True,
    )
    dataset = PretokenizeRunner(cfg).run()
>       tokenized_dataset = dataset.map(
            process_examples,
            batched=True,
            batch_size=cfg.pretokenize_batch_size,
            num_proc=cfg.num_proc,
            remove_columns=dataset.column_names,
        )
E       TypeError: IterableDataset.map() got an unexpected keyword argument 'num_proc'

sae_lens/pretokenize_runner.py:102: TypeError

System Info
Describe the characteristic of your environment:

  • Installed SAELens from source, as described in CONTRIBUTING.md
  • MacOS
  • Python 3.10

Checklist

  • I have checked that there is no similar issue in the repo (required)
@keltin13 keltin13 changed the title [Bug Report] Bug title [Bug Report] PretokenizeRunner fails with streaming=True Mar 5, 2025
@keltin13 keltin13 linked a pull request Mar 5, 2025 that will close this issue
8 tasks
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 a pull request may close this issue.

1 participant