Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
NPU and GCC
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 364

PostPosted: Tue Aug 06, 2024 9:24 pm    Post subject: NPU and GCC Reply with quote

Hello forum . Do you think it will be possible to interact with NPU using the "C" language for the Linux kernel? Will the GCC compiler provide such a possibility?


If I'm not mistaken, modern processors already contain NPU. It would be stupid not to use it. But knowing Linux developers, it may take 10 years before they implement something.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22619

PostPosted: Tue Aug 06, 2024 9:34 pm    Post subject: Reply with quote

If NPU can be accessed from software, then yes, the kernel should be able to access it. C can be used for this, as C is very flexible. GCC supports inline assembly for those special cases where C cannot directly express what you need.
Back to top
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 364

PostPosted: Tue Aug 06, 2024 10:03 pm    Post subject: Reply with quote

Hu wrote:
.



GCC engineers just need to teach the compiler to generate code for execution on the NPU. I think the special people at Microsoft who are responsible for the Linux kernel will not allow this to be done quickly, so that Linux systems do not compete with Windows. Linux systems must lag behind commercial Windows. I think you understand why this is necessary.
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3420

PostPosted: Tue Aug 06, 2024 10:17 pm    Post subject: Reply with quote

Apparently software for NPU and Linux already exists.
Like torch for example
_________________
Make Computing Fun Again
Back to top
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 364

PostPosted: Tue Aug 06, 2024 10:27 pm    Post subject: Reply with quote

szatox wrote:
Apparently software for NPU and Linux already exists.
Like torch for example



I doubt NPU will be involved. Neither AMD nor Intel have offered them for sale yet. Everything that was announced was a marketing lie.
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3420

PostPosted: Tue Aug 06, 2024 10:47 pm    Post subject: Reply with quote

Quote:
If I'm not mistaken, modern processors already contain NPU

Quote:
I doubt NPU will be involved. Neither AMD nor Intel have offered them for sale yet.


:roll:

Whatever
_________________
Make Computing Fun Again
Back to top
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 364

PostPosted: Tue Aug 06, 2024 11:03 pm    Post subject: Reply with quote

szatox wrote:
Quote:
If I'm not mistaken, modern processors already contain NPU

Quote:
I doubt NPU will be involved. Neither AMD nor Intel have offered them for sale yet.


:roll:

Whatever



Correct. AMD delayed their CPUs. According to AMD, they already have the NPU. I can't verify this because they haven't shipped it yet due to operational issues. Intel said their CPUs will have the NPU from 13th gen, but in 14th gen, they disabled it because it causes operational issues. So I can't confirm AMD's claim that their CPUs already have the NPU because they are delayed, so I repels from words that the NPU is there, but I doubt it. Intel said they have the NPU, but it's disabled. From a marketing perspective, it's there, but it's disabled. You'd think the NPU isn't there.



That is, everything is already clear with Intel, but AMD is in question. We find out only after the release of their product. But Lisa is not particularly honest, so everything is in question. But we hope for the best that they are already in new processors.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5094
Location: Bavaria

PostPosted: Tue Aug 06, 2024 11:38 pm    Post subject: Reply with quote

Gentoopc wrote:
I doubt NPU will be involved. Neither AMD nor Intel have offered them for sale yet. Everything that was announced was a marketing lie.


Gentoopc wrote:
[...] Intel said they have the NPU, but it's disabled. From a marketing perspective, it's there, but it's disabled. You'd think the NPU isn't there. [...]

If you don't know anything about something, you shouldn't make a big deal out of it ... otherwise you make a fool of yourself. Do you actually read any IT news?

Drivers for the NPU of the new Intel processors have been available since kernel version 6.6 (CONFIG_DRM_ACCEL_IVPU gives you the driver intel-vpu)... everything else too:

* https://www.phoronix.com/news/Linux-6.6-Intel-VPU4

* https://www.phoronix.com/news/Intel-Linux-NPU-Driver-1.5

* https://github.com/intel/linux-npu-driver

* https://en.wikipedia.org/wiki/OpenVINO

Funnily enough, Linux is mentioned here before Windows:

* https://docs.openvino.ai/2024/about-openvino/release-notes-openvino/system-requirements.html
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 364

PostPosted: Wed Aug 07, 2024 1:09 am    Post subject: Reply with quote

pietinger wrote:



Not the fact that this driver was assembled using GCC. I'm talking about the GCC compile. And what does this driver give, which you refer to if the NPU in Intel processors is disabled, it is equivalent that there is no NPU. I wrote above.
Back to top
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 364

PostPosted: Wed Aug 07, 2024 1:16 am    Post subject: Reply with quote

pietinger wrote:


What am I wrong? AMD and Intel processors are the same architecture and problems with it. Intel had problems with part of the processors. AMD realized that they will have the same thing, and with which they returned the sold processors of AMD to avoid failure. Now they will determine the marriage more strictly and will transfer on sale.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2405

PostPosted: Wed Aug 07, 2024 9:35 am    Post subject: Reply with quote

Gentoopc wrote:
AMD and Intel processors are the same architecture and problems with it. Intel had problems with part of the processors.


That's a wrong assumption. X86 architecture is how things look like top-down from running code's point of view, not bottom up from CPU's executing it point of view. CPU's can be build completely differently and still run code from the same architecture, Apple's M1 being able to run x86 code being an example.

Best Regards,
Georgi
Back to top
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 364

PostPosted: Wed Aug 07, 2024 10:30 am    Post subject: Reply with quote

logrusx wrote:
Gentoopc wrote:
AMD and Intel processors are the same architecture and problems with it. Intel had problems with part of the processors.


That's a wrong assumption. X86 architecture is how things look like top-down from running code's point of view, not bottom up from CPU's executing it point of view. CPU's can be build completely differently and still run code from the same architecture, Apple's M1 being able to run x86 code being an example.
i


Do you believe what the drawings show you? Both Intel and AMD have almost the same architecture. That AMD has a cache that intel has a cache, that AMD has ALU that Intel has ALU. that the AMD processor was built on interruptions also built a processor at interruptions and intel.


We don't need to believe what these companies show us on paper. You don't have the opportunity to check what's inside the processor, and I don't have that opportunity. Yes, AMD will show you a drawing of what their different architectural solutions are with INTEL, but this does not mean that this is the case in reality, let's look at the facts, and we will see that they did not accidentally encounter a problem, here it is minute by minute. their processors break down and the breakdowns are the same. AMD quickly recalled batches of its products. everything indicates that the architecture of intel and amd processors is the same, so they don't tell us. they can't tell us otherwise, otherwise we won't buy if amd and intel have the same architecture.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2405

PostPosted: Wed Aug 07, 2024 11:32 am    Post subject: Reply with quote

Gentoopc wrote:

Do you believe what the drawings show you? Both Intel and AMD have almost the same architecture.


Back in high school I actually studied microprocessors. There's a processor model from the programmer's point of view, which is not at all how the processor is internally built but what the programmer needs to know to make that processor do useful stuff. That's what the architecture is, not how the building blocks of the CPU actually are. The rest is mystery. Well actually back then it wasn't, but now it is. What you see on the "drawing" is that specific model which is from the point of view top to bottom. Bu bottom-up the picture is completely different.

Gentoopc wrote:
Yes, AMD will show you a drawing of what their different architectural solutions are with INTEL


No they won't. They'll show only what the programmer needs to know. That's not different architectural solutions.

Best Regards,
Georgi
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9608
Location: beyond the rim

PostPosted: Wed Aug 07, 2024 4:13 pm    Post subject: Reply with quote

At the moment only some of the most recent mobile chips come with an NPU, the current desktop lineup including the just released Zen5 models don't have one (thank god). And so far even MS doesn't really make use of them despite them putting the entire company on their CoPilot AI marketing. As the whole world slowly realizes that "AI" in its current incarnation isn't really turning the world upside down as promised by marketing departments.

Quote:
GCC engineers just need to teach the compiler to generate code for execution on the NPU.

GCC has little to nothing to do with "AI" stuff. These things are not intended to run code but to process a very specific type of data.

logrusx wrote:
Apple's M1 being able to run x86 code being an example.

M1 doesn't run x86 code, Apple just has a pretty decent software layer that translates x86 instructions into ARM instructions (MS is doing the same with their Windows on ARM). Nothing special there, qemu has been doing that for muliple architectures for decades (but with magnitudes slower performance).
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2405

PostPosted: Wed Aug 07, 2024 4:26 pm    Post subject: Reply with quote

Genone wrote:

M1 doesn't run x86 code, Apple just has a pretty decent software layer that translates x86 instructions into ARM instructions


To my knowledge it's a hardware translation layer. There's no way it would be even usable if it was a software translation layer.

Best Regards,
Georgi
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9608
Location: beyond the rim

PostPosted: Wed Aug 07, 2024 5:27 pm    Post subject: Reply with quote

logrusx wrote:
Genone wrote:

M1 doesn't run x86 code, Apple just has a pretty decent software layer that translates x86 instructions into ARM instructions


To my knowledge it's a hardware translation layer. There's no way it would be even usable if it was a software translation layer.


It is software, called Rosetta2 embedded in the core of the operating system (they did the same with Rosetta1 when switching from PowerPC to X86). They added some extra logic in hardware to minimize the performance impact, but the CPU can't run x86 code by itself. The translation is performed ahead of time when loading the executable, not directly at execution time. When running OS X it doesn't really matter, but you can't for example boot into a x86 operating system on Apple Silicon at all.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2405

