question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UMAP segfault error

See original GitHub issue

I get the following error when running UMAP through Seurat (which uses UMAP)

UMAP(a=None, angular_rp_forest=False, b=None, init='spectral',
     learning_rate=1.0, local_connectivity=1, metric='correlation',
     metric_kwds=None, min_dist=0.3, n_components=2, n_epochs=None,
     n_neighbors=30, negative_sample_rate=5, random_state=None,
     repulsion_strength=1.0, set_op_mix_ratio=1.0, spread=1.0,
     target_metric='categorical', target_metric_kwds=None,
     target_n_neighbors=-1, target_weight=0.5, transform_queue_size=4.0,
     transform_seed=42, verbose=True)
Construct fuzzy simplicial set
Fri Jul 12 09:51:05 2019 Finding Nearest Neighbors
Fri Jul 12 09:51:05 2019 Building RP forest with 10 trees
/Users/asmaimran/Library/Python/3.7/lib/python/site-packages/umap/rp_tree.py:469: NumbaWarning: 
Compilation is falling back to object mode WITH looplifting enabled because Function "make_angular_tree" failed type inference due to: Cannot unify RandomProjectionTreeNode(array(int64, 1d, C), bool, none, none, none, none) and RandomProjectionTreeNode(none, bool, array(float32, 1d, C), none, RandomProjectionTreeNode(array(int64, 1d, C), bool, none, none, none, none), RandomProjectionTreeNode(array(int64, 1d, C), bool, none, none, none, none)) for '$14.16', defined at /Users/asmaimran/Library/Python/3.7/lib/python/site-packages/umap/rp_tree.py (476)

File "Library/Python/3.7/lib/python/site-packages/umap/rp_tree.py", line 476:
def make_angular_tree(data, indices, rng_state, leaf_size=30):
    <source elided>

        left_node = make_angular_tree(data, left_indices, rng_state, leaf_size)
        ^

[1] During: resolving callee type: recursive(type(CPUDispatcher(<function make_angular_tree at 0x1b264f440>)))
[2] During: typing of call at /Users/asmaimran/Library/Python/3.7/lib/python/site-packages/umap/rp_tree.py (476)


File "Library/Python/3.7/lib/python/site-packages/umap/rp_tree.py", line 476:
def make_angular_tree(data, indices, rng_state, leaf_size=30):
    <source elided>

        left_node = make_angular_tree(data, left_indices, rng_state, leaf_size)
        ^

  @numba.jit()
/Users/asmaimran/Library/Python/3.7/lib/python/site-packages/numba/compiler.py:725: NumbaWarning: Function "make_angular_tree" was compiled in object mode without forceobj=True.

File "Library/Python/3.7/lib/python/site-packages/umap/rp_tree.py", line 470:
@numba.jit()
def make_angular_tree(data, indices, rng_state, leaf_size=30):
^

  self.func_ir.loc))
/Users/asmaimran/Library/Python/3.7/lib/python/site-packages/numba/compiler.py:734: NumbaDeprecationWarning: 
Fall-back from the nopython compilation path to the object mode compilation path has been detected, this is deprecated behaviour.

For more information visit http://numba.pydata.org/numba-doc/latest/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit

File "Library/Python/3.7/lib/python/site-packages/umap/rp_tree.py", line 470:
@numba.jit()
def make_angular_tree(data, indices, rng_state, leaf_size=30):
^

  warnings.warn(errors.NumbaDeprecationWarning(msg, self.func_ir.loc))
Fri Jul 12 09:51:05 2019 NN descent for 13 iterations
/Users/asmaimran/Library/Python/3.7/lib/python/site-packages/umap/nndescent.py:92: NumbaPerformanceWarning: 
The keyword argument 'parallel=True' was specified but no transformation for parallel execution was possible.

To find out why, try turning on parallel diagnostics, see http://numba.pydata.org/numba-doc/latest/user/parallel.html#diagnostics for help.

