SlideShare a Scribd company logo
1 of 7
Download to read offline
みなさんの誰もが機械学習を使うことでできるクールな新しいことは聞いたことがあるのでは
ないでしょうか、そこで、私の方からはこれを Vulkan を使って実現するにはどうしたら良いの
か?という点について紹介いたします。
Everybody has heard about the cool new things that can be done using Machine Learning,
and I'm here to talk to you about how this can be achieved using Vulkan.
1. みなさん、こんにちは–私は Pierre Boudier です– NVIDIA でグラフィックスドライバーに取り
組んでおり、Khronos の Vulkan Machine Learning のサブグループの議長を務めています。 こ
のグループは 2019 年春に結成され、Vulkan に機械学習ソリューションを導入するタスクを与
えられました。
Hi everyone – I am Pierre Boudier- I work on graphics drivers at NVIDIA and I am the chair
of the Vulkan Machine Learning Subgroup at Khronos. This group was formed in spring 2019
and was tasked with bringing a machine learning solution to Vulkan.
2 Machine Learning サブグループは、ハードウェアベンダーが多くの設計に関わる貢献をし、
ソフトウェアベンダーとハードウェアベンダーの両方が要件を調査しました。 設計の目標は、
VulkanAPI の他の機能と簡単に統合できるエコシステムを実現することでした。その設計のゴ
ールは、Vulkan API の他の機能と簡単に統合できるエコシステムを実現することでした。 機械
学習は依然として盛んな研究分野であり、新しいニューラルネットワークアーキテクチャが毎年
登場しています。行列の乗算、畳み込み、relu / sigmoid / tanh のアクティベーションなど、多く
の自然な構成要素がありますが、アーキテクチャの組み合わせが爆発的に増加し、新しい算
術概念が毎週追加されています。 locality sensitive hashing、スパース行列、quantized
weights、binary weights、…
The Machine Learning subgroup received a number of design contributions from hardware
vendors, and examined requirements from both software and hardware vendors. The design
goal was to enable the eco system with an easy integration with the rest of the Vulkan API
functionality. Machine Learning is still an active area of research, and new neural network
architectures are coming out every year. While there are a number of natural building blocks
like matrix multiplication, convolution, relu/sigmoid/tanh activations, there is a combinatory
explosion of architectures, as well as new arithmetic concepts being added every week. For
instance locality sensitive hashing, sparse matrices, quantized weights, binary weights, …
ソフトウェアベンダーも Vulkan エコシステムには、他の API との相互運用を使用するよりもオ
ーバーヘッドが少なく、大規模な外部フレームワーク(Python のような)をインストールする必
要がないソリューションが必要だと、はっきりと分かっていました。
Software vendors were also clear—there is a need for a solution in the Vulkan eco system
which has lower overhead than using interop with some other API, and without having to install
large external frameworks (like python).
幸いなことに、Vulkan には最初からコンピューティング API 機能が組み込まれているため、最
初から始める必要はありませんでした。さらに、特に ML を対象とする新機能の一部には、従
来のグラフィックス/コンピューティングの使用法の枠を超える要件がありました。 その結果、
Vulkan の最初のリリースから、機械学習固有のワークフローに直接メリットをもたらす新しい
拡張機能が導入されました。
Luckily for us, we did not have to start from scratch as Vulkan already had a compute API
capability built-in from day one. Additionally, some of the new functionality specifically
targeting ML had some cross over requirements with traditional graphics/compute usage; as
a result, new extensions were introduced since the initial release of Vulkan that benefit
directly Machine Learning specific workflows.
3. では、Vulkan で ML をするとはどういうことを意味するのでしょうか?
典型的なワークフローでは、データサイエンティストは、ハイエンドのアクセラレータシステムを
使用して、デスクトップまたはクラウドでニューラルネットワークをトレーニングすることによって
ニューラルネットワークを作成します。
次に、これらのネットワークは、計算グラフの定義とパラメーターの値の両方を含む交換フォー
マットを使用してエクスポートされます。 それらのフォーマットのうち、2 つは NNEF と ONNX で
す。 NNEF は、Khronos によって定義されサポートされています。
実行時には、アプリケーションはこれらのフォーマットをロードし、「推論」(Inferencing)と呼ば
れるステップで実行できるコンパイル済みコードを生成します。そのアプリケーションは、計算
シェーダーを介して Vulkan API を使用して、GPU アクセラレーターに計算をオフロードしま
す。
So, what does it mean to do ML in Vulkan?
In a typical workflow, a data scientist will create a neural network by training it on a desktop
or in the cloud, using high end accelerator systems.
Those networks are then exported using some exchange format, which include both the
definition of the computational graph, and the values of the parameters. Two of those
formats are NNEF and ONNX; NNEF being defined and supported by Khronos.
At runtime, the application would load those formats and generate some compiled code that
can be executed in a step called “inferencing”. The application would use the Vulkan API
via compute shaders to offload the computation on the GPU accelerators.
4. では、計算シェーダーはどうやって使うのでしょうか?そして、何の精度を使うべきなのでし
ょうか?
機械学習とは、計算グラフの実行に関するものです。これは、デフォルトでは、Python フレー
ムワーク内において通常 32 ビットで実行されます。 精度は、トレーニングと推論の間で一致し
なければなりません。 実際には、実行の観点からすると、トレーニングと推論の間には、ほと
んど違いはありません。トレーニングは、勾配を逆伝播し、パラメーターを更新するために 2 つ
の追加のグラフを実行するだけです。
So how does one use compute shader and what precisions should be used ?
Machine learning is about running a computational graph, which by default is usually done in
32 bits in the python frameworks. The precision has to match between training and
inferencing. There is actually very little difference between training and inferencing from an
execution point of view: training is just running two extra graphs to backward propagate the
gradients and to update the parameters.
多くのアーキテクチャでは、実際にはフル 32 ビットよりも低い精度を使用することが可能であ
り、その結果、実行が高速になり、データストレージが削減されます。 トレーニング中に勾配の
大きさを監視して小さな値のゼロへの丸めを回避することにより、16 ビット floating を使用でき
ます。 8 ビット integer は、蒸留段階で生成される量子化ネットワークでも使用できま
す。
Vulkan は、バージョン 1.2 以降、または拡張機能 VK_KHR_shader_float16_int8 および
VK_KHR_8bit/16bit_storage を介して、これらのデータ型をネイティブにサポートします。
For many architectures, it is actually possible to use lower precision than the full 32bit, which
results in both faster execution, and reduced data storage. 16 bit floating can be used, by
monitoring the magnitude of the gradient during training to avoid round to zero for small
values. 8 bit integer can also be used in quantized network, which are generated via a
distillation phase.
Vulkan supports those data types natively since the version 1.2, or via the extensions
VK_KHR_shader_float16_int8 and VK_KHR_8bit/16bit_storage.
今後追加される拡張機能 SPV_KHR_integer_dot_product を使用すると、コンパイラの最適化に
依存することなく、整数演算を使用して最適化されたカーネルを作成できます。
An upcoming extension SPV_KHR_integer_dot_product allows to write optimized kernels using
integer math without having to rely on compiler optimization.
5. 次に、ML の Vulkan コンピューティングを改善する方法を検討しました
今後追加される拡張機能の一番目は VK_KHR_workgroup_memory_explicit_layout で、算術ユ
ニットをブロックすることなく、データをシェーダーメモリにロードする効率を向上させました。
Next, we looked into ways to improve Vulkan compute for ML
The first upcoming extension, VK_KHR_workgroup_memory_explicit_layout improved the
efficiency of loading data into shader memory without blocking the arithmetic units.
今後追加される拡張機能の 2 番目は VK_EXT_ML_primitices で、ポピュラーなニューラル
ネットのレイヤーにある一般的なビルディングブロックを公開します。これにより、ド
ライバーはより徹底的に最適化できます。
The second upcoming extension, VK_EXT_ML_primitices, exposes common building blocks
that are found in the layer of the popular neural nets, which the driver can optimize more
thoroughly.
これらの 2 つの拡張機能に関する詳しい情報は、公開され次第、共有される予定です。
More details will be shared for those two extensions once they become publicly available.
3 番目の拡張機能、VK_NV_cooperative_matrix は、既に利用可能であり、シェーダー内で使用
して、行列の乗算用に最適化された専用ハードウェアに直接アクセスできます。 これは通常、
16 ビットの float 精度を使用して matmul レイヤーと畳み込みレイヤーに対して行われます。
A third extension is already available, VK_NV_cooperative_matrix, and can be used in a shader
to directly access dedicated hardware optimized for matrix multiplications. This is typically
done for matmul and convolution layers using 16bit floating point precision.
6. 使い始めるにはどうしたら良いでしょうか
How does one get started ?
Vulkan でニューラルネットワークを実行する簡単な方法は、計算グラフをコンパイルすることで
す。 これは汎用コンパイラのおかげです。ここでは 2 つのオープンソースプロジェクトをご紹介
します。
- TVM:もともとワシントン大学で開始され、VulkanAPI 上で実行できる Spir-V にネット
ワークをコンパイルします
- MLIR / IREE:LLVM 内で開発されたマルチレベル IR(MLIR)インフラストラクチャであ
り、IR 実行エンジン(IREE)に関連付けられており、spir-V コードと関連する Vulkan API コード
の両方を生成できます。
An easy way to run neural networks in Vulkan is to compile the computational graph thanks
to a generic compiler; we will mention two open source projects:
- TVM: originally started at the university of Washington, will compile networks into
Spir-V that can be run on top of the Vulkan API
- MLIR/IREE: is a multi level IR (MLIR) infrastructure developed inside LLVM,
associated with an IR execution engine (IREE), which can generate both the spir-V code and
the associated Vulkan API code.
7. MLIR/IREE をより詳細に調べる
Google は、Vulkan ベースの推論ソリューションを開発する際、Khronos 内でずっと緊密にコラ
ボレーションしてきています。
コンパイラは、ネットワークの一般的な XLA-HLO 記述から開始します。これは、tensorflow /
pytorchpython フレームワークから生成が可能です。 その後、抽象化の複数のレベルに連続
的に低下し、それぞれがドメイン固有の方言を対象とします。 最終的な出力は、ドライバーに
よって特定の GPU ISA にコンパイルできる spir-v コードと、それらのカーネルを送信し、関連
する割り当てと同期ポイントを管理するための Vulkan API 呼び出しのリストの組み合わせとな
ります。 コンパイラーは、計算グラフ全体の統一されたビューを持ち、レイヤー間で効率的に
最適化し、不要な同期なしで操作のディスパッチをスケジュールすることが可能です。
Looking into more details of MLIR/IREE
Google has been collaborating closely at Khronos when developing their Vulkan based
inferencing solution.
The compiler starts from a generic XLA-HLO description of the network, which can be
generated from the tensorflow/pytorch python frameworks; it will then lower successively
into multiple levels of abstraction, each one of them targeting a domain specific dialect. The
last output is a combination of the spir-v code that can be compiled to a specific GPU ISA
by the driver, and a list of Vulkan API calls in order to submit those kernels and manage the
associated allocations and synchronization points.
The compiler has a unified view of the entire computational graphs, and can optimize
efficiently across layers, and schedule dispatching of operations without unnecessary
synchronizations.
8. 他のサードパーティフレームワークで、Vulkan を使用したアクセラレーションを提供してい
ますので、いくつかご紹介します。
アリババは、モバイルプラットフォームで推論とトレーニングの両方を実行できる MNN ライブラ
リを提供しています。 Tobao、Tmall、Youku、DingTalk などの最も人気のある Alibaba アプリケ
ーションの多くで使用されています
Tencent は、モバイルとデスクトップの複数のプラットフォームで推論を実行できる NCNN ライ
ブラリを提供します。 これは、WeChat、Pitu、QQ、Qzone などの人気のある Tencent アプリケ
ーションの多くで使用されています。
Ax inc は、Ailia という SDK を提供しています。これは、複数のプラットフォームに渡って、多く
のポピュラーなネットワークの高度に最適化された実装を持ち、ニューラルネットの展開に関
心のある企業向けに複数のサポートオプションを提供しています。
Other third-party frameworks do provide acceleration using Vulkan Let’s have a look at a
few:
Alibaba provides the MNN library that can do both inferencing and training on mobile
platforms. It is being used in many of the most popular Alibaba applications like Tobao, Tmall,
Youku, DingTalk, etc
Tencent provides the NCNN library that can do inferencing on multiple platforms, mobile and
desktop. It is being used by many of the popular Tencent applications such as WeChat, Pitu,
QQ, Qzone etc
Ax inc provides a SDK called Ailia which has highly optimized implementation of many of the
popular networks across multiple platforms, and provides multiple support options for
companies interested in deploying neural nets.
9. Vulkan 内には、純粋に実行されているニューラルネットの外で機械学習を行うオプション
があります。
VkFFT は、Julich で開始されたオープンソースプロジェクトであり、非常に効率的な高速フーリ
エ変換カーネルを提供し、多くの可能なパラメーターライゼーションを提供します。 画像のリサ
ンプリング、画像のレジストレーション、さらには物理シミュレーション向けの一般的なシグナル
処理でも優れた結果を示しています。
Kompute は、c ++と python の両方に統合された、複数のベンダーのグラフィックカードにデプ
ロイするためのカーネルとアルゴリズムを記述できるフレームワークです。
Unity は、強化学習(proximal policy optimization PPO、および soft actor critic SAC)に基づ
いて Unity ゲームエンジン内でインテリジェントエージェントをトレーニングするために使用でき
る ml-agent を提供しています。
There are options to do machine learning in Vulkan outside of purely running Neural Nets.
VkFFT is an open source project started at Julich which provides highly efficient fast fourrier
transform kernels, with lots of possible parametrizations. It has shown great results for image
resampling, image registration, and even in generic signal processing for physics simulation
Kompute is a framework that allows writing kernels and algorithms for deployment on multiple
vendor graphics card, with integration in both c++ and python.
Unity provides ml-agents which can be used to train intelligent agents within the Unity game
engine based on reinforcement learning (proximal policy optimization PPO, and soft actor
critic SAC).
10. みなさんへのお願いです。
以上で、現時点で利用可能な Vulkan Machine Learning の機能の概要となります。プロダクシ
ョン ドライバーは、既に多くのデバイスで出荷されています。
このグループではアプリケーションの開発者やフレームワークの開発者からのフィードバックを
絶賛募集しています。 既存のソリューションではまったく対処できないようなニーズがある場
合、または軽減できるかもしれない問題点がある場合は、遠慮なくご連絡ください。
私たちはニューラルネットのワークフローと、他の標準的な機械学習アルゴリズム(ランダムフ
ォレスト、ロジスティック回帰、t-sne、k 近傍法など)の両方に関心があります・・・
私のメールアドレスは pboudier@nvidia.com です。
Vulkan のアドバイザリーパネル参加することも、Khronos の会員になることも、どちらも皆様で
決めて頂けます。
So, Here is our Call to Action
This was an overview of the Vulkan Machine Learning capabilities that are now available:
production drivers have been shipping for a while on many devices.
We are welcoming feedback from application or framework developers; if you have needs
which are not addressed at all by the existing solutions, or you have pain points which could
be alleviated, do not hesitate to contact us.
We are interested in both neural nets workflows, and other classical machine
learning algorithms like random forest, logistic regression, t-sne, k-nearest neighbor
… My email address is pboudier@nvidia.com.
You could decide to join the Vulkan advisory panel, or even become a Khronos members.

