Macbook M1和python库 [英] Macbook m1 and python libraries

查看:43
本文介绍了Macbook M1和python库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

新的Macbook M1是否适合数据科学?

Is new macbook m1 suitable for Data Science?

数据科学python库(例如pandas,numpy,sklearn等)是否可以在macbook m1(苹果硅)芯片上工作,并且与上一代基于intel的macbook相比有多快?

Do Data Science python libraries such as pandas, numpy, sklearn etc work on the macbook m1 (Apple Silicon) chip and how fast compared to the previous generation intel based macbooks?

推荐答案

此GitHub存储库包含有关Python中的Apple M1芯片和数据科学的许多有用信息

This GitHub repository has lots of useful information about the Apple M1 chip and data science in Python https://github.com/neurolabusc/AppleSiliconForNeuroimaging. I have included representative quotes below.

TL; DR

除非您是一名开发人员,否则在短期内我将强烈劝阻科学家不要购买Apple Silicon计算机.生产性工作将需要移植核心工具.从长远来看,这种架构可能会对科学产生深远的影响.特别是如果Apple开发的服务器能够利用其CPU的出色能效(与AWS Graviton竞争)并利用Metal语言和GPU来执行计算任务(与NVidia的Tesla产品和CUDA语言相竞争).

TL;DR

Unless you are a developer, I would strongly discourage scientists from purchasing an Apple Silicon computer in the short term. Productive work will require core tools to be ported. In the longer term, this architecture could have a profound impact on science. In particular if Apple develops servers that exploit the remarkable power efficiency of their CPUs (competing with AWS Graviton) and leverage the Metal language and GPUs for compute tasks (competing with NVidia's Tesla products and CUDA language).

Apple Silicon面临的限制

该架构尚无法使用科学家所依赖的基础架构.以下是一些短期限制:

Limitations facing Apple Silicon

The infrastructure scientists depend on is not yet available for this architecture. Here are some of the short term limitations:

  • 使用流行的R,Julia和Python语言的科学家需要开源的Fortran编译器.尽管Python在Apple Silicon上可用,但Numpy和Scipy之类的工具需要Fortran编译.一种解决方案是安装类似miniconda的Python发行版并运行其pip安装程序以添加Intel程序包(此存储库中包含的脚本需要numpy,pandas和seaborn).在翻译时首先导入这些库中的一个会有一个延迟.随后,翻译后的Python库似乎运行良好.
  • 尽管Apple的C Clang编译器生成快速的本机代码,但许多科学工具将需要等到gcc,golang和gFortran编译器可用.
  • VirtualBox,VMware Fusion,Boot Camp和Parallels等工具尚不支持Apple Silicon.许多用户依靠这些工具在其macOS计算机上使用Windows和Linux程序.
  • Docker不支持Apple Silicon.这些容器在许多神经影像工具中都很流行.
  • 许多自制软件组件不支持Apple Silicon.用户将必须安装翻译后的组件或从源代码构建受支持的模块.
  • MATLAB被包括SPM在内的许多科学工具所使用.尽管Matlab可以进行翻译,但它本身尚不可用(并且将需要重新编译mex文件).
  • FSL和AFNI本身还不支持此体系结构.虽然代码可以在翻译中工作,但是创建某些本机工具必须等待编译器和库被更新.这可能需要几个月的时间.
  • 当前的M1仅具有四个高性能内核.大多数神经影像流水线结合了仅需要一个核心(M1擅长的地方)的顺序任务以及并行任务.这些并行任务可能会利用具有更多内核的CPU(如下面的Pigz和Niimath测试所示).请记住,串行和并行代码的混合体会面临Amdahls法则,额外内核的收益会递减.
  • 当前的M1最多具有16 Gb的RAM.神经影像数据集通常具有较大的内存需求(尤其是多波段加速功能,静止状态和扩散数据集).

这篇关于Macbook M1和python库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