Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Mojo Dojo
Search
Henry Cui
October 28, 2023
Programming
280
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Mojo Dojo
Henry Cui
October 28, 2023
More Decks by Henry Cui
See All by Henry Cui
プロダクション言語モデルの情報を盗む攻撃 / Stealing Part of a Production Language Model
zchenry
1
260
Direct Preference Optimization
zchenry
0
480
Diffusion Model with Perceptual Loss
zchenry
0
530
レンズの下のLLM / LLM under the Lens
zchenry
0
240
Go with the Prompt Flow
zchenry
0
250
ことのはの力で画像の異常検知 / Anomaly Detection by Language
zchenry
0
760
驚愕の事実!LangChainが抱える問題 / Problems of LangChain
zchenry
0
340
MLOps初心者がMLflowを触る / MLflow Brief Introduction
zchenry
0
230
{{guidance}}のガイダンス / Guidance of guidance
zchenry
0
210
Other Decks in Programming
See All in Programming
What We Talk About When We Talk About XP
m_seki
2
490
Claude Codeを組織的に動かして月400PRを実現した話
happy_ryo
0
270
AWS Step Functions 大規模並列の壁を越える / jaws-sonic-2026-niigata-step-functions
kasacchiful
PRO
1
440
AI駆動開発にグラフDBを重ねてみた
satoshi256kbyte
2
780
Swift愛好会と私(ウホーイ) / Swift Fan Club and Uhooi
uhooi
0
150
AIを上手に使っていこうとしたら越境せざるを得なくなった話 〜実践1年で見えた境界を越えなければならない理由と進め方〜 / Crossing borders with AI
tomoyakitaura
4
1.1k
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
5
6.1k
tsc.rip を支える技術 / Kyoto.なんか #8
susisu
0
4.4k
DynamoDBの基礎を振り返りながらベクトル検索機能を理解する
musan
3
280
thread_parallel_with_free-threaded_Python_and_NumPy.pdf
riku_sakamoto
0
300
AI に Inclusive UI を書かせよう — Design Rules Skill で Compose UI を作り直す
theoriatec2024
1
470
ハーネス設計入門 〜プロンプト、コンテキストの次〜
kinopeee
56
38k
Featured
See All Featured
The SEO identity crisis: Don't let AI make you average
varn
0
550
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
Mobile First: as difficult as doing things right
swwweet
225
10k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
440
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
470
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
520
Prompt Engineering for Job Search
mfonobong
0
450
GraphQLとの向き合い方2022年版
quramy
50
15k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
270
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
270
Transcript
Mojo Dojo 機械学習の社会実装勉強会第28回 Henry 2023/10/28
WELCOME 2
Barbie Mojo ▪ Modular社がリリースしたPythonのスーパーセット ▪ Modular社の共同創業者・CEO Chris Lattner は、今まで SwiftやTPUなどを携わってきた
▪ MojoはPythonより何倍も速い! ▪ スーパーセットなので、既存のPytorchなどのコードもそのまま 動く! ▪ Pythonの柔軟性を維持しつつ、Rustにあるような厳密性も! 3
Mojo Toolbox ▪ Mojo driver • 実行シェル • 実行ファイルのビルドも •
Linux版とMac版がすでにリリース • 今日主に見ていく ▪ VS Code 拡張 • 文法ハイライトなど ▪ Jupyter kernel • Mojo notebookが書ける ▪ デバッグツール(未公開) 4
Mojoのインストール ▪ https://developer.modular.com/download から ▪ アカウント作成が必要 ▪ 認証コード付きのURLが生成される ▪ https://github.com/modularml/mojo/tree/main/examples
• 認証コードを使ったDocker環境も作れます 5
Hello World ▪ Mojo ▪ mainで名付けているので、別途呼び出さなくて良い ▪ mojo buildで単体で実行可能なファイルをビルド ▪
Pythonファイルの場合、怒られる • mojo hello.py ▪ mojo: error: no such command 'hello.py' • mojo build hello.py ▪ mojo: error: cannot open 'hello.py', since it does not appear to be a Mojo file (it does not end in '.mojo' or '.🔥') • mojo hello_py.mojoの場合は文法エラー 6
Hello Worldの時間 ▪ timeコマンドで計測 ▪ python hello.py は 0.017s ▪
mojo hello.mojo は 0.089s ▪ ./hello はなんと 0.005s 7
matmulベンチマーク ▪ https://github.com/modularml/mojo/blob/main/examples/m atmul.mojo に用意されている ▪ 比較用のPythonはナイーブな行列掛け算しか実装されてない ▪ mojoのほうは様々な最適化が施されている 8
matmulベンチマーク ▪ ビルド自体は0.825s ▪ ビルドした実行ファイルを実行時に下記のエラーになることが ある • Mojo/Python interoperability error:
Unable to locate a suitable libpython, please set `MOJO_PYTHON_LIBRARY` • https://github.com/modularml/mojo/issues/551 を参考に、export MOJO_PYTHON_LIBRARY="/usr/lib/x86_64-linux-gnu/libpython3 .8.so" してからビルドし直すことで解決 9
matmulベンチマーク ▪ 恐ろしい実行結果 • mojo matmul.mojo • ./matmul 10
matmulベンチマーク ▪ Pythonでforループをやめて、np.matmulを使う場合 • それでも速かった 11
まとめ ▪ mojoの紹介 ▪ 簡単なベンチマーク 12