Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue #470 - working 32-bit ARM #486

Merged
merged 3 commits into from
Mar 29, 2023

Conversation

clach04
Copy link
Contributor

@clach04 clach04 commented Feb 9, 2023

No description provided.

@clach04
Copy link
Contributor Author

clach04 commented Feb 9, 2023

Fixes Illegal instruction at runtime.

NOTE not tested on Raspberry. Only on Armbian with OdroixXU4.

Tested with neon fpu flag. Also had success with:

  • -mfpu=neon-fp16
  • -mfpu=neon-vfpv3

Copy link
Owner

@ggerganov ggerganov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a way to detect 32-bit ARM in the Makefile and choose the respective flags

@clach04
Copy link
Contributor Author

clach04 commented Mar 10, 2023

We need a way to detect 32-bit ARM in the Makefile and choose the respective flags

That's what this PR does, the original code did not do this. Can you clarify in case I'm missing something?

@ggerganov
Copy link
Owner

My Raspberry Pi 4 reports armv7l, but I can use -mfpu=neon-fp-armv8 successfully.
It has much better performance compared to the proposed -mfpu=neon.

Does -mfpu=neon-fp-armv8 not work for you?

@clach04
Copy link
Contributor Author

clach04 commented Mar 22, 2023

My Raspberry Pi 4 reports armv7l, but I can use -mfpu=neon-fp-armv8 successfully. It has much better performance compared to the proposed -mfpu=neon.

Ahhh, sounds like you have a 64-bit board but a 32-bit Operating System? Can you confirm?

Does -mfpu=neon-fp-armv8 not work for you?

No it does not, I do NOT have a 64-bit Pi 4, I have an armv7 board with no v8 extensions (see https://forums.raspberrypi.com/viewtopic.php?t=282791 for Pi4 self reporting, it reports as v7 in a 32-bit OS but allows access to v8 instructions). My board is ONLY 32-bit.

New idea/proposal (assuming you have a really have pi4 board with 32-bit OS), in the 32-bit OS (v7) code block we add an additional conditional for detecting a raspberry pi board? Thoughts?

Slightly off topic, you might find moving to a 64-bit OS gains you some extra performance else where for your board, then the makefile would drop into the next "if" check.

@ggerganov
Copy link
Owner

Yes, it looks like I am using a 32-bit OS on my 64-bit RPi4. Thanks for clearing this up.
It would be very useful to have a branch in the Makefile for my use case, since I don't see mysql upgrading the OS anytime soon. But if there is no clean way to do it, we can merge it like this and I will simply modify the Makefile locally when working on my RPi4

@clach04
Copy link
Contributor Author

clach04 commented Mar 22, 2023

What do you get for:

cat /proc/cpuinfo |grep 'model name'

(| head -1) ?

If you get ARMv7 Processor rev 4 (v7l) (4 or above) that might be the (slightly messy) heuristic that could work 🤞 .

I don't have a Pi4 to check with 😿 This might also work for Pi 3b+ boards too.

@ggerganov
Copy link
Owner

$ cat /proc/cpuinfo |grep 'model name'
model name	: ARMv7 Processor rev 3 (v7l)

@clach04
Copy link
Contributor Author

clach04 commented Mar 23, 2023

Hmmm, that completely surprised me. Sadly, I think your idea of a private change is the safest :-( I was really hoping we could automate this nicely.

Alternative idea, mention pi 4 can use v8 extensions in a comment (e.g. the ones that worked for you) so its documented as a potential option?

Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
@ggerganov ggerganov merged commit aac1710 into ggerganov:master Mar 29, 2023
anandijain pushed a commit to anandijain/whisper.cpp that referenced this pull request Apr 28, 2023
* issue ggerganov#470 - working 32-bit ARM

* Update Makefile

* Update Makefile

---------

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
jacobwu-b pushed a commit to jacobwu-b/Transcriptify-by-whisper.cpp that referenced this pull request Oct 24, 2023
* issue ggerganov#470 - working 32-bit ARM

* Update Makefile

* Update Makefile

---------

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
jacobwu-b pushed a commit to jacobwu-b/Transcriptify-by-whisper.cpp that referenced this pull request Oct 24, 2023
* issue ggerganov#470 - working 32-bit ARM

* Update Makefile

* Update Makefile

---------

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
landtanin pushed a commit to landtanin/whisper.cpp that referenced this pull request Dec 16, 2023
* issue ggerganov#470 - working 32-bit ARM

* Update Makefile

* Update Makefile

---------

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
iThalay pushed a commit to iThalay/whisper.cpp that referenced this pull request Sep 23, 2024
* issue ggerganov#470 - working 32-bit ARM

* Update Makefile

* Update Makefile

---------

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants