Skip to content

Conversation

@hdevalence
Copy link

This allows the code to run (albeit slowly) on MacOS without a CUDA device.

I also experimented with using MPS, and got further than indicated here. As noted in #1, there are issues with the SparseMPS backend, which is mostly not implemented. Sparse tensors are used for e.g. transcoder activations. I think it might not be terrible to do a workaround where MPS devices are used except for the sparse computations, as unlike with CUDA, the cost of shuttling tensors "between" devices on Apple Silicon is minimal (it's all unified memory). However I haven't actually got this working to be able to test it.

In the meantime, the entire codebase now has consistent device selection defaults and the notebooks will run on a Mac.

This allows the code to run (albeit slowly) on MacOS without a CUDA device.

I also experimented with using MPS, and got further than indicated here. As
noted in safety-research#1, there are issues with the SparseMPS backend, which is mostly not
implemented. Sparse tensors are used for e.g. transcoder activations. I think
it might not be terrible to do a workaround where MPS devices are used except
for the sparse computations, as unlike with CUDA, the cost of shuttling tensors
"between" devices on Apple Silicon is minimal (it's all unified memory).
However I haven't actually got this working to be able to test it.

In the meantime, the entire codebase now has consistent device selection
defaults and the notebooks will run on a Mac.
@mntss
Copy link
Contributor

mntss commented Jun 7, 2025

Closing in favor of #5

@mntss mntss closed this Jun 7, 2025
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