Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Compatibility with MPS backend

Open
#16 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python, pytorch

Research direction

Start with prep_pos_from_pad_and_prev_lens in neuron_explainer/models/transformer.py and get_default_device in neuron_explainer/models/model_context.py. Search the repository for other cumsum uses and the existing workaround that skips MPS tests. Verify the device-selection behavior on macOS versions before and after 13.3, then run the affected MPS tests to confirm the compatibility change.

Written by the indexing model from the issue text.

Description

While running inference on my Mac with MacOS version 13.1, I received the following error:

RuntimeError: MPS does not support cumsum_out_mps op with int64 input. Support has been added in macOS 13.3

I received this error because of the use of cumsum in prep_pos_from_pad_and_prev_lens. cumsum is also used in other places in the repository.

The same error arises when running various tests on the MPS backend, as mentioned around the function get_default_device. I have checked that this error is also because of the inability of MacOS to compute cumsum with version < 13.3.

Screenshot 2024-03-19 at 5 26 14 PM

Should we modify the function get_default_device to return torch.device("mps", 0) only when MacOS version >= 13.3? We can remove the current workaround that avoids running pytests with this backend.

If this seems like a useful change, I will be happy to submit a pull request.

Thank you!

Dominant language
Python
Stars
4.1k
Forks
242
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/transformer-debugger

All issues in openai/transformer-debugger

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.