[CPU][Spec Decode] Warn about throughput loss when libiomp5 is not preloaded#44419
Conversation
|
This pull request has merge conflicts that must be resolved before it can be |
14d7aaa to
c8f8f5f
Compare
…eloaded Add a targeted warning when speculative decoding is enabled on CPU without libiomp5 in LD_PRELOAD. Without Intel's OpenMP runtime, SD throughput drops by ~2x due to GNU libgomp overhead in the frequent short parallel regions that speculative decoding uses. Discovered while investigating issue vllm-project#44191 where the reported regression was actually caused by missing LD_PRELOAD in source builds vs the Docker image which sets it automatically. Signed-off-by: jmamou <[email protected]>
bigPYJ1151
left a comment
There was a problem hiding this comment.
Thanks for your investigation @jmamou :) I have some suggestions, please check them.
It is surprising the OpenMP version will affect SD performance on CPU, usually the impact is very limited.
a3b605e to
5b8f34a
Compare
5b8f34a to
2b75fe3
Compare
Thanks for the feedback! I agree it's surprising — for standard inference (large GEMMs dominating runtime), the difference between In standard (non-SD) inference, a single forward pass is large enough that the fork-join overhead is amortized. In SD, you're doing ~2k+1 short passes per generation step, so the overhead accumulates. The non-SD baseline is ~159 ms TPOT in both cases (confirming the impact is SD-specific). |
Co-authored-by: Li, Jiang <[email protected]> Signed-off-by: Jonathan Mamou <[email protected]>
Signed-off-by: jmamou <[email protected]>
…eloaded (vllm-project#44419) Signed-off-by: jmamou <[email protected]> Signed-off-by: Jonathan Mamou <[email protected]> Co-authored-by: Li, Jiang <[email protected]> Co-authored-by: Li, Jiang <[email protected]> Signed-off-by: Ekagra Ranjan <[email protected]>
…eloaded (vllm-project#44419) Signed-off-by: jmamou <[email protected]> Signed-off-by: Jonathan Mamou <[email protected]> Co-authored-by: Li, Jiang <[email protected]> Co-authored-by: Li, Jiang <[email protected]> Signed-off-by: Waqar Ahmed <[email protected]>
…eloaded (vllm-project#44419) Signed-off-by: jmamou <[email protected]> Signed-off-by: Jonathan Mamou <[email protected]> Co-authored-by: Li, Jiang <[email protected]> Co-authored-by: Li, Jiang <[email protected]>
…eloaded (vllm-project#44419) Signed-off-by: jmamou <[email protected]> Signed-off-by: Jonathan Mamou <[email protected]> Co-authored-by: Li, Jiang <[email protected]> Co-authored-by: Li, Jiang <[email protected]>
…eloaded (vllm-project#44419) Signed-off-by: jmamou <[email protected]> Signed-off-by: Jonathan Mamou <[email protected]> Co-authored-by: Li, Jiang <[email protected]> Co-authored-by: Li, Jiang <[email protected]> Signed-off-by: divineearthly <[email protected]>
…eloaded (vllm-project#44419) Signed-off-by: jmamou <[email protected]> Signed-off-by: Jonathan Mamou <[email protected]> Co-authored-by: Li, Jiang <[email protected]> Co-authored-by: Li, Jiang <[email protected]>
…eloaded (vllm-project#44419) Signed-off-by: jmamou <[email protected]> Signed-off-by: Jonathan Mamou <[email protected]> Co-authored-by: Li, Jiang <[email protected]> Co-authored-by: Li, Jiang <[email protected]>
…eloaded (vllm-project#44419) Signed-off-by: jmamou <[email protected]> Signed-off-by: Jonathan Mamou <[email protected]> Co-authored-by: Li, Jiang <[email protected]> Co-authored-by: Li, Jiang <[email protected]>
…eloaded (vllm-project#44419) Signed-off-by: jmamou <[email protected]> Signed-off-by: Jonathan Mamou <[email protected]> Co-authored-by: Li, Jiang <[email protected]> Co-authored-by: Li, Jiang <[email protected]>
…eloaded (vllm-project#44419) Signed-off-by: jmamou <[email protected]> Signed-off-by: Jonathan Mamou <[email protected]> Co-authored-by: Li, Jiang <[email protected]> Co-authored-by: Li, Jiang <[email protected]>
Summary
Add an explicit warning when speculative decoding is enabled on CPU without
libiomp5inLD_PRELOAD. Without Intel's OpenMP runtime, SD throughput drops by ~2× due to the overhead of GNUlibgompin the frequent short parallel regions that speculative decoding uses.Motivation
While investigating issue #44191, we discovered that the performance gap between the official Docker image and source builds is entirely explained by
libiomp5being preloaded in the Docker entrypoint but not in typical conda/venv setups.Benchmark (Xeon 8580, Llama-3.1-8B + Llama-3.2-1B, k=7, BS=1):
libiomp5in LD_PRELOADlibiomp5in LD_PRELOADThe existing generic warning is easy to overlook. This PR adds a targeted warning specifically for the SD + missing iomp case, quantifying the impact and suggesting the fix.
Changes
check_preloaded_libsnow returns a bool indicating whether the library was foundlibiompis missing, emit an additional warning with the expected impact (~2× throughput loss) and the suggestedLD_PRELOADcommandlibiomp5.soviactypes.util.find_libraryand include the path in the hintTest Plan
LD_PRELOADlibiomp5.sois inLD_PRELOAD