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
Questions about problems in ingest related to pynndescent #133
Comments
For more information, you can take a look athttps://github.com/scverse/scanpy/issues/1951 |
This is an issue with numba caching having issues saving / loading compiled versions of functions. Are you running on colab by any chance? I cannot reproduce this issue except on colab, so if you have a specific system where you can reproduce it that would be good to know. This can be worked around (albiet strangely). See issue #131 |
This happens on colab. I can provide you me setting plan: absl-py 0.12.0 |
running into the same issue on jupyter notebook in aws sagemaker |
I wish I had better answers, but this very much seems to be an issue with cloud services, and how they actually back their "local" storage which is used for caching numba compiled functions. I would strongly suggest you take this a little further upstream: wither with the cloud providers, or with the numba team, or both, since this is definitely beyond my expertise. |
If you make a directory in e.g. |
Emm, I use this sentence to change the cache dir: Could you please be more specific? What should I do to change NUMBA_CACHE_DIR=/tmp/numba_cache? Thanks |
This issue is not about the IPython cache but about numba's cache. Messing with the Ipython cache is probably something you want to avoid.
|
|
Is this the code you use on COLAB or did you make a typo when copying it here? import os
os.environ["NUMBA_CACHE_DIR"] = "/..." If you did actually write |
Ok, thanks.
获取 Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
发件人: Hannes Pahl ***@***.***>
发送时间: Friday, August 6, 2021 7:43:14 PM
收件人: lmcinnes/pynndescent ***@***.***>
抄送: Liu, Tianyu ***@***.***>; Author ***@***.***>
主题: Re: [lmcinnes/pynndescent] Questions about problems in ingest related to pynndescent (#133)
Emm if I use os.environ = '/content/tmp/numba_cache', it seems that it takes more time for me to load the normal packages. Is there any better solution?
Is this the code you use on COLAB or did you make a typo when copying it here?
It should be
import os
os.environ["NUMBA_CACHE_DIR"] = "/..."
If you did actually write os.environ = ..., then I would expect that the python interpreter session crashes, or is at least very compromised.
―
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#133 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AKKTOY6C7EHKA2IKXINHASDT3PDFFANCNFSM5A5COJZQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>.
|
Sorry to disturb, but it seems that the ingest method in scanpy meets some problems caused by pynndescent and numba. Here are the details:
KeyError Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/numba/core/caching.py in save(self, key, data)
486 # If key already exists, we will overwrite the file
--> 487 data_name = overloads[key]
488 except KeyError:
KeyError: ((array(int32, 1d, C), array(int32, 1d, C), array(float32, 1d, C), array(float32, 2d, C), type(CPUDispatcher(<function squared_euclidean at 0x7fdefdb13830>)), array(int64, 1d, C), float64), ('x86_64-unknown-linux-gnu', 'broadwell', '+64bit,+adx,+aes,+avx,+avx2,-avx512bf16,-avx512bitalg,-avx512bw,-avx512cd,-avx512dq,-avx512er,-avx512f,-avx512ifma,-avx512pf,-avx512vbmi,-avx512vbmi2,-avx512vl,-avx512vnni,-avx512vpopcntdq,+bmi,+bmi2,-cldemote,-clflushopt,-clwb,-clzero,+cmov,+cx16,+cx8,-enqcmd,+f16c,+fma,-fma4,+fsgsbase,+fxsr,-gfni,+invpcid,-lwp,+lzcnt,+mmx,+movbe,-movdir64b,-movdiri,-mwaitx,+pclmul,-pconfig,-pku,+popcnt,-prefetchwt1,+prfchw,-ptwrite,-rdpid,+rdrnd,+rdseed,+rtm,+sahf,-sgx,-sha,-shstk,+sse,+sse2,+sse3,+sse4.1,+sse4.2,-sse4a,+ssse3,-tbm,-vaes,-vpclmulqdq,-waitpkg,-wbnoinvd,-xop,+xsave,-xsavec,+xsaveopt,-xsaves'), ('308c49885ad3c35a475c360e21af1359caa88c78eb495fa0f5e8c6676ae5019e', 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'))
During handling of the above exception, another exception occurred:
TypeError Traceback (most recent call last)
13 frames
in ()
----> 1 sc.tl.ingest(adata, adata_ref, obs='louvain') #ingest
/usr/local/lib/python3.7/dist-packages/scanpy/tools/_ingest.py in ingest(adata, adata_ref, obs, embedding_method, labeling_method, neighbors_key, inplace, **kwargs)
131
132 if obs is not None:
--> 133 ing.neighbors(**kwargs)
134 for i, col in enumerate(obs):
135 ing.map_labels(col, labeling_method[i])
/usr/local/lib/python3.7/dist-packages/scanpy/tools/_ingest.py in neighbors(self, k, queue_size, epsilon, random_state)
469 self._nnd_idx.search_rng_state = rng_state
470
--> 471 self._indices, self._distances = self._nnd_idx.query(test, k, epsilon)
472
473 else:
/usr/local/lib/python3.7/dist-packages/pynndescent/pynndescent_.py in query(self, query_data, k, epsilon)
1564 """
1565 if not hasattr(self, "_search_graph"):
-> 1566 self._init_search_graph()
1567
1568 if not self._is_sparse:
/usr/local/lib/python3.7/dist-packages/pynndescent/pynndescent_.py in _init_search_graph(self)
1061 self._distance_func,
1062 self.rng_state,
-> 1063 self.diversify_prob,
1064 )
1065 reverse_graph.eliminate_zeros()
/usr/local/lib/python3.7/dist-packages/numba/core/dispatcher.py in _compile_for_args(self, *args, **kws)
432 e.patch_message('\n'.join((str(e).rstrip(), help_msg)))
433 # ignore the FULL_TRACEBACKS config, this needs reporting!
--> 434 raise e
435
436 def inspect_llvm(self, signature=None):
/usr/local/lib/python3.7/dist-packages/numba/core/dispatcher.py in _compile_for_args(self, *args, **kws)
365 argtypes.append(self.typeof_pyval(a))
366 try:
--> 367 return self.compile(tuple(argtypes))
368 except errors.ForceLiteralArg as e:
369 # Received request for compiler re-entry with the list of arguments
/usr/local/lib/python3.7/dist-packages/numba/core/compiler_lock.py in _acquire_compile_lock(*args, **kwargs)
30 def _acquire_compile_lock(*args, **kwargs):
31 with self:
---> 32 return func(*args, **kwargs)
33 return _acquire_compile_lock
34
/usr/local/lib/python3.7/dist-packages/numba/core/dispatcher.py in compile(self, sig)
823 raise e.bind_fold_arguments(folded)
824 self.add_overload(cres)
--> 825 self._cache.save_overload(sig, cres)
826 return cres.entry_point
827
/usr/local/lib/python3.7/dist-packages/numba/core/caching.py in save_overload(self, sig, data)
669 """
670 with self._guard_against_spurious_io_errors():
--> 671 self._save_overload(sig, data)
672
673 def _save_overload(self, sig, data):
/usr/local/lib/python3.7/dist-packages/numba/core/caching.py in _save_overload(self, sig, data)
679 key = self._index_key(sig, _get_codegen(data))
680 data = self._impl.reduce(data)
--> 681 self._cache_file.save(key, data)
682
683 @contextlib.contextmanager
/usr/local/lib/python3.7/dist-packages/numba/core/caching.py in save(self, key, data)
494 break
495 overloads[key] = data_name
--> 496 self._save_index(overloads)
497 self._save_data(data_name, data)
498
/usr/local/lib/python3.7/dist-packages/numba/core/caching.py in _save_index(self, overloads)
540 def _save_index(self, overloads):
541 data = self._source_stamp, overloads
--> 542 data = self._dump(data)
543 with self._open_for_write(self._index_path) as f:
544 pickle.dump(self._version, f, protocol=-1)
/usr/local/lib/python3.7/dist-packages/numba/core/caching.py in _dump(self, obj)
568
569 def _dump(self, obj):
--> 570 return pickle.dumps(obj, protocol=-1)
571
572 @contextlib.contextmanager
TypeError: can't pickle weakref objects
How to solve this problem? Thanks.
The code comes from :https://scanpy-tutorials.readthedocs.io/en/latest/integrating-data-using-ingest.html
The text was updated successfully, but these errors were encountered: