Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Build TensorFlow on SynQuacer

Build TensorFlow on SynQuacer

SynQuacer上でTensorFlowをビルドする話です。

Toshifumi NISHINAGA

July 21, 2018
Tweet

More Decks by Toshifumi NISHINAGA

Other Decks in Programming

Transcript

  1. $ who • Name: Toshifumi NISHINAGA • Attribute: Hobby embedded

    programmer • Activities: ◦ Google Summer of Code 2016(Linux foundation) ▪ https://summerofcode.withgoogle.com/archive/2016/projects/6617849892175872/ ▪ Porting Linux to ARM Cotex-M7 microcontroller. ◦ U-Boot contributor(not active recently…) • link: ◦ https://github.com/tnishinaga ◦ https://speakerdeck.com/tnishinaga 2
  2. SynQuacerを使おう • What’s this: ◦ ARM64 desktop (server) machine •

    Spec: ◦ Processor: ARM64 Cortex-A53 24 core ◦ Memory: 4GB(up to 16GB x 4 slot) ◦ HDD: 1TB ◦ LAN: 1x 1Gbps ◦ PCIe: x1 x 2, x16(actually x4) x 1 ◦ Graphic: GeForce GT710(PCIe x16) ◦ 2x USB3, 2x USB2, 2x SATA 1x 96board LS connector • Price: ◦ 130,000 yen(chip1stop) 4
  3. pipでTensorFlowインストールできない問題 • Could not find a version that requirement tensorflow

    とか言われる • AArch64向けには用意されてないっぽい(?) • ソースからビルドが必要 • 簡単インストールの予定が崩れる
  4. pip installが遅い問題 • TensorFlowを入れるためには以下のpythonパッケージが必要 ◦ six ◦ numpy ◦ wheel

    ◦ https://www.tensorflow.org/install/install_sources より • 加えて、jupyter notebookや機械学習のために色々必要 ◦ pip3 --no-cache-dir install Pillow ipykernel jupyter gast \ grpcio absl-py protobuf tensorboard scipy • 普通にpip installでインストールできる
  5. pip installが遅い原因(?) • .whlの無いやつはビルドが走る • 何故かaptで入れたnumpy等のビルドまで走る • pip installは並列ビルドしてくれないっぽい ◦

    https://stackoverflow.com/questions/26228136/pip-build-option-to-use-mu lticore • distutils(setuptools)では並列ビルドできる。でもinstallでは動いてない ◦ https://bugs.python.org/issue5309 •
  6. TensorFlow: bazelが搭載メモリを考慮しない • Bazelはビルドオプションで搭載メモリを考慮してビルドできるっぽい(?) ◦ bazel build -c opt \

    --copt="-mcpu=cortex-a53+fp" \ --verbose_failures tensorflow/tools/pip_package:build_pip_package \ --local_resources 3072,8.0,1.0
  7. virtual memory exhausted: Cannot allocate memory Target //tensorflow/tools/pip_package:build_pip_package failed to

    build INFO: Elapsed time: 24530.257s, Critical Path: 23750.57s INFO: 180 processes: 180 local. FAILED: Build did NOT complete successfully root@949cda07f529:~/tensorflow-1.9.0-rc2#