-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
whisper-cpp: add ROCm and Vulkan support, rename from openai-whisper-cpp #365033
base: master
Are you sure you want to change the base?
Conversation
a67bf75
to
7246230
Compare
9058dfa
to
d05678a
Compare
|
If someone could test on Darwin, it would be awesome. |
Great job! I tested it on Darwin, but unfortunately, it didn't work:
|
It looks like the RPATH is not set correctly. I'll also see if I can create a KVM-OSX VM to test the derivation directly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested Vulkan support with:
$ nixpkgs-review pr 365033
$ mkdir /tmp/whisper
$ ./results/whisper-cpp-vulkan-x86_64-linux/bin/whisper-cpp-download-ggml-model base.en /tmp/whisper/
$ ./results/whisper-cpp-vulkan-x86_64-linux/bin/whisper-cpp -m /tmp/whisper/ggml-base.en.bin -m /tmp/whisper/ggml-base.en.bin ~/Downloads/jfk.wav
and it seems to work ok:
ggml_vulkan: Found 1 Vulkan devices:
ggml_vulkan: 0 = AMD Radeon RX 7900 XTX (RADV NAVI31) ((null)) | uma: 1 | fp16: 1986290034 | warp size: 0
with rocmSupport = true
, it seems to work fine as well (though it takes ~25 minutes to build locally):
ggml_cuda_init: found 1 ROCm devices:
Device 0: AMD Radeon RX 7900 XTX, compute capability 11.0, VMM: no
The vanilla build works (and fixes the SIMD issues thank you)
However the
|
I'm a bit swamped with other stuff right now, so I won't be able to dive into debugging this further. Sorry! |
d05678a
to
bfc4257
Compare
@PapayaJackal I tried adding |
|
$ nix build --file /nix/store/w1hgvm5rb3rblya8if90cdx5lvwyf4wc-nixpkgs-review-2.12.0/lib/python3.12/site-packages/nixpkgs_review/nix/review-shell.nix --nix-path 'nixpkgs=/Users/rodrigo/.cache/nixpkgs-review/pr-365033-1/nixpkgs nixpkgs-overlays=/var/folders/by/9xt1lyys0qvds8zzbx60c58m0000gn/T/tmppcq_ecwm' --extra-experimental-features 'nix-command no-url-literals' --no-link --keep-going --no-allow-import-from-derivation --argstr local-system aarch64-darwin --argstr nixpkgs-path /Users/rodrigo/.cache/nixpkgs-review/pr-365033-1/nixpkgs --argstr nixpkgs-config-path /var/folders/by/9xt1lyys0qvds8zzbx60c58m0000gn/T/tmp0qmt4adr.nix --argstr attrs-path /Users/rodrigo/.cache/nixpkgs-review/pr-365033-1/attrs.nix
error: builder for '/nix/store/dinzb2x13v9ssxvp36p7m76fk35dc13a-whisper-cpp-1.7.2.drv' failed with exit code 1;
last 10 log lines:
> ^^^^^^^^^^^^^^^
> File "/nix/store/whmwqp5qa1lpadz0ik6wfjgjzbbgjh1z-python3-3.12.7-env/lib/python3.12/site-packages/elftools/elf/elffile.py", line 84, in __init__
> self._identify_file()
> File "/nix/store/whmwqp5qa1lpadz0ik6wfjgjzbbgjh1z-python3-3.12.7-env/lib/python3.12/site-packages/elftools/elf/elffile.py", line 570, in _identify_file
> elf_assert(magic == b'\x7fELF', 'Magic number does not match')
> File "/nix/store/whmwqp5qa1lpadz0ik6wfjgjzbbgjh1z-python3-3.12.7-env/lib/python3.12/site-packages/elftools/common/utils.py", line 80, in elf_assert
> _assert_with_exception(cond, msg, ELFError)
> File "/nix/store/whmwqp5qa1lpadz0ik6wfjgjzbbgjh1z-python3-3.12.7-env/lib/python3.12/site-packages/elftools/common/utils.py", line 143, in _assert_with_exception
> raise exception_type(msg)
> elftools.common.exceptions.ELFError: Magic number does not match
For full logs, run 'nix-store -l /nix/store/dinzb2x13v9ssxvp36p7m76fk35dc13a-whisper-cpp-1.7.2.drv'.
error: builder for '/nix/store/gdcg3r5pwz8m8w0vbf6jk7cy6w76jylc-whisper-cpp-1.7.2.drv' failed with exit code 1;
last 10 log lines:
> ^^^^^^^^^^^^^^^
> File "/nix/store/whmwqp5qa1lpadz0ik6wfjgjzbbgjh1z-python3-3.12.7-env/lib/python3.12/site-packages/elftools/elf/elffile.py", line 84, in __init__
> self._identify_file()
> File "/nix/store/whmwqp5qa1lpadz0ik6wfjgjzbbgjh1z-python3-3.12.7-env/lib/python3.12/site-packages/elftools/elf/elffile.py", line 570, in _identify_file
> elf_assert(magic == b'\x7fELF', 'Magic number does not match')
> File "/nix/store/whmwqp5qa1lpadz0ik6wfjgjzbbgjh1z-python3-3.12.7-env/lib/python3.12/site-packages/elftools/common/utils.py", line 80, in elf_assert
> _assert_with_exception(cond, msg, ELFError)
> File "/nix/store/whmwqp5qa1lpadz0ik6wfjgjzbbgjh1z-python3-3.12.7-env/lib/python3.12/site-packages/elftools/common/utils.py", line 143, in _assert_with_exception
> raise exception_type(msg)
> elftools.common.exceptions.ELFError: Magic number does not match
For full logs, run 'nix-store -l /nix/store/gdcg3r5pwz8m8w0vbf6jk7cy6w76jylc-whisper-cpp-1.7.2.drv'.
error: 2 dependencies of derivation '/nix/store/dasbp7ay07cbiw4l4rp56bxfk5ink0jp-review-shell.drv' failed to build |
@aviallon, this is the first time I've run those commands, and my environment might also be broken. Please let me know if there is anything more I can do to help |
@rodfersou thank you very much. |
@aviallon I run the command for full logs looks like the target macos (12) is different from the one I have (11)
[2/55] Building CXX object src/CMakeFiles/whisper.coreml.dir/coreml/whisper-encoder.mm.o
/tmp/nix-build-whisper-cpp-1.7.2.drv-1/source/src/coreml/whisper-encoder.mm:31:44: warning: 'whisper_encoder_impl' is only available on macOS 12.0 or newer [-
Wunguarded-availability-new]
const void * data = CFBridgingRetain([[whisper_encoder_impl alloc] initWithContentsOfURL:url_model configuration:config error:nil]);
^~~~~~~~~~~~~~~~~~~~
/tmp/nix-build-whisper-cpp-1.7.2.drv-1/source/src/coreml/whisper-encoder-impl.h:41:12: note: 'whisper_encoder_impl' has been marked as being introduced in macOS 12.0 here, but the deployment target is macOS 11.0.0
@interface whisper_encoder_impl : NSObject
^
/tmp/nix-build-whisper-cpp-1.7.2.drv-1/source/src/coreml/whisper-encoder.mm:31:44: note: enclose 'whisper_encoder_impl' in an @available check to silence this warning
const void * data = CFBridgingRetain([[whisper_encoder_impl alloc] initWithContentsOfURL:url_model configuration:config error:nil]);
^~~~~~~~~~~~~~~~~~~~
/tmp/nix-build-whisper-cpp-1.7.2.drv-1/source/src/coreml/whisper-encoder.mm:65:9: warning: 'whisper_encoder_implOutput' is only available on macOS 12.0 or newer [-Wunguarded-availability-new]
whisper_encoder_implOutput * outCoreML = [(__bridge id) ctx->data predictionFromLogmel_data:inMultiArray error:nil];
^~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/nix-build-whisper-cpp-1.7.2.drv-1/source/src/coreml/whisper-encoder-impl.h:29:12: note: 'whisper_encoder_implOutput' has been marked as being introduced in macOS 12.0 here, but the deployment target is macOS 11.0.0
@interface whisper_encoder_implOutput : NSObject<MLFeatureProvider>
^
/tmp/nix-build-whisper-cpp-1.7.2.drv-1/source/src/coreml/whisper-encoder.mm:65:9: note: enclose 'whisper_encoder_implOutput' in an @available check to silence this warning
whisper_encoder_implOutput * outCoreML = [(__bridge id) ctx->data predictionFromLogmel_data:inMultiArray error:nil];
^~~~~~~~~~~~~~~~~~~~~~~~~~ |
@aviallon can we try with SDK12 instead? |
f72f772
to
d97db76
Compare
|
$ nixpkgs-review pr --post-result 365033
$ git -c fetch.prune=false fetch --no-tags --force https://github.com/NixOS/nixpkgs master:refs/nixpkgs-review/0 pull/365033/head:refs/nixpkgs-review/1
$ git worktree add /Users/rodrigo/.cache/nixpkgs-review/pr-365033-5/nixpkgs 489c04e40ca17f831e45cefc4a72e8884bf7a51a
Preparing worktree (detached HEAD 489c04e40ca1)
Updating files: 100% (45779/45779), done.
HEAD is now at 489c04e40ca1 miniflux: 2.2.4 -> 2.2.5 (#375556)
$ git merge --no-commit --no-ff d97db76924bd0185e1f9aebb1ecd3520cd1acea2
Auto-merging pkgs/top-level/aliases.nix
Auto-merging pkgs/top-level/all-packages.nix
Automatic merge went well; stopped before committing as requested
Nothing to be built.
Link to currently reviewing PR:
https://github.com/NixOS/nixpkgs/pull/365033
Posting result comment on https://github.com/NixOS/nixpkgs/pull/365033
$ /nix/store/c4kw7qpffsq7vd6brwgkfnglvj85ivqk-nix-2.24.11/bin/nix-shell --argstr local-system aarch64-darwin --argstr nixpkgs-path /Users/rodrigo/.cache/nixpkgs-review/pr-365033-5/nixpkgs --argstr nixpkgs-config-path /var/folders/by/9xt1lyys0qvds8zzbx60c58m0000gn/T/tmpn9m2a4bs.nix --argstr attrs-path /Users/rodrigo/.cache/nixpkgs-review/pr-365033-5/attrs.nix --nix-path 'nixpkgs=/Users/rodrigo/.cache/nixpkgs-review/pr-365033-5/nixpkgs nixpkgs-overlays=/var/folders/by/9xt1lyys0qvds8zzbx60c58m0000gn/T/tmpc3n6y285' /nix/store/w1hgvm5rb3rblya8if90cdx5lvwyf4wc-nixpkgs-review-2.12.0/lib/python3.12/site-packages/nixpkgs_review/nix/review-shell.nix
[nix-shell:~/.cache/nixpkgs-review/pr-365033-5]$ |
|
@aviallon I'm confused, not sure if it's working |
d97db76
to
27a56b6
Compare
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
27a56b6
to
6a0cc18
Compare
Rewrite to use CMake build Add aviallon to whisper-cpp's maintainers
6a0cc18
to
89de5a9
Compare
|
@rodfersou there was a very weird bug there, I re-created my branch on top of master, which should fix it. |
|
1 similar comment
|
@rodfersou Your nixpkgs-review built nothing at all?! Also, I tried to rework the PR for whisper.cpp 1.7.4, but there is a weird link issue I have to solve. |
can you guide me how to run the command? before the last changes was at least trying to build, now it's not anymore |
Try with |
|
@lucasew it works!!! thanks |
@rodfersou Hurra!!! |
Quite frankly, if it works with |
The previous version with force-enabled CPU vector extensions.
|
However the vulkan build is still segfaulting:
|
@hughobrien your issue is probably a hardware or a driver bug. |
Rewrite to use CMake build
Add aviallon to whisper-cpp's maintainers
Fixes #357736
Fixes #349669
Closes #358174
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.