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

Support Runtime on Apple Silicon #7

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

SCAuFish
Copy link

@SCAuFish SCAuFish commented Aug 11, 2024

Major improvement
Support Web Demo on Apple Silicon (tested on M3 Max), and boosted inference speed 28 times, from 38.5s per iteration to 1.4s per iteration

Other Changes

  1. Running on Mac with default numpy version (2.0.1) led to the following warning
[2024-08-11 15:21:11,167] torch.distributed.elastic.multiprocessing.redirects: [WARNING] NOTE: Redirects are currently not supported in Windows or MacOs.

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.1 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

and error

  File "ml-mdm/ml_mdm/language_models/factory.py", line 68, in forward
    torch.from_numpy(sample["tokens"]).to(self.device).type(torch.long)
RuntimeError: Numpy is not available

therefore, adding version limit numpy<2
2. In README, use editable install to install the local version of codes. Had the following error, when not installing with the flag in condo environment

../../../miniconda3/envs/ml-mdm/lib/python3.9/site-packages/ml_mdm/reader.py:13: in <module>
    from ml_mdm.language_models.tokenizer import Tokenizer
E   ModuleNotFoundError: No module named 'ml_mdm.language_models

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.

1 participant