hotg-ai / rune

Rune provides containers to encapsulate and deploy edgeML pipelines and applications
Apache License 2.0
136 stars 15 forks source link

(improvement) Allow for concurrent multi-threaded building of Runes #320

Closed Nathan13888 closed 3 years ago

Nathan13888 commented 3 years ago

With some Rune files using models with many labels, the build time seems to almost exponentially increase in time complexity.

Currently rune build seems to be single-threaded. Making the build process multi-threaded would allow leveraging high core count systems (like those found in servers).

Not sure of the exact solution as I can't find much information about multi-threaded builds for wasm, so it may be less trivial than it seems.

If there is a solution for this, perhaps a new flag like -c <threads> or -t <threads> would be intuitive for specifying the number of threads to use.

Michael-F-Bryan commented 3 years ago

I think you might be running into https://github.com/hotg-ai/rune/issues/177#issuecomment-849273594 here.

The issue isn't that we don't build Runes in parallel (parallelism gives linear speedups while this seems to be quadratic/exponential, anyway) but that the code we generate hits an edge case in the Rust compiler which causes pathological build times.

This should be resolved by #310 because you'll be passing a single (albeit long) string literal to the label proc block.

Michael-F-Bryan commented 3 years ago

Closing as a duplicate of #177.