Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

There is a new neighbor on the motherboard, and CPU panics!

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > IT Information >

Share

Shulou(Shulou.com)11/24 Report--

This article comes from the official account of Wechat: programming Technology Universe (ID:xuanyuancoding), author: Xuanyuan Wind O

Hello, everyone. I'm Ah Q from CPU No.1 workshop. Long time no see. I miss you so much.

The new neighbor on the motherboard, "Ah Q, don't be busy, go to the conference room immediately, the leader has an important meeting." early in the morning, the bus director of our CPU factory went to eight workshops to inform everyone of the meeting, looking a little dignified.

"what's the hurry?"

"I heard that there is a new unit on the motherboard to take the jobs of our CPU factory," the director whispered.

"is there such a thing?" Well, I got up and went out without saying a word.

When I came to the conference room, I didn't expect that everyone was already here, so I was the only one left.

Seeing my arrival, the leader began to speak: "everyone, you must have heard of it. Just yesterday, not far from our CPU factory, a new unit called GPU came to the motherboard and openly robbed us of our jobs. To gather everyone today is to discuss how to deal with it."

"GPU, I know, is the graphics processor, that is, graphics computing, how can you take our job? lead you to worry too much." when I looked back, it turned out that it was Primary six, the representative of Workshop 6, who was speaking.

"Oh, it seems that you know them well?" The leader asked Primary six.

Xiao Liu said sheepishly, "to tell you the truth, before I came here, I worked in another CPU factory, where there was a GPU on the motherboard. They mainly undertake some computing work related to graphics rendering, but they all perform some fixed operations, the computing circuits are fixed, and they don't have the ability to program at all, which can't be compared with our CPU."

"Xiao Liu, they have been impressed for three days. How long have you not seen them? now they are not only as programmatic as we are, but it is said that the team has expanded in size, and now it is a general computing architecture. Its name has to be changed. What's its name? GPGPU? even the computing speed is faster than us!" What the leader said was resounding, and the meeting hall quieted down.

"Ah Q and Xiao Liu, what do you think of you two trying to get into their factory and get a feel for the situation, and then we'll continue the discussion after the report?" The leader looks at everyone.

Before I realized it, everyone said yes, and it seems that I can't avoid this job.

Sneak into the GPU that night, Xiao Liu and I sneaked into the GPU factory, did not expect that although it is late at night, but there are still bright lights, a busy scene.

When we entered the place where they worked, my little friend and I were stunned! Boy, this scale is too large, looking at it, there are all work workshops, and there is no end in sight.

"Brother Q, they are too fierce. Our CPU is only 8 cores and there are only 8 workshops. I can't see less than 1000 workshops. Do they have more than 1000 cores? they dazzled my eyes!" Xiao Liu said with surprise on his face.

"I don't think it's that simple. If you look at their workshop carefully, it's much more humble than ours."

"really, those orange places should be the cache, which is much smaller than us. and it seems that most of them are computing circuits, and there are few logic control circuits."

"what are you doing hiding here if you don't go to work?" Oh, no, we were spotted by the patrol! But it seems that he doesn't recognize us and treats us as employees here.

We nodded awkwardly and smiled and said, "have a rest. We'll be right back."

"you two go to workshop 1024, where there is still a shortage of hands."

"all right, I'm going. I'm going."

Ah Q, the executive officer of CPU No.1 workshop, even bowed to this small patrol here. I was angry at the thought.

After searching for GPU's secret for a long time, we finally came to Workshop 1024, where a little brother was very busy. Seeing us coming, the little brother said happily, "you guys are here. I'm so busy here."

"it's so late today, what kind of program are you busy with?" I asked tentatively.

"Today is a bit unlucky. The programmer left us a neural network training task of deep learning before leaving work. I'm sure we can't rest tonight. Maybe we'll have to stay up all night." the younger brother was busy operating the calculation circuit to calculate the data. and said to us.

Xiao Liu gave me a look, and then said to the younger brother, "introduce us to work when you are free, and let's do some work."

"Yes, let's share some of it for you," I followed.

"sit down first. This round of training is coming to an end. I'll introduce you when I have time." The little brother wiped the sweat from his forehead.

While the little brother was busy, we turned around and said, "Xiao Liu, their workshop is really much shabby compared to our CPU. Each of our workshops is equipped with a standard first-and second-level cache, at least a few hundred KB, but they do not have this treatment. And their computing resource circuits are much simpler, such as the logic control circuits we use for branch prediction and out-of-sequence execution."

"Brother Q, can you recognize so many circuits here?"

"I've been in the CPU factory for so many years that I don't recognize that I haven't done it for nothing."

"No, according to what you said, they should have very few circuits here, but why are there so many?" Xiao Liu's words caught my attention.

Take a closer look, although the computing circuit is not as complex as we are, there are many copies of the computing unit ALU! You know, in our CPU factory, there is only one copy in a workshop.

When he was wondering, the little brother finished his work and came over. "I can finally take a breath."

"Big Brother has worked hard. I'd like to ask why there are so many repetitive computing circuits here? isn't that a waste?" Well, I hurried forward and asked.

The younger brother disagreed, "this is not a waste. In the workshop of our GPU factory, each workshop is equipped with many computing units. I can operate them to calculate data in batches at the same time to improve the speed."

"batch computing? can it be done at the same time?" Xiao Liu asked.

"Yes, the jobs contracted by our GPU factory are basically of this type, such as the calculation of each pixel in 3D image rendering, the calculation of tensors and matrices in deep learning, they all have a characteristic that the algorithm is fixed, but the data are different. With the same computing logic, I can feed them different data to do parallel computing! this is called SIMT (Single Instruction,Multiple Threads) technology," he said proudly.

"SIMT? why does this technology look so familiar?" Oh, I asked.

The little brother continued to smile and said, "that's right. They've already used this trick for CPU. We can use it for reference."

"Oh, I remember, Brother Q. He should be talking about SIMD (Single Instruction Multiple Data, single instruction multiple data stream). Multiple data can be manipulated in batches in one instruction to improve performance."

The Children's Day woke me up, "I see! we, oh no, they CPU just batch operation data, GPU here is batch calculation, really wonderful!"

"Brother Q, that sounds good. Why can't we CPU do this?" Xiao Liu asked me quietly.

"you fool, there are eight workshops in our CPU, isn't it parallel for each workshop to execute one thread at the same time? it's just that many threads we execute have different functions, some are IO-intensive, some are computationally intensive, and there are not only the construction costs of cache and logic control circuits, but also universal, so there is no way to produce as many as they do."

Next, the little brother took us to the operating platform and told us how to operate this pile of circuits to perform calculation work. I am naturally familiar with it, which is much easier than in our place.

"over there is the register and the place where the execution context is saved, which you will use later." The little brother said, pointing to a pile of boxes.

"Hey, man, how come there are so many execution contexts, more than the computing unit ALU," I asked.

The little brother patted his head and said, "Hey, look at my memory. I forgot to tell you." Although our GPU is good at computing, we still encounter the scenario of branch judgment. We don't have the ability of branch prediction and out-of-order execution like CPU. You don't know that the guy in memory is slow, and sometimes it's hard to avoid pausing and waiting, wasting computing resources. Later, the leader explained that in order to make full use of computing resources and not to let ALU stay idle, when encountered this kind of pause, they moved the computing resources ALU out to execute other computing codes. So we need to reserve more execution context to save the scene. "

"shit, this is hyper-threading technology! plagiarize our CPU again," I almost blurted out and took a look at Xiao Liu.

"how can it be called plagiarism? to learn from it is to use it for reference," says the little brother, grinning his teeth.

Xiao Liu suddenly asked: "We are so good at GPU, is there nothing wrong with their CPU in the future?"

The younger brother shook his head: "that's a bit of a brag. We don't even have interrupt processing and virtual memory. We still need the help of CPU to work. It's impossible to replace them." They are too busy with CPU, busy with computing, busy executing IO, dealing with interrupts, and dealing with all kinds of complex logic, so we are simple and do not have so many worries, that is, we use the tactics of a sea of people to do pure computing work, with large numbers of people and large power, and can run in parallel, so we are much faster in mathematical computing. But generally speaking, we have a cooperative relationship with CPU, not a competitive relationship! "

Hearing what the little brother said, we finally let go of our hanging hearts, and now we can be regarded as giving an explanation to the leader.

I was thinking trance, Xiao Liu quietly patted me from behind, made a look.

Looking along the place he signaled, I saw that the patrol was coming towards us with several security guards.

There was no time to say goodbye to the little brother, so we ran away quickly

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

IT Information

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report