From 15fd034e8d2a90f5ac9f62c6d5a32de7b73ac369 Mon Sep 17 00:00:00 2001 From: yuncliu Date: Mon, 7 Dec 2020 16:29:01 +0800 Subject: [PATCH] add install of apex for torch, gcc for tensorflow --- downloader/other_resources.json | 10 ++++++++++ playbooks/install_tensorflow.yml | 12 ++++++++++++ playbooks/task_gcc.yml | 3 --- playbooks/task_torch.yml | 6 ++++++ 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/downloader/other_resources.json b/downloader/other_resources.json index e5cf0094..56d676a0 100644 --- a/downloader/other_resources.json +++ b/downloader/other_resources.json @@ -73,5 +73,15 @@ "filename":"isl-0.16.1.tar.bz2", "url":"https://gcc.gnu.org/pub/gcc/infrastructure/isl-0.16.1.tar.bz2", "dest":"resources/" + }, + { + "filename":"apex-0.1+ascend-cp37-cp37m-linux_x86_64.whl", + "url":"https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/turing/resource/PTAdapter/V100R020C10/apex-0.1%2Bascend-cp37-cp37m-linux_x86_64.whl", + "dest":"resources/x86_64" + }, + { + "filename":"apex-0.1+ascend-cp37-cp37m-linux_aarch64.whl", + "url":"https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/turing/resource/PTAdapter/V100R020C10/apex-0.1%2Bascend-cp37-cp37m-linux_aarch64.whl", + "dest":"resources/aarch64" } ] diff --git a/playbooks/install_tensorflow.yml b/playbooks/install_tensorflow.yml index 22715e13..1959ae71 100644 --- a/playbooks/install_tensorflow.yml +++ b/playbooks/install_tensorflow.yml @@ -9,6 +9,18 @@ changed_when: false register: import_tensorflow + - name: stat gcc-7.3.0 + stat: + path: /usr/local/gcc7.3.0 + register: gcc_stat + + - name: install gcc 7.3 for centos 7.6 if not exist + import_tasks: task_gcc.yml + when: + - not gcc_stat.stat.exists + - "os_version == '7.6'" + - import_tensorflow.rc != 0 + - name: install tensorflow if import failed include_tasks: task_tensorflow.yml when: import_tensorflow.rc != 0 diff --git a/playbooks/task_gcc.yml b/playbooks/task_gcc.yml index 2f64f42b..25a81485 100644 --- a/playbooks/task_gcc.yml +++ b/playbooks/task_gcc.yml @@ -63,6 +63,3 @@ - name: make install shell: make -C ~/build/gcc-7.3.0 install when: "'0' in cxx.stdout" - register: install_result - -- debug: var=install_result diff --git a/playbooks/task_torch.yml b/playbooks/task_torch.yml index 3a4d7256..00586462 100644 --- a/playbooks/task_torch.yml +++ b/playbooks/task_torch.yml @@ -11,6 +11,12 @@ LD_LIBRARY_PATH: /usr/local/python3.7.5/lib:/usr/local/Ascend/ascend-toolkit/latest/fwkacllib/lib64:/usr/local/gcc7.3.0/lib64 register: torch_result +- name: install apex + shell: python3.7 -m pip install apex --no-index --find-links {{ resources_dir }}/`uname -m` + environment: + PATH: /usr/local/python3.7.5/bin:{{ ansible_env.PATH }} + LD_LIBRARY_PATH: /usr/local/python3.7.5/lib:/usr/local/Ascend/ascend-toolkit/latest/fwkacllib/lib64:/usr/local/gcc7.3.0/lib64 + - debug: var=torch_result - name: check torch -- Gitee