Show HN: Port of OpenAI's Whisper model in C/C++
71–80 of 93 posts
Re: Show HN: Port of OpenAI's Whisper model in C/C++
#72There is no language called "C/C++". If, to use it, you need C++, it's a C++ system, period. If parts are in C, that is an implementation detail, and is furthermore pointless; modernizing those to C++ would make them more robust and probably faster. Using C anywhere just makes it as bug-prone in those parts as C code everywhere is.
C and C++ are different languages, you can't necessarily treat a codebase of mixed C and C++ as if it were written entirely in C++.
This isn't purely academic, either. For a long time the MSVC compiler had pretty good C++ language support but surprisingly poor C support, which inconvenienced some folks.
> modernizing those to C++ would make them more robust and probably faster
I agree that adopting C++'s insistence on explicit type conversions is a good move for C codebases. I'd be surprised if performance were improved by reworking a C codebase to get it to compile as C++, though.
Re: Show HN: Port of OpenAI's Whisper model in C/C++
#73This is really awesome, great work! I downloaded a long video from YouTube that is very challenging to transcribe (it is an interview with Hayek, who was both very soft spoken and had a thick German accent) because I wanted to evaluate OpenAI’s claims about whisper being “superhuman” in recognition. It was a bit picky about having the audio in the exact right format (it needs to be 16kHz wav files— would be really ni…
Btw, there is the `yt-wsp.sh` helper script to download, convert and transcribe a video by given url: ./examples/yt-wsp.sh
Re: Show HN: Port of OpenAI's Whisper model in C/C++
#74Next Christmas should see plenty of robots, teddy bears and other weird and wonderful sentient toys.
Re: Show HN: Port of OpenAI's Whisper model in C/C++
#75There is no language called "C/C++". If, to use it, you need C++, it's a C++ system, period. If parts are in C, that is an implementation detail, and is furthermore pointless; modernizing those to C++ would make them more robust and probably faster. Using C anywhere just makes it as bug-prone in those parts as C code everywhere is.
> If, to use it, you need C++, it's a C++ system, period. If parts are in C, that is an implementation detail C and C++ are different languages, you can't necessarily treat a codebase of mixed C and C++ as if it were written entirely in C++. This isn't purely academic, either. For a long time the MSVC compiler had pretty good C++ language support but surprisingly poor C support, which inconvenienced some folks. > mod…
C++ code going faster than the C is routine. It doesn't come without activity, but the activity yields a more maintainable system, so is commonly done.
MSVC's C compiler only recognized C90. It was generally easier to make your C99 code compile as C++ than to backport it to C90.
Re: Show HN: Port of OpenAI's Whisper model in C/C++
#76This is really cool, and I have been meaning to get my hands dirty with Whisper I looks like you’ve definitely maximized the parallelization on the CPU/AMX here, but have you tried getting it to run on the GPU or the Neural Engine? I love the portability, but I feel like you would get a massive parallelization boost while dramatically cutting energy consumption.
I did some experiments with adding Metal Performance Shaders support, but the performance that I achieved was only marginally better compared to the one I get when using just the Accelerate framework (there is an unmerged PR with the tests). Honestly, I am bit confused with all the different types of processing units available on Apple Silicon. If I understand correctly, we have: CPU, GPU, AMX coprocessor and Neural…
I haven't looked at your code closely so can't say with certainty it would be the right fit but worth a look.
Re: Show HN: Port of OpenAI's Whisper model in C/C++
#77There is no language called "C/C++". If, to use it, you need C++, it's a C++ system, period. If parts are in C, that is an implementation detail, and is furthermore pointless; modernizing those to C++ would make them more robust and probably faster. Using C anywhere just makes it as bug-prone in those parts as C code everywhere is.
He clearly means that he used two languages: C and C++.
"I decided to reimplement the inference of the model from scratch using C/C++. To achieve this I implemented a minimalistic tensor library in C and ported the high-level architecture of the model in C++."
Re: Show HN: Port of OpenAI's Whisper model in C/C++
#78There is no language called "C/C++". If, to use it, you need C++, it's a C++ system, period. If parts are in C, that is an implementation detail, and is furthermore pointless; modernizing those to C++ would make them more robust and probably faster. Using C anywhere just makes it as bug-prone in those parts as C code everywhere is.
Yes there is.
Take the union of C and C++ which is valid syntax (and same semantics) in both languages, voila; C/C++.
Re: Show HN: Port of OpenAI's Whisper model in C/C++
#79Earlier quoted context omitted.
Btw, there is the `yt-wsp.sh` helper script to download, convert and transcribe a video by given url: ./examples/yt-wsp.sh
I actually couldn't get the script to work-- it keeps complaining that it can't find the Whisper executable. Do you know what I would have to do first to get it to work starting from a "blank slate" and cloning the repo? Thanks!
WHISPER_EXECUTABLE=main examples/yt-wsp.sh youtube_url
Or the script itself prints out a handy hint. Whisper needs to be built into the main binary with make, then you can rename it to something like 'whisper' and add it to your PATH for convenience.Re: Show HN: Port of OpenAI's Whisper model in C/C++
#80There is no language called "C/C++". If, to use it, you need C++, it's a C++ system, period. If parts are in C, that is an implementation detail, and is furthermore pointless; modernizing those to C++ would make them more robust and probably faster. Using C anywhere just makes it as bug-prone in those parts as C code everywhere is.
>There is no language called "C/C++". Yes there is. Take the union of C and C++ which is valid syntax (and same semantics) in both languages, voila; C/C++.