More Related Content

What's hot

DCK Server プロトタイプ
DCK Server プロトタイプDCK Server プロトタイプ
DCK Server プロトタイプ
Etsuji Nakai
 
Aeolus Conductorによる複数環境へのデプロイ自動化
Aeolus Conductorによる複数環境へのデプロイ自動化Aeolus Conductorによる複数環境へのデプロイ自動化
Aeolus Conductorによる複数環境へのデプロイ自動化
Etsuji Nakai
 
エンジニア向け夏期特別講座 〜 Red Hat OpenStack徹底解説! 第二部 OpenStackの内部構造
エンジニア向け夏期特別講座 〜 Red Hat OpenStack徹底解説! 第二部 OpenStackの内部構造エンジニア向け夏期特別講座 〜 Red Hat OpenStack徹底解説! 第二部 OpenStackの内部構造
エンジニア向け夏期特別講座 〜 Red Hat OpenStack徹底解説! 第二部 OpenStackの内部構造
Etsuji Nakai
 
クラウドが実現するソフト開発・運用の変革と自動化
クラウドが実現するソフト開発・運用の変革と自動化クラウドが実現するソフト開発・運用の変革と自動化
クラウドが実現するソフト開発・運用の変革と自動化
Etsuji Nakai
 

What's hot (16)

Red Hat Enterprise Linux 7.1 Kubernetes入門
Red Hat Enterprise Linux 7.1 Kubernetes入門Red Hat Enterprise Linux 7.1 Kubernetes入門
Red Hat Enterprise Linux 7.1 Kubernetes入門
 
0から始めるコンテナの学び方(Kubernetes Novice Tokyo #14 発表資料)
0から始めるコンテナの学び方(Kubernetes Novice Tokyo #14 発表資料)0から始めるコンテナの学び方(Kubernetes Novice Tokyo #14 発表資料)
0から始めるコンテナの学び方(Kubernetes Novice Tokyo #14 発表資料)
 
DCK Server プロトタイプ
DCK Server プロトタイプDCK Server プロトタイプ
DCK Server プロトタイプ
 
完全分散エッジ処理で実現するNeutron仮想ネットワーク
完全分散エッジ処理で実現するNeutron仮想ネットワーク完全分散エッジ処理で実現するNeutron仮想ネットワーク
完全分散エッジ処理で実現するNeutron仮想ネットワーク
 
TECH TALK 2021/08/10 一歩進んだQlikアプリの開発~Qlik専用QVDファイルでシステムの効率アップ
TECH TALK 2021/08/10 一歩進んだQlikアプリの開発~Qlik専用QVDファイルでシステムの効率アップTECH TALK 2021/08/10 一歩進んだQlikアプリの開発~Qlik専用QVDファイルでシステムの効率アップ
TECH TALK 2021/08/10 一歩進んだQlikアプリの開発~Qlik専用QVDファイルでシステムの効率アップ
 
Red Hat Enterprise Linux OpenStack Platform環境でのDocker活用テクニック
Red Hat Enterprise Linux OpenStack Platform環境でのDocker活用テクニックRed Hat Enterprise Linux OpenStack Platform環境でのDocker活用テクニック
Red Hat Enterprise Linux OpenStack Platform環境でのDocker活用テクニック
 
Open Shift v3 主要機能と内部構造のご紹介
Open Shift v3 主要機能と内部構造のご紹介Open Shift v3 主要機能と内部構造のご紹介
Open Shift v3 主要機能と内部構造のご紹介
 
ERP FAS DESIGN
ERP FAS DESIGNERP FAS DESIGN
ERP FAS DESIGN
 
1076: CUDAデバッグ・プロファイリング入門
1076: CUDAデバッグ・プロファイリング入門1076: CUDAデバッグ・プロファイリング入門
1076: CUDAデバッグ・プロファイリング入門
 
Aeolus Conductorによる複数環境へのデプロイ自動化
Aeolus Conductorによる複数環境へのデプロイ自動化Aeolus Conductorによる複数環境へのデプロイ自動化
Aeolus Conductorによる複数環境へのデプロイ自動化
 
エンジニア向け夏期特別講座 〜 Red Hat OpenStack徹底解説! 第二部 OpenStackの内部構造
エンジニア向け夏期特別講座 〜 Red Hat OpenStack徹底解説! 第二部 OpenStackの内部構造エンジニア向け夏期特別講座 〜 Red Hat OpenStack徹底解説! 第二部 OpenStackの内部構造
エンジニア向け夏期特別講座 〜 Red Hat OpenStack徹底解説! 第二部 OpenStackの内部構造
 
コンテナ未経験新人が学ぶコンテナ技術入門
コンテナ未経験新人が学ぶコンテナ技術入門コンテナ未経験新人が学ぶコンテナ技術入門
コンテナ未経験新人が学ぶコンテナ技術入門
 
クラウドが実現するソフト開発・運用の変革と自動化
クラウドが実現するソフト開発・運用の変革と自動化クラウドが実現するソフト開発・運用の変革と自動化
クラウドが実現するソフト開発・運用の変革と自動化
 
What's new in open shift container platform 4.7 japan_20210318
What's new in open shift container platform 4.7 japan_20210318What's new in open shift container platform 4.7 japan_20210318
What's new in open shift container platform 4.7 japan_20210318
 
20160902 hyperscale #04
20160902 hyperscale #0420160902 hyperscale #04
20160902 hyperscale #04
 
D1-2-OS2_オンプレミスのVMワークロードをGCPへ移行する
D1-2-OS2_オンプレミスのVMワークロードをGCPへ移行するD1-2-OS2_オンプレミスのVMワークロードをGCPへ移行する
D1-2-OS2_オンプレミスのVMワークロードをGCPへ移行する
 

Similar to Vulkan ML JP Translation

Intalio japan special cloud workshop
Intalio japan special cloud workshopIntalio japan special cloud workshop
Intalio japan special cloud workshop
Daisuke Sugai
 
Hpc server講習会第3回応用編
Hpc server講習会第3回応用編Hpc server講習会第3回応用編
Hpc server講習会第3回応用編
Osamu Masutani
 
クラウド開発に役立つ OSS あれこれ
クラウド開発に役立つ OSS あれこれクラウド開発に役立つ OSS あれこれ
クラウド開発に役立つ OSS あれこれ
Masataka MIZUNO
 

Similar to Vulkan ML JP Translation (20)

Machine configoperatorのちょっとイイかもしれない話
Machine configoperatorのちょっとイイかもしれない話 Machine configoperatorのちょっとイイかもしれない話
Machine configoperatorのちょっとイイかもしれない話
 
機械学習プロジェクトにおける Cloud AI Platform の使い方 (2018-11-19)
機械学習プロジェクトにおける Cloud AI Platform の使い方 (2018-11-19)機械学習プロジェクトにおける Cloud AI Platform の使い方 (2018-11-19)
機械学習プロジェクトにおける Cloud AI Platform の使い方 (2018-11-19)
 
EnrootとPyxisで快適コンテナ生活
EnrootとPyxisで快適コンテナ生活EnrootとPyxisで快適コンテナ生活
EnrootとPyxisで快適コンテナ生活
 
Azure Machine Learning Build 2020
Azure Machine Learning Build 2020Azure Machine Learning Build 2020
Azure Machine Learning Build 2020
 
Transfer Learning & API Azure
Transfer Learning & API AzureTransfer Learning & API Azure
Transfer Learning & API Azure
 
Pivotal Application Service とProject riff
Pivotal Application Service とProject riffPivotal Application Service とProject riff
Pivotal Application Service とProject riff
 
Intalio japan special cloud workshop
Intalio japan special cloud workshopIntalio japan special cloud workshop
Intalio japan special cloud workshop
 
Hpc server講習会第3回応用編
Hpc server講習会第3回応用編Hpc server講習会第3回応用編
Hpc server講習会第3回応用編
 
「NVIDIA プロファイラを用いたPyTorch学習最適化手法のご紹介(修正版)」
「NVIDIA プロファイラを用いたPyTorch学習最適化手法のご紹介(修正版)」「NVIDIA プロファイラを用いたPyTorch学習最適化手法のご紹介(修正版)」
「NVIDIA プロファイラを用いたPyTorch学習最適化手法のご紹介(修正版)」
 
12 総合演習Word Pressの利用
12 総合演習Word Pressの利用12 総合演習Word Pressの利用
12 総合演習Word Pressの利用
 
Netapp rancher agenda_210129
Netapp rancher agenda_210129Netapp rancher agenda_210129
Netapp rancher agenda_210129
 
エヌビディアが加速するディープラーニング ~進化するニューラルネットワークとその開発方法について~
エヌビディアが加速するディープラーニング ~進化するニューラルネットワークとその開発方法について~エヌビディアが加速するディープラーニング ~進化するニューラルネットワークとその開発方法について~
エヌビディアが加速するディープラーニング ~進化するニューラルネットワークとその開発方法について~
 
研究を加速するChainerファミリー
研究を加速するChainerファミリー研究を加速するChainerファミリー
研究を加速するChainerファミリー
 
「NVIDIA プロファイラを用いたPyTorch学習最適化手法のご紹介(修正前 typoあり)」
「NVIDIA プロファイラを用いたPyTorch学習最適化手法のご紹介(修正前 typoあり)」「NVIDIA プロファイラを用いたPyTorch学習最適化手法のご紹介(修正前 typoあり)」
「NVIDIA プロファイラを用いたPyTorch学習最適化手法のご紹介(修正前 typoあり)」
 
クラウド開発に役立つ OSS あれこれ
クラウド開発に役立つ OSS あれこれクラウド開発に役立つ OSS あれこれ
クラウド開発に役立つ OSS あれこれ
 
Tech Dojo 02/09 IBM Japan CSM
Tech Dojo 02/09 IBM Japan CSMTech Dojo 02/09 IBM Japan CSM
Tech Dojo 02/09 IBM Japan CSM
 
Optuna on Kubeflow Pipeline 分散ハイパラチューニング
Optuna on Kubeflow Pipeline 分散ハイパラチューニングOptuna on Kubeflow Pipeline 分散ハイパラチューニング
Optuna on Kubeflow Pipeline 分散ハイパラチューニング
 
第0回bluemixユーザー会 Bluemix最新情報 BMXUG
第0回bluemixユーザー会 Bluemix最新情報 BMXUG第0回bluemixユーザー会 Bluemix最新情報 BMXUG
第0回bluemixユーザー会 Bluemix最新情報 BMXUG
 
Azure Antenna AI 概要
Azure Antenna AI 概要Azure Antenna AI 概要
Azure Antenna AI 概要
 
20180729 Preferred Networksの機械学習クラスタを支える技術
20180729 Preferred Networksの機械学習クラスタを支える技術20180729 Preferred Networksの機械学習クラスタを支える技術
20180729 Preferred Networksの機械学習クラスタを支える技術
 

More from The Khronos Group Inc.

More from The Khronos Group Inc. (20)

OpenXR 1.0 Reference Guide
OpenXR 1.0 Reference GuideOpenXR 1.0 Reference Guide
OpenXR 1.0 Reference Guide
 
glTF overview JP Translation
glTF overview JP TranslationglTF overview JP Translation
glTF overview JP Translation
 
Khronos Overview JP Translation
Khronos Overview JP TranslationKhronos Overview JP Translation
Khronos Overview JP Translation
 
Vulkan Update Japan Virtual Open House Feb 2021
Vulkan Update Japan Virtual Open House Feb 2021Vulkan Update Japan Virtual Open House Feb 2021
Vulkan Update Japan Virtual Open House Feb 2021
 
Vulkan Ray Tracing Update Japan Virtual Open House Feb 2021
Vulkan Ray Tracing Update Japan Virtual Open House Feb 2021Vulkan Ray Tracing Update Japan Virtual Open House Feb 2021
Vulkan Ray Tracing Update Japan Virtual Open House Feb 2021
 
OpenCL Overview Japan Virtual Open House Feb 2021
OpenCL Overview Japan Virtual Open House Feb 2021OpenCL Overview Japan Virtual Open House Feb 2021
OpenCL Overview Japan Virtual Open House Feb 2021
 
Vulkan ML Japan Virtual Open House Feb 2021
Vulkan ML Japan Virtual Open House Feb 2021Vulkan ML Japan Virtual Open House Feb 2021
Vulkan ML Japan Virtual Open House Feb 2021
 
glTF Overview Japan Virtual Open House Feb 2021
glTF Overview Japan Virtual Open House Feb 2021glTF Overview Japan Virtual Open House Feb 2021
glTF Overview Japan Virtual Open House Feb 2021
 
Khronos Overview Japan Virtual Open House Feb 2021
Khronos Overview Japan Virtual Open House Feb 2021Khronos Overview Japan Virtual Open House Feb 2021
Khronos Overview Japan Virtual Open House Feb 2021
 
SYCL 2020 Specification
SYCL 2020 SpecificationSYCL 2020 Specification
SYCL 2020 Specification
 
OpenCL 3.0 Reference Guide
OpenCL 3.0 Reference GuideOpenCL 3.0 Reference Guide
OpenCL 3.0 Reference Guide
 
OpenVX 1.3 Reference Guide
OpenVX 1.3 Reference GuideOpenVX 1.3 Reference Guide
OpenVX 1.3 Reference Guide
 
OpenXR 0.90 Overview Guide
OpenXR 0.90 Overview GuideOpenXR 0.90 Overview Guide
OpenXR 0.90 Overview Guide
 
Vulkan 1.1 Reference Guide
Vulkan 1.1 Reference GuideVulkan 1.1 Reference Guide
Vulkan 1.1 Reference Guide
 
SYCL 1.2.1 Reference Card
SYCL 1.2.1 Reference CardSYCL 1.2.1 Reference Card
SYCL 1.2.1 Reference Card
 
OpenCL 2.2 Reference Guide
OpenCL 2.2 Reference GuideOpenCL 2.2 Reference Guide
OpenCL 2.2 Reference Guide
 
OpenGL 4.6 Reference Guide
OpenGL 4.6 Reference GuideOpenGL 4.6 Reference Guide
OpenGL 4.6 Reference Guide
 
glTF 2.0 Reference Guide
glTF 2.0 Reference GuideglTF 2.0 Reference Guide
glTF 2.0 Reference Guide
 
OpenVX 1.2 Reference Guide
OpenVX 1.2 Reference GuideOpenVX 1.2 Reference Guide
OpenVX 1.2 Reference Guide
 
WebGL 2.0 Reference Guide
WebGL 2.0 Reference GuideWebGL 2.0 Reference Guide
WebGL 2.0 Reference Guide
 

Recently uploaded

Recently uploaded (11)

LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイスLoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
 
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
 
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
 
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
 
Utilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native IntegrationsUtilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native Integrations
 
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
 
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
 
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
 
新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半        2024/04/26の勉強会で発表されたものです。新人研修 後半        2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。
 
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルLoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
 
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
 

Vulkan ML JP Translation

  • 1. みなさんの誰もが機械学習を使うことでできるクールな新しいことは聞いたことがあるのでは ないでしょうか、そこで、私の方からはこれを Vulkan を使って実現するにはどうしたら良いの か?という点について紹介いたします。 Everybody has heard about the cool new things that can be done using Machine Learning, and I'm here to talk to you about how this can be achieved using Vulkan. 1. みなさん、こんにちは–私は Pierre Boudier です– NVIDIA でグラフィックスドライバーに取り 組んでおり、Khronos の Vulkan Machine Learning のサブグループの議長を務めています。 こ のグループは 2019 年春に結成され、Vulkan に機械学習ソリューションを導入するタスクを与 えられました。 Hi everyone – I am Pierre Boudier- I work on graphics drivers at NVIDIA and I am the chair of the Vulkan Machine Learning Subgroup at Khronos. This group was formed in spring 2019 and was tasked with bringing a machine learning solution to Vulkan. 2 Machine Learning サブグループは、ハードウェアベンダーが多くの設計に関わる貢献をし、 ソフトウェアベンダーとハードウェアベンダーの両方が要件を調査しました。 設計の目標は、 VulkanAPI の他の機能と簡単に統合できるエコシステムを実現することでした。その設計のゴ ールは、Vulkan API の他の機能と簡単に統合できるエコシステムを実現することでした。 機械 学習は依然として盛んな研究分野であり、新しいニューラルネットワークアーキテクチャが毎年 登場しています。行列の乗算、畳み込み、relu / sigmoid / tanh のアクティベーションなど、多く の自然な構成要素がありますが、アーキテクチャの組み合わせが爆発的に増加し、新しい算 術概念が毎週追加されています。 locality sensitive hashing、スパース行列、quantized weights、binary weights、… The Machine Learning subgroup received a number of design contributions from hardware vendors, and examined requirements from both software and hardware vendors. The design goal was to enable the eco system with an easy integration with the rest of the Vulkan API functionality. Machine Learning is still an active area of research, and new neural network architectures are coming out every year. While there are a number of natural building blocks like matrix multiplication, convolution, relu/sigmoid/tanh activations, there is a combinatory explosion of architectures, as well as new arithmetic concepts being added every week. For instance locality sensitive hashing, sparse matrices, quantized weights, binary weights, … ソフトウェアベンダーも Vulkan エコシステムには、他の API との相互運用を使用するよりもオ ーバーヘッドが少なく、大規模な外部フレームワーク(Python のような)をインストールする必 要がないソリューションが必要だと、はっきりと分かっていました。
  • 2. Software vendors were also clear—there is a need for a solution in the Vulkan eco system which has lower overhead than using interop with some other API, and without having to install large external frameworks (like python). 幸いなことに、Vulkan には最初からコンピューティング API 機能が組み込まれているため、最 初から始める必要はありませんでした。さらに、特に ML を対象とする新機能の一部には、従 来のグラフィックス/コンピューティングの使用法の枠を超える要件がありました。 その結果、 Vulkan の最初のリリースから、機械学習固有のワークフローに直接メリットをもたらす新しい 拡張機能が導入されました。 Luckily for us, we did not have to start from scratch as Vulkan already had a compute API capability built-in from day one. Additionally, some of the new functionality specifically targeting ML had some cross over requirements with traditional graphics/compute usage; as a result, new extensions were introduced since the initial release of Vulkan that benefit directly Machine Learning specific workflows. 3. では、Vulkan で ML をするとはどういうことを意味するのでしょうか? 典型的なワークフローでは、データサイエンティストは、ハイエンドのアクセラレータシステムを 使用して、デスクトップまたはクラウドでニューラルネットワークをトレーニングすることによって ニューラルネットワークを作成します。 次に、これらのネットワークは、計算グラフの定義とパラメーターの値の両方を含む交換フォー マットを使用してエクスポートされます。 それらのフォーマットのうち、2 つは NNEF と ONNX で す。 NNEF は、Khronos によって定義されサポートされています。 実行時には、アプリケーションはこれらのフォーマットをロードし、「推論」(Inferencing)と呼ば れるステップで実行できるコンパイル済みコードを生成します。そのアプリケーションは、計算 シェーダーを介して Vulkan API を使用して、GPU アクセラレーターに計算をオフロードしま す。 So, what does it mean to do ML in Vulkan? In a typical workflow, a data scientist will create a neural network by training it on a desktop or in the cloud, using high end accelerator systems. Those networks are then exported using some exchange format, which include both the definition of the computational graph, and the values of the parameters. Two of those formats are NNEF and ONNX; NNEF being defined and supported by Khronos. At runtime, the application would load those formats and generate some compiled code that can be executed in a step called “inferencing”. The application would use the Vulkan API via compute shaders to offload the computation on the GPU accelerators. 4. では、計算シェーダーはどうやって使うのでしょうか?そして、何の精度を使うべきなのでし ょうか?
  • 3. 機械学習とは、計算グラフの実行に関するものです。これは、デフォルトでは、Python フレー ムワーク内において通常 32 ビットで実行されます。 精度は、トレーニングと推論の間で一致し なければなりません。 実際には、実行の観点からすると、トレーニングと推論の間には、ほと んど違いはありません。トレーニングは、勾配を逆伝播し、パラメーターを更新するために 2 つ の追加のグラフを実行するだけです。 So how does one use compute shader and what precisions should be used ? Machine learning is about running a computational graph, which by default is usually done in 32 bits in the python frameworks. The precision has to match between training and inferencing. There is actually very little difference between training and inferencing from an execution point of view: training is just running two extra graphs to backward propagate the gradients and to update the parameters. 多くのアーキテクチャでは、実際にはフル 32 ビットよりも低い精度を使用することが可能であ り、その結果、実行が高速になり、データストレージが削減されます。 トレーニング中に勾配の 大きさを監視して小さな値のゼロへの丸めを回避することにより、16 ビット floating を使用でき ます。 8 ビット integer は、蒸留段階で生成される量子化ネットワークでも使用できま す。 Vulkan は、バージョン 1.2 以降、または拡張機能 VK_KHR_shader_float16_int8 および VK_KHR_8bit/16bit_storage を介して、これらのデータ型をネイティブにサポートします。 For many architectures, it is actually possible to use lower precision than the full 32bit, which results in both faster execution, and reduced data storage. 16 bit floating can be used, by monitoring the magnitude of the gradient during training to avoid round to zero for small values. 8 bit integer can also be used in quantized network, which are generated via a distillation phase. Vulkan supports those data types natively since the version 1.2, or via the extensions VK_KHR_shader_float16_int8 and VK_KHR_8bit/16bit_storage. 今後追加される拡張機能 SPV_KHR_integer_dot_product を使用すると、コンパイラの最適化に 依存することなく、整数演算を使用して最適化されたカーネルを作成できます。 An upcoming extension SPV_KHR_integer_dot_product allows to write optimized kernels using integer math without having to rely on compiler optimization. 5. 次に、ML の Vulkan コンピューティングを改善する方法を検討しました 今後追加される拡張機能の一番目は VK_KHR_workgroup_memory_explicit_layout で、算術ユ ニットをブロックすることなく、データをシェーダーメモリにロードする効率を向上させました。 Next, we looked into ways to improve Vulkan compute for ML
  • 4. The first upcoming extension, VK_KHR_workgroup_memory_explicit_layout improved the efficiency of loading data into shader memory without blocking the arithmetic units. 今後追加される拡張機能の 2 番目は VK_EXT_ML_primitices で、ポピュラーなニューラル ネットのレイヤーにある一般的なビルディングブロックを公開します。これにより、ド ライバーはより徹底的に最適化できます。 The second upcoming extension, VK_EXT_ML_primitices, exposes common building blocks that are found in the layer of the popular neural nets, which the driver can optimize more thoroughly. これらの 2 つの拡張機能に関する詳しい情報は、公開され次第、共有される予定です。 More details will be shared for those two extensions once they become publicly available. 3 番目の拡張機能、VK_NV_cooperative_matrix は、既に利用可能であり、シェーダー内で使用 して、行列の乗算用に最適化された専用ハードウェアに直接アクセスできます。 これは通常、 16 ビットの float 精度を使用して matmul レイヤーと畳み込みレイヤーに対して行われます。 A third extension is already available, VK_NV_cooperative_matrix, and can be used in a shader to directly access dedicated hardware optimized for matrix multiplications. This is typically done for matmul and convolution layers using 16bit floating point precision. 6. 使い始めるにはどうしたら良いでしょうか How does one get started ? Vulkan でニューラルネットワークを実行する簡単な方法は、計算グラフをコンパイルすることで す。 これは汎用コンパイラのおかげです。ここでは 2 つのオープンソースプロジェクトをご紹介 します。 - TVM:もともとワシントン大学で開始され、VulkanAPI 上で実行できる Spir-V にネット ワークをコンパイルします - MLIR / IREE:LLVM 内で開発されたマルチレベル IR(MLIR)インフラストラクチャであ り、IR 実行エンジン(IREE)に関連付けられており、spir-V コードと関連する Vulkan API コード の両方を生成できます。 An easy way to run neural networks in Vulkan is to compile the computational graph thanks to a generic compiler; we will mention two open source projects: - TVM: originally started at the university of Washington, will compile networks into Spir-V that can be run on top of the Vulkan API
  • 5. - MLIR/IREE: is a multi level IR (MLIR) infrastructure developed inside LLVM, associated with an IR execution engine (IREE), which can generate both the spir-V code and the associated Vulkan API code. 7. MLIR/IREE をより詳細に調べる Google は、Vulkan ベースの推論ソリューションを開発する際、Khronos 内でずっと緊密にコラ ボレーションしてきています。 コンパイラは、ネットワークの一般的な XLA-HLO 記述から開始します。これは、tensorflow / pytorchpython フレームワークから生成が可能です。 その後、抽象化の複数のレベルに連続 的に低下し、それぞれがドメイン固有の方言を対象とします。 最終的な出力は、ドライバーに よって特定の GPU ISA にコンパイルできる spir-v コードと、それらのカーネルを送信し、関連 する割り当てと同期ポイントを管理するための Vulkan API 呼び出しのリストの組み合わせとな ります。 コンパイラーは、計算グラフ全体の統一されたビューを持ち、レイヤー間で効率的に 最適化し、不要な同期なしで操作のディスパッチをスケジュールすることが可能です。 Looking into more details of MLIR/IREE Google has been collaborating closely at Khronos when developing their Vulkan based inferencing solution. The compiler starts from a generic XLA-HLO description of the network, which can be generated from the tensorflow/pytorch python frameworks; it will then lower successively into multiple levels of abstraction, each one of them targeting a domain specific dialect. The last output is a combination of the spir-v code that can be compiled to a specific GPU ISA by the driver, and a list of Vulkan API calls in order to submit those kernels and manage the associated allocations and synchronization points. The compiler has a unified view of the entire computational graphs, and can optimize efficiently across layers, and schedule dispatching of operations without unnecessary synchronizations. 8. 他のサードパーティフレームワークで、Vulkan を使用したアクセラレーションを提供してい ますので、いくつかご紹介します。 アリババは、モバイルプラットフォームで推論とトレーニングの両方を実行できる MNN ライブラ リを提供しています。 Tobao、Tmall、Youku、DingTalk などの最も人気のある Alibaba アプリケ ーションの多くで使用されています Tencent は、モバイルとデスクトップの複数のプラットフォームで推論を実行できる NCNN ライ ブラリを提供します。 これは、WeChat、Pitu、QQ、Qzone などの人気のある Tencent アプリケ ーションの多くで使用されています。
  • 6. Ax inc は、Ailia という SDK を提供しています。これは、複数のプラットフォームに渡って、多く のポピュラーなネットワークの高度に最適化された実装を持ち、ニューラルネットの展開に関 心のある企業向けに複数のサポートオプションを提供しています。 Other third-party frameworks do provide acceleration using Vulkan Let’s have a look at a few: Alibaba provides the MNN library that can do both inferencing and training on mobile platforms. It is being used in many of the most popular Alibaba applications like Tobao, Tmall, Youku, DingTalk, etc Tencent provides the NCNN library that can do inferencing on multiple platforms, mobile and desktop. It is being used by many of the popular Tencent applications such as WeChat, Pitu, QQ, Qzone etc Ax inc provides a SDK called Ailia which has highly optimized implementation of many of the popular networks across multiple platforms, and provides multiple support options for companies interested in deploying neural nets. 9. Vulkan 内には、純粋に実行されているニューラルネットの外で機械学習を行うオプション があります。 VkFFT は、Julich で開始されたオープンソースプロジェクトであり、非常に効率的な高速フーリ エ変換カーネルを提供し、多くの可能なパラメーターライゼーションを提供します。 画像のリサ ンプリング、画像のレジストレーション、さらには物理シミュレーション向けの一般的なシグナル 処理でも優れた結果を示しています。 Kompute は、c ++と python の両方に統合された、複数のベンダーのグラフィックカードにデプ ロイするためのカーネルとアルゴリズムを記述できるフレームワークです。 Unity は、強化学習(proximal policy optimization PPO、および soft actor critic SAC)に基づ いて Unity ゲームエンジン内でインテリジェントエージェントをトレーニングするために使用でき る ml-agent を提供しています。 There are options to do machine learning in Vulkan outside of purely running Neural Nets. VkFFT is an open source project started at Julich which provides highly efficient fast fourrier transform kernels, with lots of possible parametrizations. It has shown great results for image resampling, image registration, and even in generic signal processing for physics simulation
  • 7. Kompute is a framework that allows writing kernels and algorithms for deployment on multiple vendor graphics card, with integration in both c++ and python. Unity provides ml-agents which can be used to train intelligent agents within the Unity game engine based on reinforcement learning (proximal policy optimization PPO, and soft actor critic SAC). 10. みなさんへのお願いです。 以上で、現時点で利用可能な Vulkan Machine Learning の機能の概要となります。プロダクシ ョン ドライバーは、既に多くのデバイスで出荷されています。 このグループではアプリケーションの開発者やフレームワークの開発者からのフィードバックを 絶賛募集しています。 既存のソリューションではまったく対処できないようなニーズがある場 合、または軽減できるかもしれない問題点がある場合は、遠慮なくご連絡ください。 私たちはニューラルネットのワークフローと、他の標準的な機械学習アルゴリズム(ランダムフ ォレスト、ロジスティック回帰、t-sne、k 近傍法など)の両方に関心があります・・・ 私のメールアドレスは pboudier@nvidia.com です。 Vulkan のアドバイザリーパネル参加することも、Khronos の会員になることも、どちらも皆様で 決めて頂けます。 So, Here is our Call to Action This was an overview of the Vulkan Machine Learning capabilities that are now available: production drivers have been shipping for a while on many devices. We are welcoming feedback from application or framework developers; if you have needs which are not addressed at all by the existing solutions, or you have pain points which could be alleviated, do not hesitate to contact us. We are interested in both neural nets workflows, and other classical machine learning algorithms like random forest, logistic regression, t-sne, k-nearest neighbor … My email address is pboudier@nvidia.com. You could decide to join the Vulkan advisory panel, or even become a Khronos members.