abetlen / abetlen/llama-cpp-python

Performance degradation running with half a socket in CPU system

Đang mở
#1,098 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug performance
Ngôn ngữ chính
Python
Star
10.6k
Fork
1.4k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

Given a small context, a paragraph with less than 100 words, we are trying to answer a query. There are 5 such queries and overall time taken is recorded. This experiment is conducted on a full system, full socket (in a dual socket machine), and half a socket in the machine (Purely CPU's with no accelerators). Seeing a strange behavior in which the performance degrades considerably scaling down from full socket to half a socket.

I conducted the same experiment using Intel Extension for PyTorch (IPEX). But I don't see the performance degradation moving from full socket to half a socket. Attaching the graphs to better understand the strange behavior.

**Note:** Could not do the IPEX experiment in 9480 due to some local issues. All the timings are average of 5 runs.

**System Details**
8380 - Intel® Xeon® Platinum 8380 Processor
8480 - Intel® Xeon® Platinum 8480+ Processor
9490 - Intel® Xeon® CPU Max 9480 Processor

**Performance observed using Llama CPP with three different systems (8380, 8480, & 9480)**
![image](https://github.com/abetlen/llama-cpp-python/assets/8175283/3c763d31-42c2-4775-93ad-b88b1e1bf328)

**Performance observed using IPEX with two different system (8380, 8480)**
![image](https://github.com/abetlen/llama-cpp-python/assets/8175283/33b9fddc-4c1c-4309-8cdf-b0e0713998d9)

You can see from the above graphs that moving from full socket to half socket has huge impact with Llama CPP where as it has very less impact with IPEX. Any ideas why this is happening with Llama CPP and not with IPEX?

I did capture system details while the executing the experiments using VTune Application Performance Snapshot (APS) tool. The elapsed time and the graph times differ because elapsed time include model loading and other activities. Attaching APS snapshot.

**Full System**
![image](https://github.com/abetlen/llama-cpp-python/assets/8175283/1deb202c-0cf2-4064-a919-415a9eb91f4b)

**Full Socket**
![image](https://github.com/abetlen/llama-cpp-python/assets/8175283/c4550e37-8880-41b1-b4dc-985f192ad549)

**Half Socket**
![image](https://github.com/abetlen/llama-cpp-python/assets/8175283/e09da727-4b73-422e-859f-990a70c33080)

Not sure why the DRAM bandwidth considerably reduced when it is Half Socket for Llama CPP. This behavior is not seen with IPEX and graph clearly shows that the impact of moving from Full Socket to Half Socket is very gradual in IPEX, but not in Llama CPP.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.