[mlpack-git] [mlpack/mlpack] LSHSearch Parallelization (#700)

Yannis Mentekidis notifications at github.com
Fri Jul 8 06:25:51 EDT 2016


> @@ -811,9 +841,18 @@ void LSHSearch<SortPolicy>::Search(const arma::mat& querySet,
>  
>    Timer::Start("computing_neighbors");
>  
> -  // Go through every query point sequentially.
> -  for (size_t i = 0; i < querySet.n_cols; i++)
> +  // Parallelization to process more than one query at a time.
> +  // use as many threads possible but not more than allowed number
> +  size_t numThreadsUsed = maxThreads;
> +  #pragma omp parallel for \
> +    num_threads ( numThreadsUsed )\
> +    shared(avgIndicesReturned, resultingNeighbors, distances) \
> +    schedule(dynamic)

About static vs dynamic scheduling, I ran some tests:

Sift100k
```
dynamic: 0.086 +/- 0.008 s
 static: 0.093 +/- 0.014 s
```

phy
```
dynamic: 3.35 +/- 0.124 s
 static: 3.46 +/- 0.203 s
```

Corel
```
dynamic: 0.228 +/- 0.03 s
 static: 0.234 +/- 0.03 s
```

Miniboone
```
dynamic: 0.711 +/- 0.07 s
 static: 0.701 +/- 0.09 s
```

In the first 3, I'd say dynamic is slightly faster. It's hard to tell for Miniboone because the standard deviation is much larger than the difference. I'll run covertype and pokerhand in a while when my PC is not used.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/700/files/c4c8ff950be8a06e06084764f188095c650b7a60#r70054603
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160708/ace9a9c1/attachment.html>


More information about the mlpack-git mailing list