-
Notifications
You must be signed in to change notification settings - Fork 99
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
HELP PLEASE noScribe on MacOs - Error in phase 2 speaker identification & PyAnnote #84
Comments
You are on the right track: Changing |
Hey @DanBigi, |
I was just reminded that this issue should have been solved in PyTorch 2.3, which is the version we use. Seems like it hasn't. However, we are now at PyTorch 2.4.1 so maybe this version solves it. I'll try to test it or compile a pre-release to check on that. |
I uploaded an new version with PyTorch 2.4.1 (noScribe 0.5.0b). Could you test, if this solves the issue, @DanBigi? |
Hello, thanks a lot for your very quick reply and for the support; from yesterday, I tried re-installing the noScribe package I already had since I had now installed rosetta 2 as well, but it didn't solve the issue, which means that I ran into the same MPS backend memory error after feeding the same first 30' of the interview, with "spanish", quality "precise", "auto" for the relevation of the speakers (I'm using this for fear of any cat's noise), and "overlapping speech" and "timestamps" opted in.
I have tried looking through the mentioned path (in my case, /Users/Daniele, and nice to meet both of you by the way) and I can't find the config.yml file, and there could be a problem here as well, I guess, because there is not a "Library" folder inside: the only "Library" folder I could find lies at the same level as the "Users" one, and when I look inside of it I do find an "Application Support" folder, which doesn't have a "noScribe" folder inside - I am attaching a screenshot to show you. To be sure, there is no "noScribe" folder in the "Library" nor in the "Daniele" folder, so I'm really at a loss for the config.yml file. I am specifying this in case it helps with troubleshooting for another (inexperienced and/or ignorant) MacOs user like me.
I'd be glad to do this, if only I knew where to modify the code..! I have no experience with Python; I have worked with LaTeX and R in the past, but they could be completely different languages and/or systems, so I don't know if my little experience can help. Just to be sure, what do you mean when you write "from source"? Is it a reference to the way noScribe can be executed through the installer, instead of opening its file from the "Application" folder? Coming to your last reply, @gernophil, I'm currently downloading the 0.5.0b version and I'll try the same file with the same specifications to see if it works, and I'll let you know by tomorrow afternoon at the latest; in the meantime, if there is any other thing that is within my capabilities and that could be useful for you, I'd be glad to help, especially considering your vey quick reply - thank you again for this, I really appreciate it :) ...and of course you're already cited in my thesis, I'll let you know if it will ever see the light :) |
Hey @DanBigi, I'll come back to you, if I am on my Mac again. |
That's great @gernophil, will definitely do :) Also thank you for the heads-up on the hidden folders: I think it was a Finder option in some older MacOS and couldn't find it on Sonoma, but thanks to you now I can see the famed "config.yml" file, yay! |
@kaixxx : not sure if your latest fixes also go for MAC installers, but it worked! 🥇 Here is what I now have in the config file that the tool autogenerates for me - no manual editing required:
|
No, your issue was different, only related to Windows. Still: Nice to hear that it works now! |
Yes, setting
If you received the EDIT: Oh, sorry, maybe I am a bit confused. Did you actually test noScribe on a Mac at all? |
The issue of @MonikaBarget was somewhat similar, but only related to Windows and CUDA: #79 (comment) |
In the meantime, yesterday night I tried out the noScribe 0.5.0b version and I ran into the same MPS backend memory error (same specification as above), and although the message says that the error was incurred into during the identification of the speakers, if one looks at noScribe working it actually happens during the next phase, the embeddings one, so I was wondering: should I modify the config.yml file now? Also, would it be possible to only move the "embeddings" process to the CPU, in order to leave the rest of the transcription on the MPS so as to lose less speed than moving the entire process on the CPU? |
Actually, this is something @kaixxx has to answer :). But I think we only can set cpu for the whole whisper and the whole pyannote step, but not for the sub steps individually. |
Yes, that's right. The "embedding" step is part of the speaker identification process with pyannote. So you must set |
Everyone, today's update: I have modified the config.yml file in order for pyannote to use the CPU instead of the MPS and noScribe now works, or at least it didn't run into the MPS memory error yet - the "embeddings" phase has gone beyond the percentages where it stopped in the previous days, and the notebook is more responsive than it was with the MPS on the rest of the things it does in the mean time; on the other hand, noScribe has become very slow, so slow that, after more than two hours, it still hasn't reached 50% of the embeddings. If there is no alternative to leaving the whole pyannote part to operate on the CPU to try out on a MacOs, I think I will leave it working for the next nights and let you know if I find any other way to speed up the process. Thanks a lot for the support until now, you've already been very very useful :) |
Good to know it works now. Unfortunately, this drastic speed difference is expected when switching from MPS to CPU. Same on windows, if you compare CUDA vs. CPU. This MPS out of memory error is really annoying, but unfortunately, this can only be solved by the PyTorch people. This only happens with 8GB RAM. It never happened on my 16GB machine. |
What you could try is setting the PYTORCH_MPS_HIGH_WATERMARK_RATIO before starting noScribe like this:
This comment suggests that the default is 1.4, so setting is between 1.5 and 2.0 should allow you to use more memory. As the comment says:
I never tried running an app with setting an environment variable before, but to my understanding it should work. |
Everyone, I hope you’ve been well the last few days. I have news: first of all, I modified the config.yml file in order for pyannote to use the CPU instead of the MPS and noScribe now works, or at least it didn't run into the MPS memory error yet - the "embeddings" phase has gone beyond the percentages where it stopped in the previous days, and the notebook is more responsive than it was with the MPS on the rest of the things it does in the mean time; on the other hand, noScribe has become very slow, so slow that, after more than two hours, it still hadn't reached 50% of the embeddings (always for the first 30’ of the same interview), so I stopped the transcription because I had other things to do. Next, I tried launching noScribe through the terminal by inputting the line:
Is there anything I should or can do, with respect to these messages from the Terminal? As always, thanks a lot for your support and have a wonderful day :) |
Don't worry about the warnings in your quote from the logfile, they are normal. What is you setting for |
Thanks for testing :). Maybe the easiest would be to delete the |
Something curious happened with the config.yml file: on Thursday I modified the file in order for pyannote to run on the CPU, then I ran it and it didn't stop but was very slow; before launching noScribe from the terminal I modified the file, setting pyannote back on the MPS, but as I was saying before noScribe continued being very slow, so I guess that the newly modified setting was not taken into consideration by Terminal and/or noScribe..? I don't know; this is what I was trying to mention in the last comment, but I wouldn't even know how to verify it. Lastly, I deleted the file and let noScribe create it anew: now config.yml reads "pyannote_gpu: MPS" and it does go as fast as it was in the first uses (it only took 40' to transcript the last 20' of the interview I was working on), so at least my problem should be solved now; please let me know if you could use the logs and/or any other experimentation on an M1 MacOS, I'd be glad to return the support :) |
This is really great that it works. @kaixxx, maybe we could make a paragraph in the readme to solve the memory issue. I wouldn't like to include the |
Great to hear that it works. Adding an advanced option for this in config.yml would be nice.
The question is when PyTorch is evaluating this environment variable, on import/initialization or at runtime. Would the following test make sense in MacOS? @DanBigi could perform it on his machine:
If it works, the environment variable will be evaluated on runtime, not during initialization. In this case, we could easily set this variable in code after reading config.yml. Otherwise, we would need to delay the import of PyTorch until config.yml is read, which would be possible but makes the code a little messier. |
I'd be glad to perform this test, how (where) do I set the global environment variable PYTORCH[...] to 2.0? In the mean time, I ran another transcription and I got the MPS backend memory error, so I'm thinking of trying the watermark at 0.0 to see what happens... I could do this and the test you mentioned by tomorrow afternoon, if you tell me how to do it, and tell you the results afterwards :) |
I don't think this will work. Can't think of a way to set an env variable, if the process is already running. |
You are probably right. So the only way would be to modify the code. It's quite simple to set an env variable via |
Good evening,
I have tried looking for a solution in previous discussions issues and threads, with no luck - it could also be that I'm ignorant and could not recognize the issue and/or the solution in different configurations, tbh; I'm using noScribe v.0.50 on a MacBook with 8GB RAM and Sonoma 14.1 (I also installed 'rosetta', while trying the advice found here and there), but when I try to feed noScribe with a .mp3 interview file, even only its first 20', I always get this error:
" PyAnnote error: MPS backend out of memory (MPS allocated: 5.71 GB, other allocations: 3.50 GB, max allowed: 9.07 GB). Tried to allocate 7.83 MB on private pool. Use PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0 to disable upper limit for memory allocations (may cause system failure).
Errore nella fase 2 - identificazione degli speaker. "
The last line should translate to "error in phase 2 - speaker identification"; to complete the specification I used, I am feeding an interview between two people (and possibly a cat), mode "precise", "auto" for the speakers' relevation, and with the overlapping speech and timestamps opted in. I guess these specifications are heavy for noScribe, but I can't really change them since I am working with interviews; I could definitely give it more time, but with this error noScribe stops so I can't feed it interviews over the night.
I had found in other threads the suggestion to change the configuration so that noScribe uses the cpu instead of the mps, but (1) I can't find the config.yml file for the life of me, and even worse (2) I'm not sure that the computer is not already using the cpu, since, when I keep the Task Manager open in order to check what's going on, I can see that although it doesn't start from zero it certainly does reach the 8GB it can work with... This last sentence may give an idea of my ignorance on the topic; I do nonetheless want to get my PhD sooner or later, so any help or guidance would be greatly appreciated! Thanks in advance!
The text was updated successfully, but these errors were encountered: