Skip to content
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

Bad multithreading? #175

Closed
juangea opened this issue Aug 9, 2018 · 11 comments · Fixed by #778
Closed

Bad multithreading? #175

juangea opened this issue Aug 9, 2018 · 11 comments · Fixed by #778

Comments

@juangea
Copy link

juangea commented Aug 9, 2018

Hi there.

I just downloaded the binaries and I´m trying them with a small project I did recently with RC.

The first thing I noticed was that it was slower than RC; but then I checked out the CPU usage and it was between 2% and 10%, I have 16 threads with 8 cores (i7-5960x).

Is this a bug or is it normal because it depends on the complexity of the reconstruction?

Cheers!

@stale stale bot added the stale for issues that becomes stale (no solution) label Aug 25, 2019
@stale stale bot closed this as completed Sep 1, 2019
@natowi natowi reopened this Nov 10, 2019
@stale stale bot removed the stale for issues that becomes stale (no solution) label Nov 10, 2019
@natowi
Copy link
Member

natowi commented Nov 10, 2019

I am also interested in this. Having access to a computer with a 48 core cpu I noticed that Meshroom is not faster compared to my i7. Since Meshroom can be run on a renderfarm where multiple node threads are computed in parallel, it would be a huge speed up to allow multi-thread processing on a desktop computer. At the moment the node threads are computed one at a time on all cores with low cpu usage.

@alicevision alicevision deleted a comment from stale bot Nov 10, 2019
@alicevision alicevision deleted a comment from stale bot Nov 10, 2019
@fabiencastan
Copy link
Member

Which node are you talking about?

@natowi
Copy link
Member

natowi commented Nov 10, 2019

Is it possible to run the Chunks in the FeatureExtraction, FeatureMatching, PrepareDenseScene, DepthMap, DepthMapFilter nodes in parallel? At the moment they run 0->x.

chunks

Also multiple graphs can not be run in parallel...
par

@fabiencastan
Copy link
Member

fabiencastan commented Nov 10, 2019

Each node has internal multi-threading and checks the amount of RAM available to estimate how many threads can be used within the RAM limits.

If you run multiple chunks in parallel, it will start to swap and then probably crash.

@natowi
Copy link
Member

natowi commented Nov 10, 2019

Is there a way to check how many threads are used? I can run a test on the 48 core machine with and 512GB ram tomorrow. Last time computation was not faster compared to my i7 machine with 32ram.

@fabiencastan
Copy link
Member

Oh yes, on very large computers like that, the chunks are probably too small and it could make sense to change them or compute multiple ones in parallel.

@natowi
Copy link
Member

natowi commented Nov 10, 2019

Would it be possible to add an option to manually enable parallel computation in the future?

@fabiencastan
Copy link
Member

yes but how to estimate how many of them can be computed in parallel... as the memory requirements are very specific to each node.

@natowi
Copy link
Member

natowi commented Nov 10, 2019

The memory requirements can be guessed by trial and error.
This is not so different from the "red bar error" people get on low spec machines, they also need to adjust the settings to match their hardware. There could be an "chunk multi thread number" range slider in the advanced settings.

Once we have this option we could collect test data from demo datasets to estimate the memory requirements for different dataset sizes. Similar to this.

@natowi
Copy link
Member

natowi commented Nov 11, 2019

Here are the results for a test with 2000 images:

  • FeatureExtraction/ultra: 2h, CPU up to 100% and up to 200GB ram
  • FeatureMatching (10^9 features), 100 chunks, 3h per chunk... (aborted) resources for one chunk: CPU@1GHz 5% ram 26GB -> computer has the capacity to run 10-20 chunks in parallel.

@natowi
Copy link
Member

natowi commented Feb 5, 2020

Option to make chunks optional #778

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants