-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Issue with unordered_map in remap.pyx scikit-image 0.17.2 #5232
Comments
Wow. All I can say is that I would not put it past pytorch to redefine C++ stdlib linkage at import time. Overall, my feeling is that if: from skimage.util import map_array works, but import torchvision.datasets as datasets
import torchvision.models as models
import torchvision.transforms as transforms
import smdistributed.modelparallel.torch as smp
from skimage.util import map_array fails, then the issue is a pytorch issue and not a scikit-image issue... Could you check that for us, @anirudh2290? |
Thank you @jni for your reply! We observe the following:
Below fails with the error i pasted above:
Below works fine:
|
Wow, that's insane. LOL To clarify, does from torchvision import datasets, models, transforms
from skimage.util import map_array fail by itself? Or do you need the third line? I have no insight whatsoever into how the |
Hi @jni . To clarify below is the stacktrace that we see :
The unordered_map in "#8" (operator[] call) comes from a cc file in smdistributed when python tries to execute a smp.step decorated function. So without smdistributed import we cannot reproduce the issue (though potentially this may be happening with other python libraries with cpp backend (using unordered_map) too). As you mentioned, could it be that the torch import causes the remap.pyx to link with an incompatible stdlib causing this issue? |
Sorry, can you point me to where the
I kinda thought so, but I have no insight as to why putting smp in the middle would fix it, nor why it would crash when smp is imported after... By the way, is any of this code actually calling skimage code? Or is it really just an import? |
SMP (Sagemaker Distributed Model Parallel) is closed source, so I wont be able to share the source, but it doesn't depend on skimage. Its just that the import of the skimage "in between" breaks the unordered_map operator[] call inside smdistributed. |
Thanks a lot @jni for the help and inputs. Since I am unable to provide more information to help with the issue here, I am going to close the issue. |
🙏 I hope the discussion was somehow useful in helping you move forward at least... If you do figure out something we can do differently to prevent it, we'd be happy to consider it, but for now I don't see anything we're doing obviously wrong to cause this... Sorry we couldn't get to the bottom of it. |
Description
We found an issue with working of Sagemaker Distributed Model Parallel with scikit image 0.17.2 on python3.6.
To provide more details on the crash, we see that unordered_map indexing in Sagemaker Distributed Model Parallel code (smdistributed/modelparallel/backend/threads.cc) calls into
Our workaround was to downgrade skimage to 0.16.0 or change the import order.
Below is the import order with the issue:
below is the import order without the issue:
scikit-image is a dependency of albumentations package.
Would appreciate any insights on the issue.
The text was updated successfully, but these errors were encountered: