Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/3087 Reviewed-by: zouap <zouap@pcl.ac.cn>pull/3162/head
@@ -88,7 +88,7 @@ type AiModelQueryOptions struct { | |||||
} | } | ||||
func (a *AiModelConvert) IsGpuTrainTask() bool { | func (a *AiModelConvert) IsGpuTrainTask() bool { | ||||
if a.SrcEngine == 0 || a.SrcEngine == 1 { | |||||
if a.SrcEngine == 0 || a.SrcEngine == 1 || a.SrcEngine == 4 || a.SrcEngine == 6 { | |||||
return true | return true | ||||
} | } | ||||
return false | return false | ||||
@@ -702,8 +702,12 @@ var ( | |||||
GPU_PYTORCH_IMAGE string | GPU_PYTORCH_IMAGE string | ||||
GpuQueue string | GpuQueue string | ||||
GPU_TENSORFLOW_IMAGE string | GPU_TENSORFLOW_IMAGE string | ||||
GPU_PADDLE_IMAGE string | |||||
GPU_MXNET_IMAGE string | |||||
NPU_MINDSPORE_16_IMAGE string | NPU_MINDSPORE_16_IMAGE string | ||||
PytorchOnnxBootFile string | PytorchOnnxBootFile string | ||||
PaddleOnnxBootFile string | |||||
MXnetOnnxBootFile string | |||||
PytorchTrTBootFile string | PytorchTrTBootFile string | ||||
MindsporeBootFile string | MindsporeBootFile string | ||||
TensorFlowNpuBootFile string | TensorFlowNpuBootFile string | ||||
@@ -1597,6 +1601,10 @@ func getModelConvertConfig() { | |||||
ModelConvert.NPU_PoolID = sec.Key("NPU_PoolID").MustString("pool7908321a") | ModelConvert.NPU_PoolID = sec.Key("NPU_PoolID").MustString("pool7908321a") | ||||
ModelConvert.NPU_MINDSPORE_IMAGE_ID = sec.Key("NPU_MINDSPORE_IMAGE_ID").MustInt(121) | ModelConvert.NPU_MINDSPORE_IMAGE_ID = sec.Key("NPU_MINDSPORE_IMAGE_ID").MustInt(121) | ||||
ModelConvert.NPU_TENSORFLOW_IMAGE_ID = sec.Key("NPU_TENSORFLOW_IMAGE_ID").MustInt(35) | ModelConvert.NPU_TENSORFLOW_IMAGE_ID = sec.Key("NPU_TENSORFLOW_IMAGE_ID").MustInt(35) | ||||
ModelConvert.GPU_PADDLE_IMAGE = sec.Key("GPU_PADDLE_IMAGE").MustString("dockerhub.pcl.ac.cn:5000/user-images/openi:paddle2.3.0_gpu_cuda11.2_cudnn8") | |||||
ModelConvert.GPU_MXNET_IMAGE = sec.Key("GPU_MXNET_IMAGE").MustString("dockerhub.pcl.ac.cn:5000/user-images/openi:mxnet191cu_cuda102_py37") | |||||
ModelConvert.PaddleOnnxBootFile = sec.Key("PaddleOnnxBootFile").MustString("convert_paddle.py") | |||||
ModelConvert.MXnetOnnxBootFile = sec.Key("MXnetOnnxBootFile").MustString("convert_mxnet.py") | |||||
} | } | ||||
func getModelAppConfig() { | func getModelAppConfig() { | ||||
@@ -3219,7 +3219,7 @@ view_sample = View sample | |||||
inference_output_path_rule = The inference output path is stored in the run parameter result_url. | inference_output_path_rule = The inference output path is stored in the run parameter result_url. | ||||
model_file_path_rule=The model file location is stored in the run parameter ckpt_url | model_file_path_rule=The model file location is stored in the run parameter ckpt_url | ||||
model_file_postfix_rule = The supported format of the model file is [ckpt, pb, h5, json, pkl, pth, t7, pdparams, onnx, pbtxt, keras, mlmodel, cfg, pt] | model_file_postfix_rule = The supported format of the model file is [ckpt, pb, h5, json, pkl, pth, t7, pdparams, onnx, pbtxt, keras, mlmodel, cfg, pt] | ||||
model_convert_postfix_rule = The supported format of the model file is [.pth, .pkl, .onnx, .mindir, .ckpt, .pb] | |||||
model_convert_postfix_rule = The supported format of the model file is [.pth, .pkl, .onnx, .mindir, .ckpt, .pb, .pdmodel, .pdiparams, .params, .json] | |||||
delete_task = Delete task | delete_task = Delete task | ||||
task_delete_confirm = Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered. | task_delete_confirm = Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered. | ||||
operate_confirm = confirm | operate_confirm = confirm | ||||
@@ -3239,7 +3239,7 @@ view_sample = 查看样例 | |||||
inference_output_path_rule = 推理输出路径存储在运行参数 result_url 中。 | inference_output_path_rule = 推理输出路径存储在运行参数 result_url 中。 | ||||
model_file_path_rule = 模型文件位置存储在运行参数 ckpt_url 中。 | model_file_path_rule = 模型文件位置存储在运行参数 ckpt_url 中。 | ||||
model_file_postfix_rule = 模型文件支持的格式为 [ckpt, pb, h5, json, pkl, pth, t7, pdparams, onnx, pbtxt, keras, mlmodel, cfg, pt] | model_file_postfix_rule = 模型文件支持的格式为 [ckpt, pb, h5, json, pkl, pth, t7, pdparams, onnx, pbtxt, keras, mlmodel, cfg, pt] | ||||
model_convert_postfix_rule = 模型文件支持的格式为 [.pth, .pkl, .onnx, .mindir, .ckpt, .pb] | |||||
model_convert_postfix_rule = 模型文件支持的格式为 [.pth, .pkl, .onnx, .mindir, .ckpt, .pb, .pdmodel, .pdiparams, .params, .json] | |||||
delete_task = 删除任务 | delete_task = 删除任务 | ||||
task_delete_confirm = 你确认删除该任务么?此任务一旦删除不可恢复。 | task_delete_confirm = 你确认删除该任务么?此任务一旦删除不可恢复。 | ||||
operate_confirm = 确定操作 | operate_confirm = 确定操作 | ||||
@@ -29,7 +29,9 @@ const ( | |||||
tplModelConvertInfo = "repo/modelmanage/convertshowinfo" | tplModelConvertInfo = "repo/modelmanage/convertshowinfo" | ||||
PYTORCH_ENGINE = 0 | PYTORCH_ENGINE = 0 | ||||
TENSORFLOW_ENGINE = 1 | TENSORFLOW_ENGINE = 1 | ||||
MINDSPORE_ENGIN = 2 | |||||
MINDSPORE_ENGINE = 2 | |||||
PADDLE_ENGINE = 4 | |||||
MXNET_ENGINE = 6 | |||||
ModelMountPath = "/model" | ModelMountPath = "/model" | ||||
CodeMountPath = "/code" | CodeMountPath = "/code" | ||||
DataSetMountPath = "/dataset" | DataSetMountPath = "/dataset" | ||||
@@ -395,6 +397,20 @@ func createGpuTrainJob(modelConvert *models.AiModelConvert, ctx *context.Context | |||||
deleteLocalDir(relatetiveModelPath) | deleteLocalDir(relatetiveModelPath) | ||||
dataActualPath = setting.Attachment.Minio.RealPath + setting.Attachment.Minio.Bucket + "/" + setting.CBCodePathPrefix + modelConvert.ID + "/dataset" | dataActualPath = setting.Attachment.Minio.RealPath + setting.Attachment.Minio.Bucket + "/" + setting.CBCodePathPrefix + modelConvert.ID + "/dataset" | ||||
} | } | ||||
} else if modelConvert.SrcEngine == PADDLE_ENGINE { | |||||
IMAGE_URL = setting.ModelConvert.GPU_PADDLE_IMAGE | |||||
if modelConvert.DestFormat == CONVERT_FORMAT_ONNX { | |||||
command = getGpuModelConvertCommand(modelConvert.ID, modelConvert.ModelPath, modelConvert, setting.ModelConvert.PaddleOnnxBootFile) | |||||
} else { | |||||
return errors.New("Not support the format.") | |||||
} | |||||
} else if modelConvert.SrcEngine == MXNET_ENGINE { | |||||
IMAGE_URL = setting.ModelConvert.GPU_MXNET_IMAGE | |||||
if modelConvert.DestFormat == CONVERT_FORMAT_ONNX { | |||||
command = getGpuModelConvertCommand(modelConvert.ID, modelConvert.ModelPath, modelConvert, setting.ModelConvert.MXnetOnnxBootFile) | |||||
} else { | |||||
return errors.New("Not support the format.") | |||||
} | |||||
} | } | ||||
log.Info("dataActualPath=" + dataActualPath) | log.Info("dataActualPath=" + dataActualPath) | ||||
@@ -103,7 +103,7 @@ | |||||
</span> | </span> | ||||
</div> | </div> | ||||
<div class="two wide column center padding0"> | <div class="two wide column center padding0"> | ||||
<span style="font-size: 12px;">{{if eq .SrcEngine 0}}PyTorch {{else if eq .SrcEngine 1}}TensorFlow{{else if eq .SrcEngine 2}}MindSpore {{end}}</span> | |||||
<span style="font-size: 12px;">{{if eq .SrcEngine 0}}PyTorch {{else if eq .SrcEngine 1}}TensorFlow {{else if eq .SrcEngine 2}}MindSpore {{else if eq .SrcEngine 4}}PaddlePaddle {{else if eq .SrcEngine 6}}MXNet {{end}}</span> | |||||
</div> | </div> | ||||
<div class="two wide column center padding0"> | <div class="two wide column center padding0"> | ||||
<span style="font-size: 12px;">{{if eq .DestFormat 0}}ONNX {{else if eq .DestFormat 1}}TensorRT {{end}}</span> | <span style="font-size: 12px;">{{if eq .DestFormat 0}}ONNX {{else if eq .DestFormat 1}}TensorRT {{end}}</span> | ||||
@@ -532,7 +532,7 @@ | |||||
} | } | ||||
} | } | ||||
function isModel(filename){ | function isModel(filename){ | ||||
var postfix=[".pth",".pkl",".onnx",".mindir",".ckpt",".pb"]; | |||||
var postfix=[".pth",".pkl",".onnx",".mindir",".ckpt",".pb",".pdmodel",".pdiparams",".params",".json"]; | |||||
for(var i =0; i<postfix.length;i++){ | for(var i =0; i<postfix.length;i++){ | ||||
if(filename.substring(filename.length-postfix[i].length)==postfix[i]){ | if(filename.substring(filename.length-postfix[i].length)==postfix[i]){ | ||||
return true; | return true; | ||||
@@ -568,6 +568,8 @@ | |||||
html +="<option name=\"PyTorch\" " + getSelected(0,value) + " value=\"0\">PyTorch</option>"; | html +="<option name=\"PyTorch\" " + getSelected(0,value) + " value=\"0\">PyTorch</option>"; | ||||
html +="<option name=\"TensorFlow\" " + getSelected(1,value) + " value=\"1\">TensorFlow</option>"; | html +="<option name=\"TensorFlow\" " + getSelected(1,value) + " value=\"1\">TensorFlow</option>"; | ||||
html +="<option name=\"MindSpore\" " + getSelected(2,value) + " value=\"2\">MindSpore</option>"; | html +="<option name=\"MindSpore\" " + getSelected(2,value) + " value=\"2\">MindSpore</option>"; | ||||
html +="<option name=\"PaddlePaddle\" " + getSelected(4,value) + " value=\"4\">PaddlePaddle</option>"; | |||||
html +="<option name=\"MXNet\" " + getSelected(6,value) + " value=\"6\">MXNet</option>"; | |||||
$('#SrcEngine').html(html); | $('#SrcEngine').html(html); | ||||
srcEngineChanged(); | srcEngineChanged(); | ||||
} | } | ||||
@@ -355,7 +355,7 @@ td, th { | |||||
<td class="ti-text-form-content"> | <td class="ti-text-form-content"> | ||||
<div class="text-span text-span-w"> | <div class="text-span text-span-w"> | ||||
{{if eq .SrcEngine 0}}PyTorch {{else if eq .SrcEngine 1}}Tensorflow{{else if eq .SrcEngine 2}}MindSpore {{end}} | |||||
{{if eq .SrcEngine 0}}PyTorch {{else if eq .SrcEngine 1}}Tensorflow{{else if eq .SrcEngine 2}}MindSpore {{else if eq .SrcEngine 4}}PaddlePaddle{{else if eq .SrcEngine 6}} MXNet{{end}} | |||||
</div> | </div> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||