question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add Mac M1 Support

See original GitHub issue

First 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:closed
  • Created a year ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
asahi417commented, Oct 1, 2022

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.

1reaction
asahi417commented, Sep 30, 2022

@dpicca Hi, tner==0.1.7 is now supporting Mac M1. Please check it!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found