-
Notifications
You must be signed in to change notification settings - Fork 828
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
Memory leak is observed when using the AutoTokenizer
and AutoModel
with Python 3.10.*
#1706
Comments
Hey which version of |
Dear Arthur,
Thank you for getting back to me. My current version of the tokenizers
library is *0.20.3*.
Additionally, I want to share the results obtained when running my code and
measuring it using the memray library (Memray Documentation
<https://bloomberg.github.io/memray/index.html>) to check for potential
memory leaks.
Please let me know if you need any further details.
…On Thu, Jan 2, 2025 at 11:25 PM Arthur ***@***.***> wrote:
Hey which version of tokenizers are you using ? 🤗
—
Reply to this email directly, view it on GitHub
<#1706 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUI3Z7B7M7LMMHFHRBA35OL2IVSBNAVCNFSM6AAAAABUIJCDGOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNRYGAZTONJXGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hi we cannot reproduce the leak you are mentioning. You are not even mentioning what kind of leak you're referring suggest CPU RAM leaks, but you're putting all your tensors on GPU. Please, try and clarify very clearly what's the problem you've identified. Make sure it's not your profiling code that's "leaking" (for instance by just measuring RAM usages without any sort of profiling). |
Memory Leak Issue with
|
System Info
A memory leak is observed when using the
AutoTokenizer
andAutoModel
class with Python version3.10.*
. The same code does not exhibit the memory leak issue when running on Python3.8.11
. The issue may arise due to differences in how Python3.10.*
handles memory allocation, deallocation, or compatibility with the libraries used.Setup:
Environment:
3.8.11
(No memory leak observed)3.10.*
(Memory leak occurs)Dependencies:
tokenizers==0.20.3
torch==2.0.1+cu117
torchvision==0.15.2+cu117
tqdm==4.67.0
transformers==4.46.0
Attempts to Resolve:
We tried various strategies to address the memory leak, but none were successful. These include:
gc.collect()
to manually invoke garbage collection after each batch.del
to release memory.torch.cuda.empty_cache()
to free up GPU memory.Tried multiple versions of tokenizers and transformers libraries but observed no improvement.
Despite these efforts, the memory leak persisted in Python
3.10.*
.Call for Assistance: We have exhausted our efforts to identify and resolve the memory leak issue. If anyone with expertise in Python memory management, PyTorch, or Hugging Face Transformers can assist, we would greatly appreciate your help
Who can help?
@ArthurZucker
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
Logs
Expected behavior
No memory leaks occur on Python 3.10.*.
The text was updated successfully, but these errors were encountered: