Difference between logical cores and physical cores?

Status
Not open for further replies.

Deus Gladiorum

Distinguished
I know that AMD uses logical cores, and Intel uses physical cores, but I'm not sure what the technical difference is. I know what the resulting difference in performance is, and that physical cores trump logical cores everywhere (except supposedly in mutli-threaded tasks, though I don't really see that advantage reflected in benchmarks too much).

I often hear that logical cores are more comparable to threads. As much as I'd like to think otherwise, I'm not quite sure what a thread even is or what it does or allows a CPU to do. Is it a physical entity on the CPU? I've also heard that logical cores and threads are comparable because they both "borrow resources" between each other. I'm not sure what that means either. Exactly what does "resources" reference?
 
Solution
No such thing as physical / logical "cores", processing and scheduling doesn't work that way. AMD fx8xxx CPU's have eight independent processing units, aka "cores". They each have their own control unit, integer processor (ALU) and memory storage (L1 cache / registers / Load Store Unit). What they share is the front end instruction decoded that converts the x86 macro-ops into smaller micro-operations that resemble RISC style instructions and the back end L2 cache. Each core has 2 integer units and each module has access to one SIMD co-processor (aka FPU). It's important to note that SIMD FPU's are co-processors and not part of the x86 processor, though we've been making them together for a long time now. They have their own...
A physical core is what it is called in the name, a core that is physically on the chip. A logical core is the way those are treated that causes them to be utilized like two cores, meaning an AMD 8350 has 4 physical cores and 4 logical cores, while an i7 4760k has 4 physical cores and 0 logical cores.
 


The i7 quad core is 4 physical cores and 8 logical cores. A logical core is essentially how many threads it can process at the same time. A thread is a sequence of instructions. So for this i7 it can process 8 threads at the same time as ht allows 2 threads per physical core. A octo-core like the fx 8350 is 8 physical cores and 8 logical cores as it can do 8 threads. You can have a lot more threads running but the cpu will only be processing that many at a time.
 
ehhh, @ewok93, that's the somewhat abstract response I'm used to hearing. The best I've heard it explained is in this post from a few months ago:



Source

But even there I don't really understand everything, mostly I'm having difficulty understanding the difference between threads and cores. Also, according to that guy's logic in the quoted post, hyper threading is much like having logical cores, so an i7 CPU would have 4 physical cores, and on each physical core there's 2 logical cores for a combined 8 logical cores in addition to the 4 physical cores. By comparison, I've heard that an FX 8 "core" actually consists of 4 "modules" (supposedly not to be counted as cores) which each house 2 logical cores for a combined 8 logical cores and 0 physical cores.
 
AMD chips use paired modules that share back end resources. A four module chip has 8 logical pathways.
Intel cores are fully independant functional cores, and if they are hyperthreaded it means they are wired up twice to reduce queing losses in multitasking. Optimized programs will see the logical pathways as extra cores, and keep the cpu cores busier. The greater instructions per clock cycle count of the intel chips negates the higher transistor and power use of the amd chips in regards to efficiency. A haswell twin core will beat an 8 core amd chip in games, but not in say video cross coding.
 


Yea that's similar to what I was saying, I guess I took too long to post and didn't see yours till after haha. Well I don't understand that last part, as like I said, I heard that the FX series doesn't really have physical "cores" at all. Is there some sort of comprehensive guide or something you guys have learned this from? I wouldn't at all mind sitting through a long read if it means I can understand this better. The definition of threads and logical cores still seems abstract to me :\
 
I meant the i5 4670k. Basically it's like a core is a brain and a processor is a group of people thinking together. An 8 core like an 8320 is 4 people who can work on 8 things, while a 4 core like a 4670k can work on 4 things, but they don't have to multitask.
 


A physical core is one that is physically there, it exists. It can't magically process something on something that does not exist. Maybe ht is confusing you. Think or a core as a pipe. Typically you have one thread let's say it's water. Typically a "core" is not fully filled with water. Ht is like pumping oil and water so you are filling in more of the gaps. So 2 logical cores for 1 physical core. Fx gets a bit more complicated with sharing resources but it's still a single thread per core. Hence 1 logical core for 1 physical core.



