Skip to content

Comments

Fix multithreaded concurrency test to use shared tokenizer instance#1950

Open
mrkm4ntr wants to merge 1 commit intohuggingface:mainfrom
mrkm4ntr:fix-multithread-concurrency-test
Open

Fix multithreaded concurrency test to use shared tokenizer instance#1950
mrkm4ntr wants to merge 1 commit intohuggingface:mainfrom
mrkm4ntr:fix-multithread-concurrency-test

Conversation

@mrkm4ntr
Copy link

Summary

This PR fixes the test_multithreaded_concurrency test to properly verify thread safety by using a shared
tokenizer instance across multiple threads, rather than creating separate instances per thread.

Problem

The existing test in commit 6eba494a (#1864) was designed to test thread safety, but it created a new
Tokenizer(BPE()) instance within each worker function. This meant each thread was using its own tokenizer,
which doesn't test the actual scenario where multiple threads access the same tokenizer instance.

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