|
|
|
@@ -197,9 +197,9 @@ func (s *ShuguangAi) SubmitTensorflowTask(imageId string, cmd string, envs []str |
|
|
|
} |
|
|
|
|
|
|
|
func (s *ShuguangAi) SubmitTask(imageId string, cmd string, envs []string, params []string, resourceId string, datasetsId string, algorithmId string, aiType string) (interface{}, error) { |
|
|
|
// set algorithmId temporarily |
|
|
|
// set algorithmId temporarily for storelink submit |
|
|
|
if algorithmId == "" { |
|
|
|
algorithmId = "pytorch-mnist-fully_connected_network" |
|
|
|
algorithmId = "pytorch-mnist-fcn" |
|
|
|
} |
|
|
|
|
|
|
|
// shuguangAi提交任务 |
|
|
|
@@ -413,6 +413,7 @@ func (s *ShuguangAi) generateAlgorithmId(option *option.AiOption) error { |
|
|
|
if option.DatasetsName == "" { |
|
|
|
return errors.New("DatasetsName not set") |
|
|
|
} |
|
|
|
|
|
|
|
req := &hpcAC.GetFileListReq{Limit: 100, Path: ALGORITHM_DIR + FORWARD_SLASH + option.TaskType, Start: 0} |
|
|
|
list, err := s.svcCtx.ACRpc.GetFileList(s.ctx, req) |
|
|
|
if err != nil { |
|
|
|
@@ -426,13 +427,34 @@ func (s *ShuguangAi) generateAlgorithmId(option *option.AiOption) error { |
|
|
|
for _, file := range list.Data.FileList { |
|
|
|
ns := strings.Split(file.Name, DASH) |
|
|
|
if ns[0] == option.DatasetsName { |
|
|
|
algorithmId = option.TaskType + DASH + file.Name |
|
|
|
option.AlgorithmId = algorithmId |
|
|
|
option.AlgorithmName = ns[1] |
|
|
|
return nil |
|
|
|
algoName := ns[1] |
|
|
|
if option.AlgorithmName == "" { |
|
|
|
switch option.DatasetsName { |
|
|
|
case "cifar10": |
|
|
|
algorithmId = option.TaskType + DASH + option.DatasetsName + DASH + "cnn" |
|
|
|
option.AlgorithmId = algorithmId |
|
|
|
option.AlgorithmName = algoName |
|
|
|
return nil |
|
|
|
case "mnist": |
|
|
|
algorithmId = option.TaskType + DASH + option.DatasetsName + DASH + "fcn" |
|
|
|
option.AlgorithmId = algorithmId |
|
|
|
option.AlgorithmName = algoName |
|
|
|
return nil |
|
|
|
} |
|
|
|
} else { |
|
|
|
if algoName == option.AlgorithmName { |
|
|
|
algorithmId = option.TaskType + DASH + option.DatasetsName + DASH + algoName |
|
|
|
option.AlgorithmId = algorithmId |
|
|
|
return nil |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if algorithmId == "" { |
|
|
|
return errors.New("Algorithm does not exist") |
|
|
|
} |
|
|
|
|
|
|
|
return errors.New("failed to get AlgorithmId") |
|
|
|
} |
|
|
|
|
|
|
|
@@ -451,8 +473,10 @@ func (s *ShuguangAi) generateParams(option *option.AiOption) error { |
|
|
|
return errors.New("ResourceType not set") |
|
|
|
} |
|
|
|
|
|
|
|
//epoch := "epoch" + COMMA + "1" |
|
|
|
//option.Params = append(option.Params, epoch) |
|
|
|
if len(option.Params) == 0 { |
|
|
|
epoch := "epoch" + COMMA + "1" |
|
|
|
option.Params = append(option.Params, epoch) |
|
|
|
} |
|
|
|
|
|
|
|
switch option.ResourceType { |
|
|
|
case CPU: |
|
|
|
|