mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-19 19:00:47 +00:00
add ORT Training on the edge installation options (#15789)
This commit is contained in:
parent
3f7d6950b9
commit
8c54baf2b1
2 changed files with 163 additions and 21 deletions
68
index.html
68
index.html
|
|
@ -559,21 +559,53 @@ Console.WriteLine(outputs[0].AsTensor<float>()[0]);</code>
|
|||
aria-hidden="true">
|
||||
<div class="row ml-0">
|
||||
<div class="col">
|
||||
|
||||
<div class="row r-wrap mb-1 mb-md-0 mr-0">
|
||||
<div class="col-md-3 r-heading">
|
||||
<h3 id="ot_selectScenario">Scenario</h3>
|
||||
<p id="ot_decriptionScenario" class="sr-only">
|
||||
Scenario list contains two items
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-9 r-content pr-0 pl-md-4" role="listbox"
|
||||
id="ot_listbox-4" aria-labelledby="ot_selectScenario"
|
||||
aria-describedby="ot_decriptionScenario">
|
||||
<div class="row ot_scenario">
|
||||
<div class="col r-option version" role="option"
|
||||
tabindex="0" aria-selected="true" id="ot_large_model">
|
||||
<span><abbr>Large Model Training</abbr></span>
|
||||
</div>
|
||||
<div class="col r-option version" role="option" tabindex="-1"
|
||||
aria-selected="false" id="ot_on_device">
|
||||
<span><abbr>On-Device Training</abbr></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row r-wrap mb-1 mb-md-0 mr-0">
|
||||
<div class="col-md-3 r-heading">
|
||||
<h3 id="ot_selectOS">Platform</h3>
|
||||
<p id="ot_decriptionOS" class="sr-only">
|
||||
Platform list contains one item
|
||||
Platform list contains three items
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-9 r-content pr-0 pl-md-4" role="listbox"
|
||||
id="ot_listbox-1" aria-labelledby="ot_selectOS"
|
||||
aria-describedby="ot_decriptionOS">
|
||||
<div class="row ot_os">
|
||||
<div class="col r-option selected" role="option" tabindex="0"
|
||||
<div class="col r-option" role="option" tabindex="0"
|
||||
aria-selected="true" id="ot_linux">
|
||||
<span>Linux</span>
|
||||
</div>
|
||||
<div class="col r-option" role="option" tabindex="0"
|
||||
aria-selected="true" id="ot_windows">
|
||||
<span>Windows</span>
|
||||
</div>
|
||||
<div class="col r-option" role="option" tabindex="0"
|
||||
aria-selected="true" id="ot_android">
|
||||
<span>Android</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -582,16 +614,32 @@ Console.WriteLine(outputs[0].AsTensor<float>()[0]);</code>
|
|||
<div class="col-md-3 r-heading">
|
||||
<h3 id="ot_selectLanguage">API</h3>
|
||||
<p id="ot_decriptionLanguage" class="sr-only">
|
||||
API list contains one item
|
||||
API list contains five items
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-9 r-content pr-0 pl-md-4" role="listbox"
|
||||
id="ot_listbox-2" aria-labelledby="ot_selectLanguage"
|
||||
aria-describedby="ot_decriptionLanguage">
|
||||
<div class="row ot_language">
|
||||
<div class="col r-option selected" role="option" tabindex="0"
|
||||
aria-selected="true" id="ot_ORTModule">
|
||||
<span>ORTModule for Pytorch</span>
|
||||
<div class="col r-option" role="option" tabindex="0"
|
||||
aria-selected="true" id="ot_python">
|
||||
<span>Python</span>
|
||||
</div>
|
||||
<div class="col r-option" role="option" tabindex="0"
|
||||
aria-selected="true" id="ot_c">
|
||||
<span>C</span>
|
||||
</div>
|
||||
<div class="col r-option" role="option" tabindex="0"
|
||||
aria-selected="true" id="ot_cplusplus">
|
||||
<span>C++</span>
|
||||
</div>
|
||||
<div class="col r-option" role="option" tabindex="0"
|
||||
aria-selected="true" id="ot_csharp">
|
||||
<span>C#</span>
|
||||
</div>
|
||||
<div class="col r-option" role="option" tabindex="0"
|
||||
aria-selected="true" id="ot_java">
|
||||
<span>Java</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -603,14 +651,14 @@ Console.WriteLine(outputs[0].AsTensor<float>()[0]);</code>
|
|||
Hardware Acceleration
|
||||
</h3>
|
||||
<p id="ot_decriptionHardwareAcceleration" class="sr-only">
|
||||
Hardware Acceleration list contains two items
|
||||
Hardware Acceleration list contains three items
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-9 r-content pr-0 pl-md-4" role="listbox"
|
||||
id="ot_listbox-4" aria-labelledby="ot_selectHardwareAcceleration"
|
||||
aria-describedby="ot_decriptionHardwareAcceleration">
|
||||
<div class="row ot_hardwareAcceleration">
|
||||
<div class="col r-option version selected" role="option"
|
||||
<div class="col r-option version" role="option"
|
||||
tabindex="0" aria-selected="true" id="ot_CUDA">
|
||||
<span><abbr>CUDA</abbr></span>
|
||||
</div>
|
||||
|
|
@ -618,6 +666,10 @@ Console.WriteLine(outputs[0].AsTensor<float>()[0]);</code>
|
|||
aria-selected="false" id="ot_ROCm">
|
||||
<span><abbr>ROCm</abbr></span>
|
||||
</div>
|
||||
<div class="col r-option version" role="option" tabindex="-1"
|
||||
aria-selected="false" id="ot_CPU">
|
||||
<span><abbr>CPU</abbr></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
116
js/script.js
116
js/script.js
|
|
@ -19,10 +19,11 @@ var opts = {
|
|||
};
|
||||
var ot_opts = {
|
||||
// os: getAnchorSelectedOS() || getDefaultSelectedOS(),
|
||||
ot_os: 'ot_linux',
|
||||
ot_scenario: '',
|
||||
ot_os: '',
|
||||
ot_architecture: 'ot_X64',
|
||||
ot_language: 'ot_ORTModule',
|
||||
ot_hardwareAcceleration: 'ot_CUDA',
|
||||
ot_language: '',
|
||||
ot_hardwareAcceleration: '',
|
||||
};
|
||||
|
||||
var os = $(".os > .r-option");
|
||||
|
|
@ -34,6 +35,7 @@ var hardwareAcceleration = $(".hardwareAcceleration > .r-option");
|
|||
var ot_os = $(".ot_os > .r-option");
|
||||
var ot_tab = $('#OT_tab');
|
||||
|
||||
var ot_scenario = $(".ot_scenario > .r-option");
|
||||
var ot_architecture = $(".ot_architecture > .r-option");
|
||||
var ot_language = $(".ot_language > .r-option");
|
||||
var ot_hardwareAcceleration = $(".ot_hardwareAcceleration > .r-option");
|
||||
|
|
@ -73,6 +75,14 @@ ot_tab.on("click", function() {
|
|||
ot_commandMessage(ot_buildMatcher());
|
||||
ot_checkValidity();
|
||||
});
|
||||
ot_scenario.on("click", function () {
|
||||
ot_selectedOption(ot_scenario, this, "ot_scenario");
|
||||
});
|
||||
ot_scenario.on("keypress keyup", function (event) {
|
||||
if (checkKeyPress(event)) {
|
||||
ot_selectedOption(ot_scenario, this, "ot_scenario");
|
||||
}
|
||||
});
|
||||
architecture.on("click", function () {
|
||||
selectedOption(architecture, this, "architecture");
|
||||
});
|
||||
|
|
@ -267,6 +277,7 @@ function checkValidity(){
|
|||
|
||||
function ot_checkValidity(){
|
||||
var current_os = ot_opts['ot_os'];
|
||||
var current_scenario = ot_opts['ot_scenario'];
|
||||
var current_lang = ot_opts['ot_language'];
|
||||
var current_arch = ot_opts['ot_architecture'];
|
||||
var current_hw = ot_opts['ot_hardwareAcceleration'];
|
||||
|
|
@ -279,6 +290,25 @@ function ot_checkValidity(){
|
|||
|
||||
var valid = Object.getOwnPropertyNames(ot_validCombos);
|
||||
|
||||
// scenario section
|
||||
for(var i =0; i<ot_scenario.length; i++){
|
||||
//disable other selections once item in category selected
|
||||
// if(ot_os[i].id!=current_os && current_os!=''){
|
||||
// $(ot_os[i]).addClass("gray");
|
||||
// continue;
|
||||
// }
|
||||
var isvalidcombo=false;
|
||||
for(var k=0; k<valid.length;k++){
|
||||
if(valid[k].indexOf(ot_scenario[i].id)!=-1 && valid[k].indexOf(current_os)!=-1 && valid[k].indexOf(current_arch)!=-1 && valid[k].indexOf(current_lang)!=-1 && valid[k].indexOf(current_hw)!=-1){
|
||||
isvalidcombo=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(isvalidcombo==false && ot_scenario[i].id!=current_scenario){
|
||||
$(ot_scenario[i]).addClass("gray");
|
||||
}
|
||||
}
|
||||
|
||||
//os section
|
||||
for(var i =0; i<ot_os.length; i++){
|
||||
//disable other selections once item in category selected
|
||||
|
|
@ -288,7 +318,7 @@ function ot_checkValidity(){
|
|||
// }
|
||||
var isvalidcombo=false;
|
||||
for(var k=0; k<valid.length;k++){
|
||||
if(valid[k].indexOf(ot_os[i].id)!=-1 && valid[k].indexOf(current_arch)!=-1 && valid[k].indexOf(current_lang)!=-1 && valid[k].indexOf(current_hw)!=-1){
|
||||
if(valid[k].indexOf(current_scenario)!=-1 && valid[k].indexOf(ot_os[i].id)!=-1 && valid[k].indexOf(current_arch)!=-1 && valid[k].indexOf(current_lang)!=-1 && valid[k].indexOf(current_hw)!=-1){
|
||||
isvalidcombo=true;
|
||||
break;
|
||||
}
|
||||
|
|
@ -307,7 +337,7 @@ function ot_checkValidity(){
|
|||
// }
|
||||
var isvalidcombo=false;
|
||||
for(var k=0; k<valid.length;k++){
|
||||
if(valid[k].indexOf(current_os)!=-1 && valid[k].indexOf(current_arch)!=-1 && valid[k].indexOf(ot_language[i].id)!=-1 && valid[k].indexOf(current_hw)!=-1){
|
||||
if(valid[k].indexOf(current_scenario)!=-1 && valid[k].indexOf(current_os)!=-1 && valid[k].indexOf(current_arch)!=-1 && valid[k].indexOf(ot_language[i].id)!=-1 && valid[k].indexOf(current_hw)!=-1){
|
||||
isvalidcombo=true;
|
||||
break;
|
||||
}
|
||||
|
|
@ -326,7 +356,7 @@ function ot_checkValidity(){
|
|||
// }
|
||||
var isvalidcombo=false;
|
||||
for(var k=0; k<valid.length;k++){
|
||||
if(valid[k].indexOf(current_os)!=-1 && valid[k].indexOf(ot_architecture[i].id)!=-1 && valid[k].indexOf(current_lang)!=-1 && valid[k].indexOf(current_hw)!=-1){
|
||||
if(valid[k].indexOf(current_scenario)!=-1 && valid[k].indexOf(current_os)!=-1 && valid[k].indexOf(ot_architecture[i].id)!=-1 && valid[k].indexOf(current_lang)!=-1 && valid[k].indexOf(current_hw)!=-1){
|
||||
isvalidcombo=true;
|
||||
break;
|
||||
}
|
||||
|
|
@ -345,7 +375,7 @@ function ot_checkValidity(){
|
|||
// }
|
||||
var isvalidcombo=false;
|
||||
for(var k=0; k<valid.length;k++){
|
||||
if(valid[k].indexOf(current_os)!=-1 && valid[k].indexOf(current_arch)!=-1 && valid[k].indexOf(current_lang)!=-1 && valid[k].indexOf(ot_hardwareAcceleration[i].id)!=-1){
|
||||
if(valid[k].indexOf(current_scenario)!=-1 && valid[k].indexOf(current_os)!=-1 && valid[k].indexOf(current_arch)!=-1 && valid[k].indexOf(current_lang)!=-1 && valid[k].indexOf(ot_hardwareAcceleration[i].id)!=-1){
|
||||
isvalidcombo=true;
|
||||
break;
|
||||
}
|
||||
|
|
@ -452,10 +482,9 @@ function ot_selectedOption(option, selection, category) {
|
|||
ot_checkValidity();
|
||||
|
||||
//if full selection is valid, don't gray out other options
|
||||
if(ot_opts['os']!="" && ot_opts['architecture']!="" && ot_opts['hardwareAcceleration']!="" && ot_opts['language']!="" && isSupported==true){
|
||||
if(ot_opts['scenario']!="" && ot_opts['os']!="" && ot_opts['architecture']!="" && ot_opts['hardwareAcceleration']!="" && ot_opts['language']!="" && isSupported==true){
|
||||
// console.log(opts);
|
||||
// ot_resetOptions();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -479,6 +508,9 @@ function resetOptions(){
|
|||
for(var i=0; i<ot_os.length;i++){
|
||||
$(ot_os[i]).removeClass("gray");
|
||||
}
|
||||
for(var i=0; i<ot_scenario.length;i++){
|
||||
$(ot_scenario[i]).removeClass("gray");
|
||||
}
|
||||
for(var i=0; i<ot_language.length;i++){
|
||||
$(ot_language[i]).removeClass("gray");
|
||||
}
|
||||
|
|
@ -525,6 +557,8 @@ function ot_buildMatcher() {
|
|||
return (
|
||||
ot_opts.ot_os +
|
||||
"," +
|
||||
ot_opts.ot_scenario +
|
||||
"," +
|
||||
ot_opts.ot_language +
|
||||
"," +
|
||||
ot_opts.ot_architecture +
|
||||
|
|
@ -535,19 +569,75 @@ function ot_buildMatcher() {
|
|||
|
||||
var ot_validCombos = {
|
||||
|
||||
"ot_linux,ot_ORTModule,ot_X64,ot_CUDA":
|
||||
"ot_linux,ot_large_model,ot_python,ot_X64,ot_CUDA":
|
||||
"pip install onnxruntime-training -f https://downloads.onnxruntime.ai/onnxruntime_stable_<b><cu_version*</b>>.html<br/>pip install torch-ort<br/>python -m torch_ort.configure<br/><br/>*</b><a href='https://download.onnxruntime.ai/' target='blank'>Available versions</a>",
|
||||
|
||||
"ot_linux,ot_ORTModule,ot_X64,ot_ROCm":
|
||||
"pip install onnxruntime-training -f https://downloads.onnxruntime.ai/onnxruntime_stable_<b><rocm_version*</b>>.html<br/>pip install torch-ort<br/>python -m torch_ort.configure<br/><br/>*<a href='https://download.onnxruntime.ai/' target='blank'>Available versions</a>"
|
||||
"ot_linux,ot_large_model,ot_python,ot_X64,ot_ROCm":
|
||||
"pip install onnxruntime-training -f https://downloads.onnxruntime.ai/onnxruntime_stable_<b><rocm_version*</b>>.html<br/>pip install torch-ort<br/>python -m torch_ort.configure<br/><br/>*<a href='https://download.onnxruntime.ai/' target='blank'>Available versions</a>",
|
||||
|
||||
"ot_linux,ot_on_device,ot_python,ot_X64,ot_CPU":
|
||||
"pip install onnxruntime-training -f https://downloads.onnxruntime.ai/onnxruntime_stable_<b><cu_version*</b>>.html<br/><br/>*</b><a href='https://download.onnxruntime.ai/' target='blank'>Available versions</a>",
|
||||
|
||||
"ot_linux,ot_on_device,ot_python,ot_X64,ot_CUDA":
|
||||
"Follow build instructions from <a href='https://onnxruntime.ai/docs/build/training.html' target='_blank'>here</a>",
|
||||
|
||||
"ot_windows,ot_on_device,ot_python,ot_X64,ot_CPU":
|
||||
"Follow build instructions from <a href='https://onnxruntime.ai/docs/build/training.html' target='_blank'>here</a>",
|
||||
|
||||
"ot_windows,ot_on_device,ot_python,ot_X64,ot_CUDA":
|
||||
"Follow build instructions from <a href='https://onnxruntime.ai/docs/build/training.html' target='_blank'>here</a>",
|
||||
|
||||
"ot_windows,ot_on_device,ot_c,ot_X64,ot_CPU":
|
||||
"Install Nuget package <a href='https://www.nuget.org/packages/Microsoft.ML.OnnxRuntime.Training' target='_blank'>Microsoft.ML.OnnxRuntime.Training</a>",
|
||||
|
||||
"ot_windows,ot_on_device,ot_cplusplus,ot_X64,ot_CPU":
|
||||
"Install Nuget package <a href='https://www.nuget.org/packages/Microsoft.ML.OnnxRuntime.Training' target='_blank'>Microsoft.ML.OnnxRuntime.Training</a>",
|
||||
|
||||
"ot_windows,ot_on_device,ot_csharp,ot_X64,ot_CPU":
|
||||
"Install Nuget package <a href='https://www.nuget.org/packages/Microsoft.ML.OnnxRuntime.Training' target='_blank'>Microsoft.ML.OnnxRuntime.Training</a>",
|
||||
|
||||
"ot_linux,ot_on_device,ot_c,ot_X64,ot_CPU":
|
||||
"Download .tgz file from <a href='https://github.com/microsoft/onnxruntime/releases' target='_blank'>Github</a> <br/>Refer to <a href='http://www.onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements' target='_blank'>docs</a> for requirements.",
|
||||
|
||||
"ot_linux,ot_on_device,ot_cplusplus,ot_X64,ot_CPU":
|
||||
"Download .tgz file from <a href='https://github.com/microsoft/onnxruntime/releases' target='_blank'>Github</a> <br/>Refer to <a href='http://www.onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements' target='_blank'>docs</a> for requirements.",
|
||||
|
||||
"ot_linux,ot_on_device,ot_csharp,ot_X64,ot_CPU":
|
||||
"Install Nuget package <a href='https://www.nuget.org/packages/Microsoft.ML.OnnxRuntime.Training' target='_blank'>Microsoft.ML.OnnxRuntime.Training</a>",
|
||||
|
||||
"ot_linux,ot_on_device,ot_c,ot_X64,ot_CUDA":
|
||||
"Follow build instructions from <a href='https://onnxruntime.ai/docs/build/training.html' target='_blank'>here</a>",
|
||||
|
||||
"ot_linux,ot_on_device,ot_cplusplus,ot_X64,ot_CUDA":
|
||||
"Follow build instructions from <a href='https://onnxruntime.ai/docs/build/training.html' target='_blank'>here</a>",
|
||||
|
||||
"ot_linux,ot_on_device,ot_csharp,ot_X64,ot_CUDA":
|
||||
"Follow build instructions from <a href='https://onnxruntime.ai/docs/build/training.html' target='_blank'>here</a>",
|
||||
|
||||
"ot_windows,ot_on_device,ot_c,ot_X64,ot_CUDA":
|
||||
"Follow build instructions from <a href='https://onnxruntime.ai/docs/build/training.html' target='_blank'>here</a>",
|
||||
|
||||
"ot_windows,ot_on_device,ot_cplusplus,ot_X64,ot_CUDA":
|
||||
"Follow build instructions from <a href='https://onnxruntime.ai/docs/build/training.html' target='_blank'>here</a>",
|
||||
|
||||
"ot_windows,ot_on_device,ot_csharp,ot_X64,ot_CUDA":
|
||||
"Follow build instructions from <a href='https://onnxruntime.ai/docs/build/training.html' target='_blank'>here</a>",
|
||||
|
||||
"ot_android,ot_on_device,ot_c,ot_X64,ot_CPU":
|
||||
"Follow installation instructions from <a href='https://onnxruntime.ai/docs/install/#install-for-on-device-training' target='_blank'>here</a>",
|
||||
|
||||
"ot_android,ot_on_device,ot_cplusplus,ot_X64,ot_CPU":
|
||||
"Follow installation instructions from <a href='https://onnxruntime.ai/docs/install/#install-for-on-device-training' target='_blank'>here</a>",
|
||||
|
||||
"ot_android,ot_on_device,ot_java,ot_X64,ot_CPU":
|
||||
"Add a dependency on <a href='https://mvnrepository.com/artifact/com.microsoft.onnxruntime/onnxruntime-training-android' target='_blank'>com.microsoft.onnxruntime:onnxruntime-training-android</a> using Maven/Gradle and refer to the instructions <a href='https://onnxruntime.ai/docs/install/#install-for-on-device-training' target='_blank'>here.</a>",
|
||||
};
|
||||
|
||||
function ot_commandMessage(key) {
|
||||
$("#ot_command").removeClass("valid");
|
||||
$("#ot_command").removeClass("invalid");
|
||||
|
||||
if(ot_opts['ot_os']=='' || ot_opts['ot_architecture'] == '' || ot_opts['ot_language']=='' || ot_opts['ot_hardwareAcceleration'] == ''){
|
||||
if(ot_opts['ot_os']=='' || ot_opts['ot_scenario'] == '' || ot_opts['ot_architecture'] == '' || ot_opts['ot_language']=='' || ot_opts['ot_hardwareAcceleration'] == ''){
|
||||
// console.log(ot_opts);
|
||||
$("#ot_command span").html(
|
||||
"Please select a combination of resources"
|
||||
|
|
|
|||
Loading…
Reference in a new issue