-
Notifications
You must be signed in to change notification settings - Fork 148
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
Make caching location optional. #546
Comments
Ah, you have a point there. Would it be enough to use the official temp root of your operating system (say, If not, what's your use case so we may better understand? |
Hi @knighton. Thanks for your reply! I have tried to modified |
Hi @knighton. After modifying both |
Hi there! I also found another closed issue: #429 is the same issue I met here. But it seems not being solved. |
I think you've fully gotten it (which is further supported by it running successfully), and also you are perfectly safe in making those changes you mentioned. Probably wise to have asked, as StreamingDataset has grown a bit complicated... As you probably noticed, the temp root path in stream.py only comes into play when you do not provide
Leftover shared memory between runs that you have to clean up yourself is unfortunately something that happens when Python processes using shared memory die badly. We have gradually improved on this front over time, but it's far from solved completely. In the meantime, you can manually clear any stale shared memory objects by calling this method: https://github.com/mosaicml/streaming/blob/main/streaming/base/util.py#L169 If you meant you are already calling that method and encountering that permissions problem, that is all relating to the fact that Streaming was originally built to be run on ephemeral training jobs as root. On startup, StreamingDataset replicas do some registration and safety checks to prevent different runs clobbering the same dirs. Unfortunately, this was built for a world where everyone can write files to shared memory and these files can be read back by anyone. As the original author of that difficult piece of nonsense, let me tell you that combined with patching filelock root, I think if you simply disable the checks and are just very careful about concurrent training jobs (and zombie processes thereof), you will be able to run this as non-root just fine. |
Specifically, you could remove this bit of code: streaming/streaming/base/dataset.py Lines 509 to 514 in cb8e872
And replace it with something like
If on Mac OSX, shmem paths need to be quite short. I believe Linux and the like are not so limited. |
Hi @Skylion007. Thanks for your reply. Now I can execute without shared memory permission denied issue that mentioned above by changing the constant names directly.. (for example: Add some ID to all the constants, like And thanks for the advice to remove code. I will try it. |
Is your
You are clear. |
For these path modification: Yes. My path is readable and writeable, and I can change the permission by As for |
Thanks for your great work!
Could this saving cache path be optional instead of always writes into
/tmp/streaming
?streaming/streaming/base/dataset.py
Line 515 in cb8e872
The text was updated successfully, but these errors were encountered: