deep learning on apache spark

17
Deep Learning on Apache Spark Yuta Imai Solutions Engineer, Hortonworks

Upload: yuta-imai

Post on 16-Apr-2017

895 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Deep Learning On Apache Spark

Deep Learning onApache SparkYuta ImaiSolutions Engineer, Hortonworks

Page 2: Deep Learning On Apache Spark

Apache Spark

Page 3: Deep Learning On Apache Spark

3 ©HortonworksInc.2011–2016.AllRightsReserved

Apache SparkÃ RDDという分散データセットを処理の基本単位としたジェネリッ

クな⼤規模データ処理のためのエンジンÃ プログラマフレンドリなAPIを提供しており⼈気が⾼いÃ Spark SQL, Spark Streaming, SparkML, GraphX, SparkR

Page 4: Deep Learning On Apache Spark

4 ©HortonworksInc.2011–2016.AllRightsReserved

sc.textFile("/some-hdfs-data")

mapmap reduceByKey collecttextFile

.flatMap(line=>line.split(""))

.map(word=>(word,1)))

.reduceByKey(_+_,3)

.collect()

RDD[String]

RDD[List[String]]

RDD[(String, Int)]

Array[(String, Int)]

RDD[(String, Int)]

すべてのデータ処理の基本単位となるRDD

RDDに対する処理のつながりをDAGとして構築し・・・

Page 5: Deep Learning On Apache Spark

5 ©HortonworksInc.2011–2016.AllRightsReserved

Driver (e.g. Zeppelin)

Executor Executor Executor

Job

Task Task

P PRDD

Task

P

Task Task

P P

Task

P

Task Task

P P

Task

P

HDFS HDFS HDFS

WorkerNode1 WorkerNode2

SparkはRDDに対する処理を分散実⾏する

構築されたDAGを分散実⾏する

Page 6: Deep Learning On Apache Spark

Deep Leaning & Spark

Page 7: Deep Learning On Apache Spark

7 ©HortonworksInc.2011–2016.AllRightsReserved

Deep Learningと分散処理Ã  ”Data Parallel”によるDeep Learningのモデルトレーニングの並列化

と、それによる処理時間の短縮

minibatch

minibatch

minibatch

minibatch

Model

シリアルに評価&モデル更新

minibatch

minibatch

minibatch

minibatch

ModelCopy

ModelCopy

ModelCopy

ModelCopy

Master

同⼀モデルのコピーによる評価の並列化。結果をMasterでモデル更新し、再度モデルを配布

Page 8: Deep Learning On Apache Spark

8 ©HortonworksInc.2011–2016.AllRightsReserved

Deep Learning on Apache SparkApache Spark上で動作するDeep Learningフレームワークの代表的な選択肢

Ã Deeplearning4j– Skymind社が開発を進めているオープンソースのプロジェク

ト。商⽤サポートあり。– その名のとおりJVMで動くことを前提に作られている。– ND4jという多次元配列取扱の

ライブラリも⼀緒に提供

citaHon:hJp://deeplearning4j.org/

Page 9: Deep Learning On Apache Spark

9 ©HortonworksInc.2011–2016.AllRightsReserved

Deep Learning on Apache SparkApache Spark上で動作するDeep Learningフレームワークの代表的な選択肢

Ã CaffeOnSpark– CaffeのSpark拡張– Yahoo! Inc.によって主に開発が進められているオープン

ソースプロジェクト。– 既存のSparkのコード資産やワークフロー資産を強調。

citaHon:hJp://yahoohadoop.tumblr.com/post/139916563586/caffeonspark-open-sourced-for-distributed-deep

Page 10: Deep Learning On Apache Spark

10 ©HortonworksInc.2011–2016.AllRightsReserved

Deep Learning on Apache SparkApache Spark上で動作するDeep Learningフレームワークの代表的な選択肢

Ã H2O on Spark(Sparkling Water)– H2O社が開発しているオープンソースプロジェクト。商⽤サ

ポートあり。– DataFrameの実装あり– FFNNのみサポート(?)

citaHon:hJps://github.com/h2oai/sparkling-water/blob/master/DEVEL.md

Page 11: Deep Learning On Apache Spark

11 ©HortonworksInc.2011–2016.AllRightsReserved

Deep Learning on Apache Spark他にも・・・

Ã SparkNetÃ TensorSparkÃ (Tensorflow)

Page 12: Deep Learning On Apache Spark

12 ©HortonworksInc.2011–2016.AllRightsReserved

Deep Learning on Apache Spark他にも・・・

Ã SparkNetÃ SparklingWarterÃ TensorSparkÃ (Tensorflow)

Page 13: Deep Learning On Apache Spark

Why Spark?(& Hortonworks)

Page 14: Deep Learning On Apache Spark

14 ©HortonworksInc.2011–2016.AllRightsReserved

Why Spark?

Ã データストアとしてのHadoop– HDFSをデータストアとして利⽤可能– 同じようにHiveからデータを取り出したデータをトレーニング

に利⽤することも– SparkはHDFSやHive他、様々なデータストアを利⽤できるの

で⼤規模なトレーニングデータの取り出しや、結果の保存などのワークフローの構築が容易

Page 15: Deep Learning On Apache Spark

15 ©HortonworksInc.2011–2016.AllRightsReserved

Why Spark?

Ã YARNによるリソース管理– Hadoopクラスタからのリソース払い出し/管理。– リソースキューを活⽤することによりワークロード管理も。– Node Labelを利⽤することにより例えばGPUノードだけを割

り当てるといったことも可能に。– もちろんリソースへのアクセスコントロールも。

1 ° ° ° ° ° ° °

° ° ° ° ° ° ° °

° ° ° ° ° ° ° n

SQLHive

PigScript-based

ETL

StreamProcessing

Storm

ML/DLSpark

YARN RM

App Master

Monitoring UI

Spark⽤にリソースを払い出し/管理

Page 16: Deep Learning On Apache Spark

16 ©HortonworksInc.2011–2016.AllRightsReserved

Why Spark?

Ã Apache Zeppelin– SparkのノートブックであるZeppelinを活⽤することでワーク

フローの構築がしやすく。

Page 17: Deep Learning On Apache Spark

17 ©HortonworksInc.2011–2016.AllRightsReserved

Deep Learning on Apache Spark on Hortonworks Data Platform

Hortonworks Data Platform 2.5 GOVERNANCE OPERATION

SBATCH,INTERACTIVE&REAL-TIMEDATAACCESS

YARN:DataOperaIngSystem(ClusterResourceManagement)

Map

Redu

ce

ApacheFalcon

ApacheSqoop

ApacheFlume

ApacheKa^a

Apache

Hive

Apache

Pig

Apache

HBa

se

Apache

Accum

ulo

Apache

Solr

Apache

Spark

Apache

Storm

1 • • • • • • • • • • •

• • • • • • • • • • • •

HDFS(HadoopDistributedFileSystem)

ApacheAmbari

ApacheZooKeeper

ApacheOozie

DeploymentChoiceLinux Windows On-

premises Cloud

ApacheAtlas

Cloudbreak

SECURITY

ApacheRanger

ApacheKnox

ApacheAtlas

HDFSEncrypHon

ISV

Engine

s

→ 周辺部の⼿間はプラットフォームに任せ  DLアプリケーションの開発にリソースを集中できる!