成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

比C語言還快20%!Mojo首個大模型開放下載,性能達Python版250倍

開發 前端
帶來這個版本的老哥是一位前Meta工程師Aydyn Tairov。他利用Mojo的SIMD(Single Instruction Multiple Data,單指令多數據)和向量化原語,將llama2.py轉化為Mojo,性能較Python版本提升了近250倍。

專為AI而來的新語言Mojo,推理LLaMA2性能比Python提升250倍!

比C語言也要快上20%。

上周五才開放下載,Mojo這么快就自證實力了。

要知道,之前官方號稱Mojo可以比Python快6.8萬倍。

而且作者表示,其實還有進一步提升的空間。

這也展示了通過Mojo進行硬件優化的潛力。

OpenAI創始成員Karpathy已經趕來圍觀了。

目前,LLaMA.mojo已開放下載~

幾行代碼即可下載

帶來這個版本的老哥是一位前Meta工程師Aydyn Tairov。

他利用Mojo的SIMD(Single Instruction Multiple Data,單指令多數據)和向量化原語,將llama2.py轉化為Mojo,性能較Python版本提升了近250倍。

即便在快速運行模式下,Mojo版本也比C語言版本性能提升15-20%。

不過作者嘗試了在Mojo中使用并行模式,速度就慢了很多。

作者進行性能比較的系統和硬件情況如下:

如果你也想下載運行這個模型,需要先在環境中安裝配置Mojo(文檔鏈接見文末)。

首先將存儲庫保存到保存項目時的文件夾:

git clone https://github.com/tairov/llama2.mojo.git

然后打開存儲文件夾:

cd llama2.mojo

下面就可以下載模型:

wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories15M.bin

然后即可運行:

mojo llama2.mojo
num hardware threads:  6  SIMD vector width:  8
checkpoint size:  60816028
<s>
Once upon a time, there was a little girl named Lily. She loved to play outside in the sunshine. One day, she saw a big, red ball in the sky. It was the sun! She thought it was so pretty.
Lily wanted to play with the ball, but it was too high up in the sky. She tried to jump and reach it, but she couldn't. Then, she had an idea. She would use a stick to knock the ball down.Lily found a stick and tried to hit the ball. But the stick was too short. She tried again and again, but she couldn't reach it. She felt sad.
Suddenly, a kind man came by and saw Lily. He asked her what was wrong. Lily told him about the ball. The man smiled and said, "I have a useful idea!" He took out a long stick and used it to knock the ball down. Lily was so happy! She thanked the man and they played together in the sunshine.
<s>
Once upon a time, there was a little girl named Lily. She loved to play outside in the sunshine. One day, she saw a big, red
achieved tok/s:  264.24870466321244

為啥Mojo這么快?

不過話說回來,為啥Mojo的速度可以這么快?

這還得從Mojo的來歷說起。

它誕生于今年5月,專為AI領域開發,由LLVM之父和Swift之父Chris Lattner帶來。

它兼顧了Python和C++的優點,語法簡單、運行快,而且可以和任何Python庫無縫交互。

自從上線以來,Mojo已經吸引了12萬開發者,GitHub星標達9K。

今年8月,Mojo背后公司Modular新獲1億美元融資,總融資金額達1.3億美元。

Mojo語言這么快的原因,可以歸結為4點。

第1步,通過類型注釋消除Python動態類型的損失,并做代數簡化(algebraic simplifications),避免開方運算以及簡化復數平方運算,達到89倍加速。

第2步,通過向量化實現SIMD(單指令多數據)的并行計算,并讓向量寬度以匹配CPU的FMA(浮點乘法累加單元)數量,達到874倍。

第3步,把前兩步開發好的單線程實現改成多核并行化,對于88核的系統再獲得30倍加速,與原始Python相比已經到了26000倍。

第4步,解決并行化中的加載不均衡問題,讓線程從池中動態獲取任務,得到最終結果68000倍。

幾天前,Mojo正式開放下載。目前支持Linux系統,后續將陸續添加Mac和Windows。

同時支持VSCode插件,可以實現語法高亮和代碼補全等功能。

以及也能像Python一樣在Jupyter里交互式操作。

感興趣的童鞋,可以去上手體驗一下~

GitHub地址:https://github.com/tairov/llama2.mojo

Mojo文檔:https://docs.modular.com/mojo/manual/get-started/index.html

責任編輯:武曉燕 來源: 量子位
相關推薦

2023-09-08 15:05:51

Mojo編程語言

2023-09-12 12:14:05

Python程序矢量化

2023-09-09 06:54:02

AI編程語言Mojo

2023-09-08 18:55:50

PythonNumpyAI

2009-03-13 19:30:48

2023-05-10 15:07:00

Mojo開發選項

2010-04-22 11:42:44

Symbian開發

2023-09-12 13:29:46

AI訓練

2013-09-09 15:35:35

Linux

2023-05-15 07:20:24

2013-07-31 09:22:14

Windows 8.1ISO鏡像

2009-07-23 10:11:00

Expression

2023-09-11 14:16:28

2024-01-16 16:39:33

PythonPyPy

2023-09-23 15:53:25

Ubuntu

2015-11-11 10:28:53

Windows 10UWP-Beta微博

2012-11-05 13:56:50

微軟MDOP 2012

2013-10-08 09:49:20

OS XOS X GM

2023-07-14 16:45:56

Linux鏡像

2025-02-27 09:09:45

點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 久久国产欧美一区二区三区精品 | 国产精品99久久久精品免费观看 | 91精品国产综合久久精品 | 亚洲高清av在线 | 色婷婷精品国产一区二区三区 | 欧美激情精品久久久久久变态 | 超碰伊人久久 | 国产在线h | 亚洲精品国产综合区久久久久久久 | 免费看一级毛片 | 亚洲欧洲中文 | 99久久久久久久久 | 色综合天天天天做夜夜夜夜做 | 精品自拍视频在线观看 | 欧美黑人一级爽快片淫片高清 | 国产专区在线 | av在线一区二区三区 | 中文字幕视频在线看5 | 久久久久久亚洲精品 | 成人午夜网| 亚洲欧美一区二区三区国产精品 | jizz中国日本 | 国产精品一区二区三区在线 | 先锋资源网 | 国产精品入口麻豆www | 欧美一区二区三区在线播放 | 特黄视频 | 91视频在线| 久草网站 | 在线精品国产 | 国产精品99一区二区 | 成人在线视频一区二区三区 | 产真a观专区 | 午夜免费视频 | 国产二区在线播放 | 三级在线免费 | 欧美八区 | 久久精片 | 5060网一级毛片 | 午夜视频在线观看网址 | 亚洲精选久久 |