PostPosted: Wed Aug 07, 2024 5:51 pm    Post subject: Reply with quote

Genone wrote:
They added some extra logic in hardware to minimize the performance impact, but the CPU can't run x86 code by itself. The translation is performed ahead of time when loading the executable, not directly at execution time. When running OS X it doesn't really matter, but you can't for example boot into a x86 operating system on Apple Silicon at all.


That makes much more sense. I didn't claim it could directly run X86 instructions. That would have defeated the purpose of developing it first place. I just used it as the only known (to me?) example of processor that is capable of running code from a non-native architecture.

But in general, what the programmer see is a tiny piece of the whole picture. You can't judge for the hardware implementation by the architecture. Architecture here is not like the architecture of a building.

Best Regards,
Georgi
Back to top
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 364

PostPosted: Wed Aug 07, 2024 7:21 pm    Post subject: Reply with quote

Genone wrote:


Quote:
GCC engineers just need to teach the compiler to generate code for execution on the NPU.

GCC has little to nothing to do with "AI" stuff. These things are not intended to run code but to process a very specific type of data.



Gentlemen, I know what GCC is for and how it can be used. and I know what an NPU is. and I'm sure it can be programmed. but to do this, you will need a compiler, and I would like it to be GCC. not any other, but I wanted GCC to be able to work with NPU. do not mislead.
Back to top
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 364

PostPosted: Wed Aug 07, 2024 7:24 pm    Post subject: Reply with quote

logrusx wrote:


Back in high school I actually studied microprocessors. There's a processor model from the programmer's point of view, which is not at all how the processor is internally built but what the programmer needs to know to make that processor do useful stuff. That's what the architecture is, not how the building blocks of the CPU actually are. The rest is mystery. Well actually back then it wasn't, but now it is. What you see on the "drawing" is that specific model which is from the point of view top to bottom. Bu bottom-up the picture is completely different.



you haven't studied the processor architecture well if you don't even know what it is. from the context of the conversation, it was possible to immediately understand what was being discussed, and not to tell about the instructions of the CPU, that this is its architecture.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2405

PostPosted: Wed Aug 07, 2024 7:32 pm    Post subject: Reply with quote

Keep it civilized or your thread is going to end up like the rest of your threads.

Best Regards,
Georgi
Back to top
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 364

PostPosted: Wed Aug 07, 2024 7:33 pm    Post subject: Reply with quote

Genone wrote:
At the moment only some of the most recent mobile chips come with an NPU, the current desktop lineup including the just released Zen5 models don't have one (thank god).


here you are right, there will be no breakthrough in AI. because these guys want to use logic for relays for a machine that should think like a human. their approach and weight distribution is just terrible. we need new logic for machines.


Last edited by Gentoopc on Wed Aug 07, 2024 7:38 pm; edited 1 time in total
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3687
Location: Rasi, Finland

PostPosted: Wed Aug 07, 2024 10:44 pm    Post subject: Reply with quote

Gentoopc,

You're mostly complaining at the wrong forum.
If you want to generate code for NPU using GCC, this is not the place to ask for support to that feature, since it does not exist (yet?). Instead you should be writing to GCC mailing list etc...

Gentoopc wrote:
you haven't studied the processor architecture well if you don't even know what it is.
Comments like that just push this thread towards locked state.
_________________
..: Zucca :..

My gentoo installs:
init=/sbin/openrc-init
-systemd -logind -elogind seatd

Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 364

PostPosted: Wed Aug 07, 2024 11:35 pm    Post subject: Reply with quote

Zucca wrote:

Gentoopc wrote:
you haven't studied the processor architecture well if you don't even know what it is.
Comments like that just push this thread towards locked state.


there is no insult here. it's just my opinion. are you forbidding him to express his opinion?
Back to top
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 364

PostPosted: Wed Aug 07, 2024 11:41 pm    Post subject: Reply with quote

Genone wrote:
At the moment only some of the most recent mobile chips come with an NPU, the current desktop lineup including the just released Zen5 models don't have one (thank god).


https://postimg.cc/ns7WD5Ss


as I said AMD claims to have NPU in the form of XDNA2
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3420

PostPosted: Thu Aug 08, 2024 1:16 am    Post subject: Reply with quote

Double posting, contradicting yourself, writing about yourself in 3rd person.... I though lobotomy has been banned since before the internet era, and yet here we are.

What is the actual purpose of this topic?
Do you have a question you want answered? An opinion to share? A cool project to brag about?
It started as a question, but now I'm just lost; I simply can't tell what's your goal anymore.
_________________
Make Computing Fun Again
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum