# Decomposing GEMM and run in two separate stream

**URL:** <https://forums.developer.nvidia.com/t/decomposing-gemm-and-run-in-two-separate-stream/235243>\
**Category:** GPU-Accelerated Libraries\
**Tags:** cublas\
**Created:** [November 23, 2022, 8:54pm UTC](https://forums.developer.nvidia.com/t/decomposing-gemm-and-run-in-two-separate-stream/235243 "2022-11-23T20:54:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nokanaran](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@nokanaran](https://forums.developer.nvidia.com/u/nokanaran)\
**Post date:** [November 23, 2022, 8:54pm UTC](https://forums.developer.nvidia.com/t/decomposing-gemm-and-run-in-two-separate-stream/235243/1 "2022-11-23T20:54:12Z")

</div>

I have two questions about the GEMM.

1. Is it possible to decompose a GEMM operation in 2 different kernels and run them in 2 parallel streams to get better performance?

2. What happen for performance if we split the GEMM in a small GEMM (small GEMM means 10% of rows of the square matrix) and a big GEMM in 2 different kernels and run them in 2 parallel streams ? Does it get faster or slower overall?

Thanks

---

<div class="post-metadata">

**Author:** ![Robert\_Crovella](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/robert_crovella/32/14043_2.png) [@Robert\_Crovella](https://forums.developer.nvidia.com/u/Robert_Crovella)\
**Post date:** [November 25, 2022, 3:34pm UTC](https://forums.developer.nvidia.com/t/decomposing-gemm-and-run-in-two-separate-stream/235243/2 "2022-11-25T15:34:44Z")

</div>

Dividing up kernel execution work into smaller kernels by itself generally has no performance benefit.

However dividing up a GEMM into streams for the purpose of copy-compute overlap can have a significant benefit.
