Add Mac M1 Support
See original GitHub issueFirst thanks for this great job.
May I ask you to add “mps” support?
for the time being I did a “quick and dirty” fix adding
self.device= 'mps' if torch.backends.mps.is_available() == True else 'cpu'
after this line
https://github.com/asahi417/tner/blob/971bb6ff43c62bdfbb1f1793e69d15f4a592f90f/tner/ner_model.py#L83
and this
logging.info(f' GPUs is available? {torch.backends.mps.is_available()}')
after this
https://github.com/asahi417/tner/blob/971bb6ff43c62bdfbb1f1793e69d15f4a592f90f/tner/ner_model.py#L91
It doesn’t always work (for example with Roberta it doesn’t work but not because of T-Ner) but it seems to work most of the time.
Thanks
Issue Analytics
- State:
- Created a year ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Revive or restore a Mac with Apple silicon using Apple ...
Step 1. Plug the Mac computers together with a supported USB-C cable, locate Apple Configurator in the Applications folder or in Launchpad, then...
Read more >Tips and Tricks to Set Up Your Apple M1 for Development
To help you take full advantage of the power of the new MacBooks, here are some tips and ... Duplicate your terminal on...
Read more >Setup Macbook M1 for Web and React Native development
Beginning to support macOS M1 and Apple Silicon or ARM-based chips. Using the terminal, you can install the Homebrew by executing the ...
Read more >How to Install iPhone or iPad Apps on an M1 Mac - MacRumors
1. Open the Mac App Store. 2. Click on your profile in the bottom left of the app. 3. Under account, choose "iPhone...
Read more >How to connect two or more external displays to an Apple ...
While the M1 and M2 MacBooks natively support just one monitor, the M1 Mac Mini does natively support up to two external monitors—one...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I feel it’s safe to stick to the original one and put the M1 support as an optional, so in version 0.1.8, I reverted it to what used to be before.
Only if you need M1 support, please update the pytorch version accordingly so that your pytorch has the method
torch.backends.mps
and TNER will automatically switch to the M1 device if it’s available.@dpicca Hi,
tner==0.1.7
is now supporting Mac M1. Please check it!