diff --git a/_static/ascend_actions.js b/_static/ascend_actions.js
index dfb8acd..7083a7c 100644
--- a/_static/ascend_actions.js
+++ b/_static/ascend_actions.js
@@ -189,14 +189,14 @@ $(document).ready(function () {
var cann_name = parts[parts.length - 1];
// download and install driver
- $('#install_drvier').html('wget "' + driver_url + '"
sudo sh ' + driver_name + ' --full --install-for-all');
+ $('#codecell5').html('wget "' + driver_url + '"
sudo sh ' + driver_name + ' --full --install-for-all');
// download and install firmware
- $('#install_firmware').html('wget "' + firmware_url + '"
sudo sh ' + firmware_name + ' --full');
+ $('#codecell6').html('wget "' + firmware_url + '"
sudo sh ' + firmware_name + ' --full');
if (options['install_type'] === 'direct') {
// download and install cann
- $('#install_cann').html('wget "' + cann_url + '"
sh ' + cann_name + ' --install');
+ $('#codecell8').html('wget "' + cann_url + '"
sh ' + cann_name + ' --install');
// download and install kernel if exist.
if (kernel_url == null) {
@@ -207,7 +207,7 @@ $(document).ready(function () {
var kernel_name = parts[parts.length - 1];
$('#install_kernel_section').show();
// download and install kernel
- $('#install_kernel').html('wget "' + kernel_url + '"
sh ' + kernel_name + ' --install');
+ $('#codecell9').html('wget "' + kernel_url + '"
sh ' + kernel_name + ' --install');
}
$('#use_docker_section').hide();
@@ -231,7 +231,7 @@ docker run \\
-it ${docker_images[i]} bash
`;
- $('#use_docker').html(dockerCommand.trim());
+ $('#codecell11').html(dockerCommand.trim());
break;
}
}
diff --git a/_static/package_info.js b/_static/package_info.js
index 2f3bfa6..3eb753c 100644
--- a/_static/package_info.js
+++ b/_static/package_info.js
@@ -195,16 +195,19 @@ const pytorch_versions = {
'2.2.0': {
torch_npu: '2.2.0',
npu_branch: 'v2.2.0-6.0.rc1',
- cann: 'CANN 8.0.RC1'
+ cann: 'CANN 8.0.RC1',
+ docker: 'cosdt/torch:2.2.0'
},
'2.1.0': {
torch_npu: '2.1.0.post3',
npu_branch: 'v2.1.0-6.0.rc1',
- cann: 'CANN 8.0.RC1'
+ cann: 'CANN 8.0.RC1',
+ docker: 'cosdt/torch:2.1.0'
},
'2.0.1': {
torch_npu: '2.0.1.post1',
npu_branch: 'v2.1.0-5.0.0',
- cann: 'CANN 7.0.0'
+ cann: 'CANN 7.0.0',
+ docker: 'cosdt/torch:2.0.1'
}
}
\ No newline at end of file
diff --git a/_static/pytorch_actions.js b/_static/pytorch_actions.js
index 6702004..de98780 100644
--- a/_static/pytorch_actions.js
+++ b/_static/pytorch_actions.js
@@ -12,10 +12,10 @@ $(document).ready(function () {
var id = $(this).attr("id").split("-");
var category = id[0];
var value = id[1];
- if(category == 'pytorch')
- options[category] = value;
- else
+ if(category == 'cann' || category == 'pytorch_npu')
options[category] = $(this).text();
+ else
+ options[category] = value;
});
});
return options;
@@ -24,7 +24,7 @@ $(document).ready(function () {
$.update_table = function () {
var options = $.get_options();
var pytorch_version = options['pytorch'];
- match_versions = pytorch_versions[pytorch_version];
+ var match_versions = pytorch_versions[pytorch_version];
$("#pytorch_npu-version").text(match_versions['torch_npu']);
$("#cann-version").text(match_versions['cann']);
}
@@ -44,27 +44,48 @@ $(document).ready(function () {
$.gen_content = function () {
var options = $.get_options();
- if (options['install_type'] == "pip") {
+ if (options['install_type'] == "docker") {
+ var pytorch_version = options['pytorch'];
+ var match_versions = pytorch_versions[pytorch_version];
+ var dockerCommand = `
+docker run \\
+ --name cann_container \\
+ --device /dev/davinci1 \\
+ --device /dev/davinci_manager \\
+ --device /dev/devmm_svm \\
+ --device /dev/hisi_hdc \\
+ -v /usr/local/dcmi:/usr/local/dcmi \\
+ -v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \\
+ -v /usr/local/Ascend/driver/lib64/:/usr/local/Ascend/driver/lib64/ \\
+ -v /etc/ascend_install.info:/etc/ascend_install.info \\
+ -v /usr/local/Ascend/driver/version.info:/usr/local/Ascend/driver/version.info \\
+ -it ${match_versions['docker']} bash
+ `;
+
+ $('#codecell0').html(dockerCommand);
+ $('#install-pytorch-source-section').hide();
+ $('#install-pytorch-pip-section').hide();
+ $('#install-pytorch-docker-section').show();
+ } else if (options['install_type'] == "pip") {
+ $('#codecell1').html("# install torch
");
if(options['arch'] == "aarch64")
- $('#install-pytorch-pip').html("pip3 install torch==" + options['pytorch']);
+ $('#codecell1').append("pip3 install torch==" + options['pytorch']);
else
- $('#install-pytorch-pip').html("pip3 install torch=="+options['pytorch']+"+cpu --index-url https://download.pytorch.org/whl/cpu");
+ $('#codecell1').append("pip3 install torch=="+options['pytorch']+"+cpu --index-url https://download.pytorch.org/whl/cpu");
- $("#install-pytorch_npu-pip").html("pip3 install torch-npu==" + options['pytorch_npu']);
+ $("#codecell1").append("
# install torch-npu
pip3 install torch-npu==" + options['pytorch_npu']);
$('#install-pytorch-source-section').hide();
- $('#install-pytorch_npu-source-section').hide();
+ $('#install-pytorch-docker-section').hide();
$('#install-pytorch-pip-section').show();
- $('#install-pytorch_npu-pip-section').show();
} else {
- $("#install-pytorch-source-build").html("# install requirements
conda install cmake ninja
# get source
git clone -b "+options['pytorch']+" --recursive https://github.com/pytorch/pytorch
cd pytorch
git submodule update --init --recursive
# install PyTorch
pip install -r requirements.txt
export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-\"$(dirname $(which conda))/../\"}
python setup.py develop");
+ $("#codecell2").html("# install requirements
conda install cmake ninja
# get torch source
git clone -b "+options['pytorch']+" --recursive https://github.com/pytorch/pytorch
cd pytorch
git submodule update --init --recursive
# install torch
pip install -r requirements.txt
export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-\"$(dirname $(which conda))/../\"}
python setup.py develop");
- $('#install-pytorch_npu-source-build').html("# get source
git clone https://github.com/ascend/pytorch.git -b "+options['pytorch_npu']+" --depth 1 pytorch_npu
cd pytorch_npu
#install pytorch_npu
bash ci/build.sh --python=$(python --version 2>&1 | awk '{print $2}' | cut -d '.' -f 1,2)");
+ $('#codecell2').append("
# get torch-npu source
git clone https://github.com/ascend/pytorch.git -b "+options['pytorch_npu']+" --depth 1 pytorch_npu
cd pytorch_npu
#install torch-npu
bash ci/build.sh --python=$(python --version 2>&1 | awk '{print $2}' | cut -d '.' -f 1,2)");
$('#install-pytorch-pip-section').hide();
- $('#install-pytorch_npu-pip-section').hide();
+ $('#install-pytorch-docker-section').hide();
$('#install-pytorch-source-section').show();
- $('#install-pytorch_npu-source-section').show();
}
}
diff --git a/conf.py b/conf.py
index c96a9f4..07ec80f 100644
--- a/conf.py
+++ b/conf.py
@@ -33,7 +33,8 @@
extensions = [
'sphinx.ext.autodoc',
'recommonmark',
- 'sphinxext.remoteliteralinclude'
+ 'sphinxext.remoteliteralinclude',
+ 'sphinx_copybutton'
]
# Add any paths that contain templates here, relative to this directory.
diff --git a/requirements.txt b/requirements.txt
index 79debd6..ce4a18e 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,4 +2,5 @@ Sphinx
sphinx-autobuild
sphinx-rtd-theme
recommonmark
-sphinxext-remoteliteralinclude
\ No newline at end of file
+sphinxext-remoteliteralinclude
+sphinx-copybutton
\ No newline at end of file
diff --git a/sources/ascend/quick_install.rst b/sources/ascend/quick_install.rst
index b8d4160..4fdb1b7 100644
--- a/sources/ascend/quick_install.rst
+++ b/sources/ascend/quick_install.rst
@@ -3,17 +3,19 @@
跟随指导,在您的机器上快速安装昇腾环境。
-1. 系统要求
+系统要求
----------------
1.1 前置检查
^^^^^^^^^^^^^
确认昇腾AI处理器已经安装妥当
-::
+
+.. code-block:: bash
lspci | grep 'Processing accelerators'
确认操作系统架构及版本
-::
+
+.. code-block:: bash
uname -m && cat /etc/*release
@@ -28,7 +30,7 @@ Python 3.8, 3.9, 3.10
======== ========================================
-2. 环境安装
+环境安装
------------------
根据您的需求,选择合适的软件包版本:
@@ -102,14 +104,14 @@ Python 3.8, 3.9, 3.10
下载并安装
下载并安装
安装算子包(可选)
使用pip安装
-1. Python 3.8及以上
2. 支持C++17的编译器,例如clang 或者 gcc (9.4.0及以上)
使用pip安装
-1. Python 3.8 ~ 3.10
2. 支持C++17的编译器,例如clang 或者 gcc (9.4.0及以上)