Skip to content

Commit 7fffb67

Browse files
committed
Update 2024-05-21-perfboost-windows-cpu.md
update image width
1 parent 78c5982 commit 7fffb67

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

_posts/2024-05-21-perfboost-windows-cpu.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ The challenge of PyTorch's lower CPU performance on Windows compared to Linux ha
99
In version 2.0, PyTorch on Windows with CPU directly utilizes the default malloc mechanism of Windows, which, compared to the malloc used in PyTorch Linux version 2.0, significantly increases the time for memory allocation, resulting in decreased performance. Intel engineer Xu Han took the initiative to replace the original Windows malloc mechanism, which PyTorch automatically calls, with another well-known malloc library developed by Microsoft, known as mimalloc. This replacement of malloc has already been released with Pytorch v2.1 and can significantly improve PyTorch's performance on Windows CPUs (See the following graph).
1010

1111
![Windows PC Performance Improvement](/assets/images/2024-05-21-perfboost-windows-cpu/windows_compare.png){:style="width:100%;"}
12+
1213
_Figire 1: Relative throughput improvement achieved by upgrading from Windows PyTorch version 2.0 to 2.1 (higher is better)._
14+
1315
**Note**: The performance is measured on Intel Core 13th Gen i7-13700H with 32G Memory.
1416

1517

@@ -18,11 +20,15 @@ From this graph, it's evident that PyTorch on Windows CPU showcases significant
1820
On a high-performance CPU, memory allocation becomes a performance bottleneck. This is also why addressing this issue has led to such significant performance improvements.
1921

2022
![Windows vs Linux Performance on Pytorch 2.0](/assets/images/2024-05-21-perfboost-windows-cpu/pytorch_20_win_linux.png){:style="width:100%;"}
23+
2124
_Figure 2.1: Relative performance of Windows vs Linux with Pytorch version 2.0 (higher is better)._
25+
2226
**Note**: The performance is measured on Intel Core 13th Gen i7-13700H with 32G Memory.
2327

2428
![Windows vs Linux Performance on Pytorch 2.1](/assets/images/2024-05-21-perfboost-windows-cpu/pytorch_21_win_linux.png){:style="width:100%;"}
29+
2530
_Figure 2.2: Relative performance of Windows vs Linux with Pytorch version 2.1 (higher is better)._
31+
2632
**Note**: The performance is measured on Intel Core 13th Gen i7-13700H with 32G Memory.
2733

2834
As shown in the graphs, it is evident that PyTorch's performance on Windows CPUs can significantly improved. However, there is still a noticeable gap when compared to its performance on Linux. This can be attributed to several factors, including the fact that malloc has not yet fully reached the performance level of Linux, among other reasons. Intel engineers will continue to delve into this issue, collaborating with Meta engineers, to reduce the performance gap of PyTorch between Windows and Linux.

0 commit comments

Comments
 (0)