File "Library/Python/3.7/lib/python/site-packages/umap/utils.py", line 409:
@numba.njit(parallel=True)
def build_candidates(current_graph, n_vertices, n_neighbors, max_candidates, rng_state):
^

  current_graph, n_vertices, n_neighbors, max_candidates, rng_state
/Users/asmaimran/Library/Python/3.7/lib/python/site-packages/numba/compiler.py:588: NumbaPerformanceWarning: 
The keyword argument 'parallel=True' was specified but no transformation for parallel execution was possible.

To find out why, try turning on parallel diagnostics, see http://numba.pydata.org/numba-doc/latest/user/parallel.html#diagnostics for help.

File "Library/Python/3.7/lib/python/site-packages/umap/nndescent.py", line 47:
    @numba.njit(parallel=True)
    def nn_descent(
    ^

  self.func_ir.loc))
	 0  /  13
	 1  /  13
	 2  /  13
Fri Jul 12 09:51:10 2019 Finished Nearest Neighbor Search

 *** caught segfault ***
address 0xfffffffffffffffa, cause 'memory not mapped'

Traceback:
 1: py_call_impl(callable, dots$args, dots$keywords)
 2: umap$fit_transform(as.matrix(x = object))
 3: RunUMAP.default(object = data.use, assay = assay, n.neighbors = n.neighbors,     n.components = n.components, metric = metric, n.epochs = n.epochs,     learning.rate = learning.rate, min.dist = min.dist, spread = spread,     set.op.mix.ratio = set.op.mix.ratio, local.connectivity = local.connectivity,     repulsion.strength = repulsion.strength, negative.sample.rate = negative.sample.rate,     a = a, b = b, seed.use = seed.use, metric.kwds = metric.kwds,     angular.rp.forest = angular.rp.forest, reduction.key = reduction.key,     verbose = verbose)
 4: RunUMAP(object = data.use, assay = assay, n.neighbors = n.neighbors,     n.components = n.components, metric = metric, n.epochs = n.epochs,     learning.rate = learning.rate, min.dist = min.dist, spread = spread,     set.op.mix.ratio = set.op.mix.ratio, local.connectivity = local.connectivity,     repulsion.strength = repulsion.strength, negative.sample.rate = negative.sample.rate,     a = a, b = b, seed.use = seed.use, metric.kwds = metric.kwds,     angular.rp.forest = angular.rp.forest, reduction.key = reduction.key,     verbose = verbose)
 5: RunUMAP.Seurat(object = visp, dims = 1:26, min_dist = 0.75)
 6: RunUMAP(object = visp, dims = 1:26, min_dist = 0.75)

I am running python3, installed UMAP using pip and running on MacOSX. Any ideas about what maybe happening?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
diazdccommented, Oct 11, 2019

Thanks for the speedy response everyone. Indeed, uwot was causing the problem, and was remedied by calling “umap-learn” as the preffered method. Here’s the command in context if anyone else stumbles into this problem: RunUMAP(seurat_obj, umap.method = "umap-learn", dims = 1:20)

0reactions
sleighsoftcommented, Oct 11, 2019

Seems like the inital question is solved with this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

UMAP Segmentation Faults · Issue #747 - GitHub
The weird thing is that the seg fault does not occur if I just run UMAP inside of a python terminal, it only...
Read more >
RunUMAP gives segmentation fault - Stack Overflow
I tried the following > my.exp <- RunUMAP(my.exp, dims = 1:30) UMAP(a=None, angular_rp_forest=False, b=None, init='spectral', ...
Read more >
numba/numba - Gitter
import numpy as np import umap data_dict = np.load('kmnist-train-imgs.npz') ... it's also strange that your segfault is not in the multithreaded section.
Read more >
Frequently Asked Questions — umap 0.5 documentation
UMAP is eating all my cores.​​ If run without a random seed UMAP will use numba's parallel implementation to do multithreaded work and...
Read more >
Segmentation fault (core dumped) (#1436) · Issues - graphviz
I am interested in displaying a graph genome using t-SNE or UMAP from vg output https://github.com/vgteam/vg . The vg suggested to use graphviz ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found