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

aten::isin.Tensor_Tensor_out is not currently implemented for the MPS device #234

Open
Amandrs opened this issue Jun 18, 2024 · 1 comment

Comments

@Amandrs
Copy link

Amandrs commented Jun 18, 2024

~ via 🐍 v3.11.9 (insanely-fast-whisper)
❯ pipx list
venvs are in ~/.local/pipx/venvs
apps are exposed on your $PATH at ~/.local/bin
manual pages are exposed at ~/.local/share/man
   package insanely-fast-whisper 0.0.15, installed using Python 3.11.9
    - insanely-fast-whisper
~ via 🐍 v3.11.9 (insanely-fast-whisper)
❯ ~/.local/bin/insanely-fast-whisper --file-name audio.wav --device-id mps
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
πŸ€— Transcribing... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0:00:29
Traceback (most recent call last):
  File "~/.local/bin/insanely-fast-whisper", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "~/.local/pipx/venvs/insanely-fast-whisper/lib/python3.11/site-packages/insanely_fast_whisper/cli.py", line 159, in main
    outputs = pipe(
              ^^^^^
  File "~/.local/pipx/venvs/insanely-fast-whisper/lib/python3.11/site-packages/transformers/pipelines/automatic_speech_recognition.py", line 285, in __call__
    return super().__call__(inputs, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/.local/pipx/venvs/insanely-fast-whisper/lib/python3.11/site-packages/transformers/pipelines/base.py", line 1235, in __call__
    return next(
           ^^^^^
  File "~/.local/pipx/venvs/insanely-fast-whisper/lib/python3.11/site-packages/transformers/pipelines/pt_utils.py", line 124, in __next__
    item = next(self.iterator)
           ^^^^^^^^^^^^^^^^^^^
  File "~/.local/pipx/venvs/insanely-fast-whisper/lib/python3.11/site-packages/transformers/pipelines/pt_utils.py", line 269, in __next__
    processed = self.infer(next(self.iterator), **self.params)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/.local/pipx/venvs/insanely-fast-whisper/lib/python3.11/site-packages/transformers/pipelines/base.py", line 1150, in forward
    model_outputs = self._forward(model_inputs, **forward_params)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/.local/pipx/venvs/insanely-fast-whisper/lib/python3.11/site-packages/transformers/pipelines/automatic_speech_recognition.py", line 508, in _forward
    tokens = self.model.generate(
             ^^^^^^^^^^^^^^^^^^^^
  File "~/.local/pipx/venvs/insanely-fast-whisper/lib/python3.11/site-packages/transformers/models/whisper/generation_whisper.py", line 578, in generate
    outputs = super().generate(
              ^^^^^^^^^^^^^^^^^
  File "~/.local/pipx/venvs/insanely-fast-whisper/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "~/.local/pipx/venvs/insanely-fast-whisper/lib/python3.11/site-packages/transformers/generation/utils.py", line 1758, in generate
    result = self._sample(
             ^^^^^^^^^^^^^
  File "~/.local/pipx/venvs/insanely-fast-whisper/lib/python3.11/site-packages/transformers/generation/utils.py", line 2410, in _sample
    next_token_scores = logits_processor(input_ids, next_token_logits)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/.local/pipx/venvs/insanely-fast-whisper/lib/python3.11/site-packages/transformers/generation/logits_process.py", line 98, in __call__
    scores = processor(input_ids, scores)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/.local/pipx/venvs/insanely-fast-whisper/lib/python3.11/site-packages/transformers/generation/logits_process.py", line 1784, in __call__
    suppress_token_mask = torch.isin(vocab_tensor, self.begin_suppress_tokens)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
NotImplementedError: The operator 'aten::isin.Tensor_Tensor_out' is not currently implemented for the MPS device. If you want this op to be added in priority during the prototype phase of this feature, please comment on https://github.com/pytorch/pytorch/issues/77764. As a temporary fix, you can set the environment variable `PYTORCH_ENABLE_MPS_FALLBACK=1` to use the CPU as a fallback for this op. WARNING: this will be slower than running natively on MPS.
@grimelda
Copy link

Duplicate of issue @225 where @BaronZack proposed this solution to switch to nightly torch build , also mentioned in pytorch/pytorch#124518 so will soon be fixed in stable version

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

No branches or pull requests

2 participants