I don't know if you just keep making typos but an fx 8 core is like 8 people working at the same time. And a quad core i5 is like 4 people working at the same time. There is no difference in "having to multitask" it's simply they can work at the same time. As I said fx is a bit more complicated sharing resources but you still have 8 "people."
 
Hmm, so if I'm getting this straight, in ewok93's analogy the 4 people who make up an i5-4670k can each work on a single task and each of them are particularly efficient in each of these tasks. On the other hand, the 4 people in the FX-8350 can each work on two tasks at the same time, but not only is the cost of doing so reduced efficiency as compared to them each working on a single task at once, but even if they were to each work on a single task at the same time (i.e. execute 4 threads), they're still not as efficient as the 4 people in the i5-4670k in terms of managing these single tasks? Have I interpreted this analogy correctly?

If so, then I suppose that makes sense because that's why the FX series is typically heralded as being better with multi-threaded tasks (I'm assuming this only applies when "multi-threaded" refers to more than 4 threads). However, I still don't understand the technical differences. Chrisso, I really like where you were going with your explanation, but I don't really understand you because I don't understand what concepts are like logical pathways or back end resources. I can only make assumptions as to what those are but that doesn't give me a full picture.

UPDATE: Damn it, I keep missing k1114's posts and only see them after I've posted my response to another person. Alright, that throws a wrench into my understanding of ewok93's analogy.
 
An 8350 is 8 cores so it's 8 people. But 4 work benches isn't really the best analogy. Think of it like each person has a blue pen (8 blue pens) but they are sharing 4 black pens. Some things need to be written in black but they have to share them.

If 1 person is doing 2 tasks then it's like ht.
 
I said what you are referring to not what you meant. But it doesn't even matter. Deus we can start over. Start with the original issue. Can you say what a physical and logical core are? I think we should stick to talking just intel since ht is the issue that introduces a different number of physical and logical cores on a cpu.
 
Your understanding of my analogy is the point I'm trying to make, and closest to the actual physics of how it works. Logical cores are just cores that are created by essentially splitting a physical core in half. Well... Just go with what I said above.
 
I really mean physical and logical core in reference to an Intel i5-4670k and an AMD FX-8350. I wanted to worry myself with hyper threading after I understood the difference between physical cores in Intel and logical cores in AMD. So I'm still not sure I understand, are modules the same as physical cores and how many physical/logical cores/modules exist in each of the aforementioned CPUs? I still can't really differentiate them.

I suppose my understanding of threads are better. A thread is just a task to execute, right? So when it says that the i5-4670k "has" 4 threads (speaking of which, how does a CPU "have" a thread?) it can execute 4 tasks at the same time. And the FX-8350 apparently has 8 threads, so it can execute 8 tasks at the same time, right?
 


This is incorrect because logical cores are not necessarily a split physical core. A logical core handles a single thread. A normal physical core is a single logical core. Only in the case of ht is a physical split into 2 logical.

The term thread is pretty simple to understand. A task to execute would be a set of instructions like a cooking recipe. You'd follow each step of the instructions in order. Imagine the steps was just a single long line of words. This is why it's called a thread because it's a single line of instructions.

I wont explain anything else in this post so I know you understand this and then we can move on.
 
First, Merry Christmas to all! I hope Santa got everyone their tech goodies, I know I did 😉

Anyway, sorry I didn't respond. I had gone to bed last night before I could read K1114's last post. My email also randomly decides to stop giving me updates on most of my forum posts as I've recently discovered -_-

Anyway, K1114, the thread portion makes sense if I'm understanding what you said correctly. I'm in computer science but have only gone through one semester of it, but from what I know I'm guessing I could consider any single procedural-based programming construct (as opposed to an object based programming construct) to be a thread, right? So for example, if I had a class that printed "Hello World" to the interactions pane, and then afterward printed "foobar" on a new line, that whole class would be considered a single thread, right?

Back to the initial physical core vs logical core thing, so a physical core and a logical core don't necessarily have anything to do with one another, right? A physical core doesn't have to contain any logical cores, and a logical core doesn't have to exist within a physical core, right? So far, am I understanding all this correctly?
 
Don't confuse this by bringing in other concepts. But your understanding of threads seems correct.

Both cores are still wrong. If you were to look at a cpu die, you could count how many physical cores there are. Here's a pic of the i7 4770k die.
http://cdn4.wccftech.com/wp-content/uploads/2013/05/Intel-Haswell-Core-635x395.jpg
This is a quad core, you can see the 4 physical cores outlined. They are physically there, they are objects that you can touch or point out. Logical refers to computer logic, essentially what the computer would see. You can equate logical with the number of threads. 1 logical core handles 1 thread. A quad core i7 with ht is 4 physical, 8 logical. A quad core i5 is 4 physical, 4 logical. A fx 8350 is 8 physical, 8 logical. You have to have a physical core to have a logical core. Or else where would it be? In your imagination? Plainly said, physical cores is what you see, logical cores is what the computer sees.
 
No such thing as physical / logical "cores", processing and scheduling doesn't work that way. AMD fx8xxx CPU's have eight independent processing units, aka "cores". They each have their own control unit, integer processor (ALU) and memory storage (L1 cache / registers / Load Store Unit). What they share is the front end instruction decoded that converts the x86 macro-ops into smaller micro-operations that resemble RISC style instructions and the back end L2 cache. Each core has 2 integer units and each module has access to one SIMD co-processor (aka FPU). It's important to note that SIMD FPU's are co-processors and not part of the x86 processor, though we've been making them together for a long time now. They have their own control unit, register stack, scheduler and language (x87/SSE/AVX/FMA). Each "core" has a single externally exposed register stack that the OS can schedule code to run on.

Intel's design has four cores, each with three ALU's and their own front end instruction decoder and SIMD co-processor. Each of these cores has two externally exposed register stacks that the OS can schedule code on, resource arbitration is done by the front end scheduler.

This results in two radically different wants of executing code. AMD's design allows for 16 ALU's worth of power to be spread across eight threads but only a maximum of 2 ALU's to a single thread. Intel's allows for 12 ALU's worth of power to be spread across eight threads but a maximum of 3 ALU's to a single thread. Intel also has a significantly better memory controller, cache design and manufacturing technology. AMD has four 256-bit FPU's that can process up to two 128-bit SIMD instructions at a time. Intel has four 256-bit FPU's that can process up to three 128-bit SIMD instructions at a time.

OS level optimizations are just informing the scheduler to attempt to schedule code in a way that creates the least amount of resource contention. Scheduling two threads on the same AMD module will create contention on the front end decoder and on the back end L2 cache, scheduling two threads on the same Intel HT core will create contention for the ALU's, scheduler and back end L2 cache.
 
Solution
Palladin is the closest, but so far a lot of people are really confusing concepts, or getting things right but explaining them in convoluted ways.

Let me explain it really simply.

A physical core is quite simply a single, standalone processing center within a CPU. Imagine a cashier working at a checkout in your supermarket. That's a single core.

AMD Bulldozer and Steamroller chips have two logical cores to each physical core. This is because the input sections are shared between two physical cores. Imagine Siamese twin cashiers and two checkouts both working on the same conveyor belt. There's the same method of entry for both, and sorting must be done when the data gets off the conveyor belt, but there is physically two separate and identical processing centers within that single physical core.

Some Intel Chips have Hyper Threading. This gives them a virtual core in addition to their physical core in software. This is like a single clerk with two conveyor belts and tills. Theoretically, there isn't actually any more performance on offer, but whilst you're fishing for your wallet (or the CPU is waiting for external stuff like RAM requests and PCI-e data requests) that clerk can be working on the other till, and the moment you finish, the clerk will pause that job or pass it to someone else and get back to working with you. This has the effect of getting a lot more performance out of that single physical processor.

I hope that explains things in a simple enough way for you to understand. This explains it pretty simply yet true to it's nature.
 
Status
Not open for further replies.

TRENDING THREADS