Skip to content

Commit

Permalink
Add pytorch install instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
hipudding committed Jun 3, 2024
1 parent 0ca7906 commit f61c33e
Show file tree
Hide file tree
Showing 7 changed files with 237 additions and 214 deletions.
12 changes: 6 additions & 6 deletions _static/actions.js → _static/ascend_actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,10 @@ $(document).ready(function () {
cann_version_select.trigger('change');
}

$.update_os_verions();
$.update_python_versions();
$.change_options_visible();
$.update_cann_versions();

$("#col-values").on("click", ".values-element", function () {
id = $(this).attr("id");
fields = id.split("-");
if (fields[1] == "cann_version")
if (id == "cann-version")
return;

$.reset_selection($(this));
Expand Down Expand Up @@ -276,4 +271,9 @@ $(document).ready(function () {
$('#use_docker_section').show();
}
}

$.update_os_verions();
$.update_python_versions();
$.change_options_visible();
$.update_cann_versions();
});
236 changes: 31 additions & 205 deletions _static/package_info.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const package_info = {
'8.0.RC2.alpha002': {
'8.0.RC2': {
x86_64: {
url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL V100R001C18SPC702/Ascend-cann-toolkit_8.0.RC2.alpha002_linux-x86_64.run'
},
Expand Down Expand Up @@ -31,39 +31,7 @@ const package_info = {
}
}
},
'8.0.RC2.alpha001': {
x86_64: {
url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL V100R001C18B800TP015/Ascend-cann-toolkit_8.0.RC2.alpha001_linux-x86_64.run'
},
aarch64: {
url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL V100R001C18B800TP015/Ascend-cann-toolkit_8.0.RC2.alpha001_linux-aarch64.run'
},
'910b': {
driver_version: '23.0.3',
firmware_version: '7.1.0.5.220',
firmware_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.3/Ascend-hdk-910b-npu-firmware_7.1.0.5.220.run',
kernel_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL V100R001C18B800TP015/Ascend-cann-kernels-910b_8.0.RC2.alpha001_linux.run',
x86_64: {
driver_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.3/Ascend-hdk-910b-npu-driver_23.0.3_linux-x86-64.run',
},
aarch64: {
driver_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.3/Ascend-hdk-910b-npu-driver_23.0.3_linux-aarch64.run',
}
},
'310p': {
driver_version: '23.0.1',
firmware_version: '7.1.0.4.220',
firmware_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.2.1/Ascend-hdk-310p-npu-firmware_7.1.0.4.220.run',
kernel_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL V100R001C18B800TP015/Ascend-cann-kernels-310p_8.0.RC2.alpha001_linux.run',
x86_64: {
driver_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.2.1/Ascend-hdk-310p-npu-driver_23.0.1_linux-x86-64.run',
},
aarch64: {
driver_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.2.1/Ascend-hdk-310p-npu-driver_23.0.1_linux-aarch64.run',
}
}
},
'8.0.RC1.beta1': {
'8.0.RC1': {
x86_64: {
url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN 8.0.RC1/Ascend-cann-toolkit_8.0.RC1_linux-x86_64.run'
},
Expand All @@ -83,103 +51,7 @@ const package_info = {
}
}
},
'8.0.RC1.alpha003': {
x86_64: {
url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL V100R001C17SPC703/Ascend-cann-toolkit_8.0.RC1.alpha003_linux-x86_64.run'
},
aarch64: {
url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL V100R001C17SPC703/Ascend-cann-toolkit_8.0.RC1.alpha003_linux-aarch64.run'
},
'910b': {
driver_version: '23.0.3',
firmware_version: '7.1.0.5.220',
firmware_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.3/Ascend-hdk-910b-npu-firmware_7.1.0.5.220.run',
kernel_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL V100R001C17SPC703/Ascend-cann-kernels-910b_8.0.RC1.alpha003_linux.run',
x86_64: {
driver_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.3/Ascend-hdk-910b-npu-driver_23.0.3_linux-x86-64.run',
},
aarch64: {
driver_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.3/Ascend-hdk-910b-npu-driver_23.0.3_linux-aarch64.run',
}
},
'310p': {
driver_version: '23.0.1',
firmware_version: '7.1.0.4.220',
firmware_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.2.1/Ascend-hdk-310p-npu-firmware_7.1.0.4.220.run',
kernel_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL V100R001C17SPC703/Ascend-cann-kernels-310p_8.0.RC1.alpha003_linux.run',
x86_64: {
driver_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.2.1/Ascend-hdk-310p-npu-driver_23.0.1_linux-x86-64.run',
},
aarch64: {
driver_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.2.1/Ascend-hdk-310p-npu-driver_23.0.1_linux-aarch64.run',
}
}
},
'8.0.RC1.alpha002': {
x86_64: {
url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL V100R001C17SPC702/Ascend-cann-toolkit_8.0.RC1.alpha002_linux-x86_64.run'
},
aarch64: {
url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL V100R001C17SPC702/Ascend-cann-toolkit_8.0.RC1.alpha002_linux-aarch64.run'
},
'910b': {
driver_version: '23.0.3',
firmware_version: '7.1.0.5.220',
firmware_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.3/Ascend-hdk-910b-npu-firmware_7.1.0.5.220.run',
kernel_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL V100R001C17SPC702/Ascend-cann-kernels-3910b_8.0.RC1.alpha002_linux.run',
x86_64: {
driver_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.3/Ascend-hdk-910b-npu-driver_23.0.3_linux-x86-64.run',
},
aarch64: {
driver_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.3/Ascend-hdk-910b-npu-driver_23.0.3_linux-aarch64.run',
}
},
'310p': {
driver_version: '23.0.1',
firmware_version: '7.1.0.4.220',
firmware_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.2.1/Ascend-hdk-310p-npu-firmware_7.1.0.4.220.run',
kernel_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL V100R001C17SPC702/Ascend-cann-kernels-310p_8.0.RC1.alpha002_linux.run',
x86_64: {
driver_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.2.1/Ascend-hdk-310p-npu-driver_23.0.1_linux-x86-64.run',
},
aarch64: {
driver_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.2.1/Ascend-hdk-310p-npu-driver_23.0.1_linux-aarch64.run',
}
}
},
'8.0.RC1.alpha001': {
x86_64: {
url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL V100R001C17SPC701/Ascend-cann-toolkit_8.0.RC1.alpha001_linux-x86_64.run'
},
aarch64: {
url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL V100R001C17SPC701/Ascend-cann-toolkit_8.0.RC1.alpha001_linux-aarch64.run'
},
'910b': {
driver_version: '23.0.3',
firmware_version: '7.1.0.5.220',
firmware_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.3/Ascend-hdk-910b-npu-firmware_7.1.0.5.220.run',
kernel_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL V100R001C17SPC701/Ascend-cann-kernels-910b_8.0.RC1.alpha001_linux.run',
x86_64: {
driver_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.3/Ascend-hdk-910b-npu-driver_23.0.3_linux-x86-64.run',
},
aarch64: {
driver_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.3/Ascend-hdk-910b-npu-driver_23.0.3_linux-aarch64.run',
}
},
'310p': {
driver_version: '23.0.1',
firmware_version: '7.1.0.4.220',
firmware_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.2.1/Ascend-hdk-310p-npu-firmware_7.1.0.4.220.run',
kernel_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL V100R001C17SPC701/Ascend-cann-kernels-310p_8.0.RC1.alpha001_linux.run',
x86_64: {
driver_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.2.1/Ascend-hdk-310p-npu-driver_23.0.1_linux-x86-64.run',
},
aarch64: {
driver_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.2.1/Ascend-hdk-310p-npu-driver_23.0.1_linux-aarch64.run',
}
}
},
'7.0.0.beta1': {
'7.0.0': {
x86_64: {
url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN 7.0.0/Ascend-cann-toolkit_7.0.0_linux-x86_64.run'
},
Expand Down Expand Up @@ -211,71 +83,7 @@ const package_info = {
}
}
},
'7.0.0.alpha003': {
x86_64: {
url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL V100R001C15SPC703/Ascend-cann-toolkit_7.0.0.alpha003_linux-x86_64.run'
},
aarch64: {
url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL V100R001C15SPC703/Ascend-cann-toolkit_7.0.0.alpha003_linux-aarch64.run'
},
'910b': {
driver_version: '23.0.rc3',
firmware_version: '6.4.0.4.220',
firmware_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.RC3/Ascend-hdk-910b-npu-firmware_6.4.0.4.220.run',
kernel_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL V100R001C15SPC703/Ascend-cann-kernels-910b_7.0.0.alpha003_linux.run',
x86_64: {
driver_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.RC3/Ascend-hdk-910b-npu-driver_23.0.rc3_linux-x86-64.run',
},
aarch64: {
driver_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.RC3/Ascend-hdk-910b-npu-driver_23.0.rc3_linux-aarch64.run',
}
},
'310p': {
driver_version: '23.0.rc3',
firmware_version: '7.0.0.5.242',
firmware_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.RC3/Ascend-hdk-310p-npu-firmware_7.0.0.5.242.run',
kernel_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL V100R001C15SPC703/Ascend-cann-kernels-310p_7.0.0.alpha003_linux.run',
x86_64: {
driver_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.RC3/Ascend-hdk-310p-npu-driver_23.0.rc3_linux-x86-64.run',
},
aarch64: {
driver_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.RC3/Ascend-hdk-310p-npu-driver_23.0.rc3_linux-aarch64.run',
}
}
},
'7.0.0.alpha002': {
x86_64: {
url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL V100R001C15SPC702/Ascend-cann-toolkit_7.0.0.alpha002_linux-x86_64.run'
},
aarch64: {
url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL V100R001C15SPC702/Ascend-cann-toolkit_7.0.0.alpha002_linux-aarch64.run'
},
'910b': {
driver_version: '23.0.rc3',
firmware_version: '6.4.0.4.220',
firmware_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.RC3/Ascend-hdk-910b-npu-firmware_6.4.0.4.220.run',
kernel_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL V100R001C15SPC702/Ascend-cann-kernels-910b_7.0.0.alpha002_linux.run',
x86_64: {
driver_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.RC3/Ascend-hdk-910b-npu-driver_23.0.rc3_linux-x86-64.run',
},
aarch64: {
driver_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.RC3/Ascend-hdk-910b-npu-driver_23.0.rc3_linux-aarch64.run',
}
},
'310p': {
driver_version: '23.0.rc3',
firmware_version: '7.0.0.5.242',
firmware_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.RC3/Ascend-hdk-310p-npu-firmware_7.0.0.5.242.run',
kernel_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL V100R001C15SPC702/Ascend-cann-kernels-310p_7.0.0.alpha002_linux.run',
x86_64: {
driver_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.RC3/Ascend-hdk-310p-npu-driver_23.0.rc3_linux-x86-64.run',
},
aarch64: {
driver_url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend HDK/Ascend HDK 23.0.RC3/Ascend-hdk-310p-npu-driver_23.0.rc3_linux-aarch64.run',
}
}
},
'7.0.RC1.beta1': {
'7.0.RC1': {
x86_64: {
url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN 7.0.RC1/Ascend-cann-toolkit_7.0.RC1_linux-x86_64.run'
},
Expand Down Expand Up @@ -307,7 +115,7 @@ const package_info = {
}
}
},
'6.3.RC2.alpha005': {
'6.3.RC2': {
x86_64: {
url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN 6.3.RC2/Ascend-cann-toolkit_6.3.RC2_linux-x86_64.run'
},
Expand All @@ -327,7 +135,7 @@ const package_info = {
}
}
},
'6.3.RC1.alpha003': {
'6.3.RC1': {
x86_64: {
url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN 6.3.RC1/Ascend-cann-toolkit_6.3.RC1_linux-x86_64.run'
},
Expand All @@ -346,7 +154,7 @@ const package_info = {
}
}
},
'6.0.RC1.alpha005': {
'6.0.RC1': {
x86_64: {
url: 'https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN6.0.RC1/Ascend-cann-toolkit_6.0.RC1_linux-x86_64.run'
},
Expand All @@ -369,9 +177,27 @@ const package_info = {


const docker_images = [
'cosdt/cann:8.0.rc2.alpha002-910b-ubuntu22.04-py3.10',
'cosdt/cann:8.0.rc2.alpha002-910b-ubuntu20.04-py3.10',
'cosdt/cann:8.0.rc2.alpha002-910b-ubuntu20.04-py3.9',
'cosdt/cann:8.0.rc2.alpha002-910b-ubuntu20.04-py3.8',
'cosdt/cann:8.0.rc2.alpha002-910b-openeuler22.03-py3.10',
];
'cosdt/cann:8.0.rc2-910b-ubuntu22.04-py3.10',
'cosdt/cann:8.0.rc2-910b-ubuntu20.04-py3.10',
'cosdt/cann:8.0.rc2-910b-ubuntu20.04-py3.9',
'cosdt/cann:8.0.rc2-910b-ubuntu20.04-py3.8',
'cosdt/cann:8.0.rc2-910b-openeuler22.03-py3.10',
];

const pytorch_versions = {
'2.2.0': {
torch_npu: '2.2.0',
npu_branch: 'v2.2.0-6.0.rc1',
cann: 'CANN 8.0.RC1'
},
'2.1.0': {
torch_npu: '2.1.0.post3',
npu_branch: 'v2.1.0-6.0.rc1',
cann: 'CANN 8.0.RC1'
},
'2.0.1': {
torch_npu: '2.0.1.post1',
npu_branch: 'v2.1.0-5.0.0',
cann: 'CANN 7.0.0'
}
}
74 changes: 74 additions & 0 deletions _static/pytorch_actions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
$(document).ready(function () {
$.reset_selection = function (elem) {
elem.parent().children().each(function () {
$(this).removeClass("selected");
});
}

$.get_options = function () {
var options = {};
$('#col-values').children().each(function () {
var elem = $(this).find(".selected").each(function () {
var id = $(this).attr("id").split("-");
var category = id[0];
var value = id[1];
if(category == 'pytorch')
options[category] = value;
else
options[category] = $(this).text();
});
});
return options;
}

$.update_table = function () {
var options = $.get_options();
var pytorch_version = options['pytorch'];
match_versions = pytorch_versions[pytorch_version];
$("#pytorch_npu-version").text(match_versions['torch_npu']);
$("#cann-version").text(match_versions['cann']);
}

$("#col-values").on("click", ".values-element", function () {
id = $(this).attr("id");
fields = id.split("-");
if (fields[0] == "pytorch_npu" || fields[0] == "cann")
return;

$.reset_selection($(this));
$(this).addClass("selected");
$.update_table();
$.gen_content();
});


$.gen_content = function () {
var options = $.get_options();
if (options['install_type'] == "pip") {
if(options['arch'] == "aarch64")
$('#install-pytorch-pip').html("pip3 install torch==" + options['pytorch']);
else
$('#install-pytorch-pip').html("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']);

$('#install-pytorch-source-section').hide();
$('#install-pytorch_npu-source-section').hide();
$('#install-pytorch-pip-section').show();
$('#install-pytorch_npu-pip-section').show();
} else {
$("#install-pytorch-source-build").html("# install requirements<br>conda install cmake ninja<br><br># get source<br>git clone -b "+options['pytorch']+" --recursive https://github.com/pytorch/pytorch<br>cd pytorch<br>git submodule update --init --recursive<br><br># install PyTorch<br>pip install -r requirements.txt<br>export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-\"$(dirname $(which conda))/../\"}<br>python setup.py develop");

$('#install-pytorch_npu-source-build').html("# get source<br>git clone https://github.com/ascend/pytorch.git -b "+options['pytorch_npu']+" --depth 1 pytorch_npu<br>cd pytorch_npu<br><br>#install pytorch_npu<br>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-source-section').show();
$('#install-pytorch_npu-source-section').show();
}

}

$.update_table();
$.gen_content();
});
1 change: 0 additions & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,4 @@

def setup(app):
app.add_css_file('custom.css')
app.add_js_file('actions.js')
app.add_js_file('package_info.js')
Loading

0 comments on commit f61c33e

Please sign in to comment.