# Conflicts: # models/cloudbrain.gofix-2417
@@ -67,6 +67,7 @@ const ( | |||
ActionChangeUserAvatar //38 | |||
ActionCreateGrampusNPUDebugTask //39 | |||
ActionCreateGrampusGPUDebugTask //40 | |||
ActionCreateGrampusGCUDebugTask //41 | |||
) | |||
// Action represents user operation type and other information to | |||
@@ -380,7 +381,8 @@ func (a *Action) IsCloudbrainAction() bool { | |||
ActionCreateGrampusGPUDebugTask, | |||
ActionCreateGrampusNPUDebugTask, | |||
ActionCreateGrampusNPUTrainTask, | |||
ActionCreateGrampusGPUTrainTask: | |||
ActionCreateGrampusGPUTrainTask, | |||
ActionCreateGrampusGCUDebugTask: | |||
return true | |||
} | |||
return false | |||
@@ -35,6 +35,7 @@ const ( | |||
const ( | |||
NPUResource = "NPU" | |||
GPUResource = "CPU/GPU" | |||
GCUResource = "GCU" | |||
AllResource = "all" | |||
//notebook storage category | |||
@@ -135,6 +136,7 @@ const ( | |||
//ComputeResource | |||
GPU = "GPU" | |||
NPU = "NPU" | |||
GCU = "GCU" | |||
) | |||
type Cloudbrain struct { | |||
@@ -303,6 +305,9 @@ func (task *Cloudbrain) IsUserHasRight(user *User) bool { | |||
func (task *Cloudbrain) IsGPUTask() bool { | |||
return task.ComputeResource == GPUResource | |||
} | |||
func (task *Cloudbrain) IsGCUTask() bool { | |||
return task.ComputeResource == GCUResource | |||
} | |||
func (task *Cloudbrain) IsNPUTask() bool { | |||
return task.ComputeResource == NPUResource | |||
} | |||
@@ -2623,6 +2628,7 @@ type DatasetInfo struct { | |||
Name string | |||
FullName string | |||
Size int | |||
Type int | |||
} | |||
func GetDatasetInfo(uuidStr string, grampusType ...string) (map[string]DatasetInfo, string, error) { | |||
@@ -2662,8 +2668,14 @@ func GetDatasetInfo(uuidStr string, grampusType ...string) (map[string]DatasetIn | |||
if len(grampusType) > 0 { | |||
if grampusType[0] == GPU { | |||
dataLocalPath = setting.Attachment.Minio.BasePath + path.Join(attach.UUID[0:1], attach.UUID[1:2]) + "/" + attach.UUID | |||
} else { | |||
} else if grampusType[0] == NPU { | |||
dataLocalPath = setting.BasePath + path.Join(attach.UUID[0:1], attach.UUID[1:2]) + "/" + attach.UUID + "/" | |||
} else if grampusType[0] == GCU { | |||
if attach.Type == TypeCloudBrainOne { | |||
dataLocalPath = setting.Attachment.Minio.BasePath + path.Join(attach.UUID[0:1], attach.UUID[1:2]) + "/" + attach.UUID | |||
} else { | |||
dataLocalPath = setting.BasePath + path.Join(attach.UUID[0:1], attach.UUID[1:2]) + "/" + attach.UUID + "/" | |||
} | |||
} | |||
} else { | |||
@@ -2679,6 +2691,7 @@ func GetDatasetInfo(uuidStr string, grampusType ...string) (map[string]DatasetIn | |||
Name: fileName, | |||
FullName: attach.Name, | |||
Size: int(attach.Size), | |||
Type: attach.Type, | |||
} | |||
if i == 0 { | |||
datasetNames = attach.Name | |||
@@ -39,6 +39,7 @@ func GetTaskTypeFromAction(a ActionType) TaskType { | |||
ActionCreateGrampusGPUDebugTask, | |||
ActionCreateGrampusNPUDebugTask, | |||
ActionCreateGrampusNPUTrainTask, | |||
ActionCreateGrampusGCUDebugTask, | |||
ActionCreateGrampusGPUTrainTask: | |||
return TaskCreateCloudbrainTask | |||
case ActionCreateRepo: | |||
@@ -19,6 +19,7 @@ const ( | |||
ProcessorTypeNPU = "npu.huawei.com/NPU" | |||
ProcessorTypeGPU = "nvidia.com/gpu" | |||
ProcessorTypeGCU = "enflame-tech.com/gcu" | |||
GpuWorkDir = "/tmp/" | |||
NpuWorkDir = "/cache/" | |||
@@ -108,6 +109,7 @@ type GenerateNotebookJobReq struct { | |||
Spec *models.Specification | |||
CodeName string | |||
ModelPath string //参考启智GPU调试, 挂载/model目录用户的模型可以输出到这个目录 | |||
ModelStorageType int | |||
} | |||
func getEndPoint() string { | |||
@@ -148,6 +150,36 @@ func getDatasetGPUGrampus(datasetInfos map[string]models.DatasetInfo) ([]models. | |||
} | |||
return datasetGrampus, command | |||
} | |||
func getDatasetGCUGrampus(datasetInfos map[string]models.DatasetInfo) ([]models.GrampusDataset, string) { | |||
var datasetGrampus []models.GrampusDataset | |||
var command = "" | |||
obsEndPoint := getEndPoint() | |||
for uuid, datasetInfo := range datasetInfos { | |||
if datasetInfo.Type == models.TypeCloudBrainOne { | |||
datasetGrampus = append(datasetGrampus, models.GrampusDataset{ | |||
Name: datasetInfo.FullName, | |||
Bucket: setting.Attachment.Minio.Bucket, | |||
EndPoint: setting.Attachment.Minio.Endpoint, | |||
ObjectKey: datasetInfo.DataLocalPath, | |||
ReadOnly: true, | |||
ContainerPath: "/dataset1/" + datasetInfo.Name, | |||
}) | |||
command += "cp /dataset1/'" + datasetInfo.Name + "'/" + uuid + " /dataset/'" + datasetInfo.FullName + "';" | |||
} else { | |||
datasetGrampus = append(datasetGrampus, models.GrampusDataset{ | |||
Name: datasetInfo.FullName, | |||
Bucket: setting.Bucket, | |||
EndPoint: obsEndPoint, | |||
ObjectKey: datasetInfo.DataLocalPath + datasetInfo.FullName, | |||
ContainerPath: "/dataset/" + datasetInfo.Name, | |||
}) | |||
} | |||
} | |||
return datasetGrampus, command | |||
} | |||
func GenerateNotebookJob(ctx *context.Context, req *GenerateNotebookJobReq) (jobId string, err error) { | |||
createTime := timeutil.TimeStampNow() | |||
@@ -178,25 +210,45 @@ func GenerateNotebookJob(ctx *context.Context, req *GenerateNotebookJobReq) (job | |||
imageUrl = "" | |||
req.Command = "" | |||
} else { | |||
datasetGrampus, cpCommand = getDatasetGPUGrampus(req.DatasetInfos) | |||
if ProcessorTypeGCU == req.ProcessType { | |||
datasetGrampus, cpCommand = getDatasetGCUGrampus(req.DatasetInfos) | |||
} else { | |||
datasetGrampus, cpCommand = getDatasetGPUGrampus(req.DatasetInfos) | |||
} | |||
if len(req.ModelName) != 0 { | |||
datasetGrampus = append(datasetGrampus, models.GrampusDataset{ | |||
Name: req.ModelName, | |||
Bucket: setting.Attachment.Minio.Bucket, | |||
EndPoint: setting.Attachment.Minio.Endpoint, | |||
ObjectKey: req.PreTrainModelPath, | |||
ReadOnly: true, | |||
ContainerPath: cloudbrain.PretrainModelMountPath, | |||
}) | |||
if req.ModelStorageType == models.TypeCloudBrainOne { | |||
datasetGrampus = append(datasetGrampus, models.GrampusDataset{ | |||
Name: req.ModelName, | |||
Bucket: setting.Attachment.Minio.Bucket, | |||
EndPoint: setting.Attachment.Minio.Endpoint, | |||
ObjectKey: req.PreTrainModelPath, | |||
ReadOnly: true, | |||
ContainerPath: cloudbrain.PretrainModelMountPath, | |||
}) | |||
} else { | |||
datasetGrampus = append(datasetGrampus, models.GrampusDataset{ | |||
Name: req.ModelName, | |||
Bucket: setting.Bucket, | |||
EndPoint: getEndPoint(), | |||
ReadOnly: true, | |||
ObjectKey: req.PreTrainModelPath, | |||
ContainerPath: cloudbrain.PretrainModelMountPath, | |||
}) | |||
} | |||
} | |||
codeArchiveName := cloudbrain.DefaultBranchName + ".zip" | |||
codeGrampus = models.GrampusDataset{ | |||
Name: req.CodeName, | |||
Bucket: setting.Attachment.Minio.Bucket, | |||
EndPoint: setting.Attachment.Minio.Endpoint, | |||
ObjectKey: req.CodeStoragePath + cloudbrain.DefaultBranchName + ".zip", | |||
ObjectKey: req.CodeStoragePath + codeArchiveName, | |||
ReadOnly: false, | |||
ContainerPath: cloudbrain.CodeMountPath, | |||
} | |||
if ProcessorTypeGCU == req.ProcessType { | |||
imageUrl = "" | |||
} | |||
req.Command = fmt.Sprintf(CommandGpuDebug, cpCommand, setting.CullIdleTimeout, setting.CullIdleTimeout, setting.CullInterval, setting.CullIdleTimeout, setting.CullInterval) | |||
log.Info("debug command:" + req.Command) | |||
@@ -215,6 +267,7 @@ func GenerateNotebookJob(ctx *context.Context, req *GenerateNotebookJobReq) (job | |||
AutoStopDuration: autoStopDurationMs, | |||
Capacity: setting.Capacity, | |||
Command: req.Command, | |||
CenterID: req.Spec.GetAvailableCenterIds(ctx.User.ID), | |||
}, | |||
}, | |||
}) | |||
@@ -263,6 +316,8 @@ func GenerateNotebookJob(ctx *context.Context, req *GenerateNotebookJobReq) (job | |||
actionType = models.ActionCreateGrampusNPUDebugTask | |||
} else if req.ComputeResource == models.GPUResource { | |||
actionType = models.ActionCreateGrampusGPUDebugTask | |||
} else if req.ComputeResource == models.GCUResource { | |||
actionType = models.ActionCreateGrampusGCUDebugTask | |||
} | |||
task, err := models.GetCloudbrainByJobID(jobID) | |||
if err != nil { | |||
@@ -3135,6 +3135,7 @@ task_gpudebugjob=`created CPU/GPU type debugging task <a href="%s/cloudbrain/%s" | |||
task_npudebugjob=`created NPU type debugging task <a href="%s/modelarts/notebook/%s">%s</a>` | |||
task_c2net_gpudebugjob=`created CPU/GPU type debugging task <a href="%s/grampus/notebook/%s">%s</a>` | |||
task_c2net_npudebugjob=`created NPU type debugging task <a href="%s/grampus/notebook/%s">%s</a>` | |||
task_c2ent_gcudebugjob=`created GCU type debugging task <a href="%s/grampus/notebook/%s">%s</a>` | |||
task_nputrainjob=`created NPU training task <a href="%s/modelarts/train-job/%s">%s</a>` | |||
task_inferencejob=`created reasoning task <a href="%s/modelarts/inference-job/%s">%s</a>` | |||
task_benchmark=`created profiling task <a href="%s/cloudbrain/benchmark/%s">%s</a>` | |||
@@ -3154,6 +3154,7 @@ task_gpudebugjob=`创建了CPU/GPU类型调试任务 <a href="%s/cloudbrain/%s"> | |||
task_npudebugjob=`创建了NPU类型调试任务 <a href="%s/modelarts/notebook/%s">%s</a>` | |||
task_c2net_gpudebugjob=`创建了CPU/GPU类型调试任务 <a href="%s/grampus/notebook/%s">%s</a>` | |||
task_c2net_npudebugjob=`创建了NPU类型调试任务 <a href="%s/grampus/notebook/%s">%s</a>` | |||
task_c2ent_gcudebugjob=`创建了GCU类型调试任务 <a href="%s/grampus/notebook/%s">%s</a>` | |||
task_nputrainjob=`创建了NPU类型训练任务 <a href="%s/modelarts/train-job/%s">%s</a>` | |||
task_inferencejob=`创建了推理任务 <a href="%s/modelarts/inference-job/%s">%s</a>` | |||
task_benchmark=`创建了评测任务 <a href="%s/cloudbrain/benchmark/%s">%s</a>` | |||
@@ -243,11 +243,12 @@ document.onreadystatechange = function () { | |||
html += recordPrefix + actionName; | |||
html += " <a href=\"" + getRepoLink(record) + "\" rel=\"nofollow\">" + getRepotext(record) + "</a>" | |||
} | |||
else if(record.OpType == "24" || record.OpType == "26" || record.OpType == "27" || record.OpType == "28" || record.OpType == "30" || record.OpType == "31" || record.OpType == "32" || record.OpType == "33"){ | |||
else if(record.OpType == "24" || record.OpType == "26" || record.OpType == "27" || record.OpType == "28" || record.OpType == "30" | |||
|| record.OpType == "31" || record.OpType == "32" || record.OpType == "33"){ | |||
html += recordPrefix + actionName; | |||
html += " <a href=\"" + getTaskLink(record) + "\" rel=\"nofollow\">" + record.RefName + "</a>" | |||
} | |||
else if(record.OpType == "25" || record.OpType == "29" || record.OpType == "39" || record.OpType == "40"){ | |||
else if(record.OpType == "25" || record.OpType == "29" || record.OpType == "39" || record.OpType == "40" || record.OpType == "41"){ | |||
html += recordPrefix + actionName; | |||
html += " <a href=\"" + getTaskLink(record) + "\" rel=\"nofollow\">" + record.RefName + "</a>" | |||
} | |||
@@ -294,7 +295,7 @@ function getTaskLink(record){ | |||
re = re + "/cloudbrain/train-job/" + record.Content; | |||
}else if(record.OpType == 32 || record.OpType == 33){ | |||
re = re + "/grampus/train-job/" + record.Content; | |||
}else if(record.OpType == 39 || record.OpType == 40){ | |||
}else if(record.OpType == 39 || record.OpType == 40 || record.OpType == 41){ | |||
re = re + "/grampus/notebook/" + record.Content; | |||
} | |||
@@ -453,9 +454,10 @@ var actionNameZH={ | |||
"33":"创建了CPU/GPU类型训练任务", | |||
"35":"创建的数据集 {dataset} 被设置为推荐数据集", | |||
"36":"提交了镜像 {image}", | |||
"37": "提交的镜像 {image} 被设置为推荐镜像", | |||
"37":"提交的镜像 {image} 被设置为推荐镜像", | |||
"39":"创建了CPU/GPU类型调试任务", | |||
"40":"创建了NPU类型调试任务", | |||
"41":"创建了GCU类型训练任务", | |||
}; | |||
var actionNameEN={ | |||
@@ -486,9 +488,10 @@ var actionNameEN={ | |||
"33":" created CPU/GPU type training task", | |||
"35":" created dataset {dataset} was set as recommended dataset", | |||
"36":"committed image {image}", | |||
"37": "committed image {image} was set as recommended image", | |||
"37":"committed image {image} was set as recommended image", | |||
"39":" created CPU/GPU type debugging task ", | |||
"40":" created NPU type debugging task ", | |||
"41":" created GCU type debugging task ", | |||
}; | |||
var repoAndOrgZH={ | |||
@@ -76,7 +76,7 @@ func saveModelByParameters(jobId string, versionName string, name string, versio | |||
cloudType := aiTask.Type | |||
modelSelectedFile := ctx.Query("modelSelectedFile") | |||
//download model zip //train type | |||
if aiTask.ComputeResource == models.NPUResource { | |||
if aiTask.ComputeResource == models.NPUResource || aiTask.ComputeResource == models.GCUResource { | |||
cloudType = models.TypeCloudBrainTwo | |||
} else if aiTask.ComputeResource == models.GPUResource { | |||
cloudType = models.TypeCloudBrainOne | |||
@@ -54,6 +54,8 @@ const ( | |||
//NPU | |||
tplGrampusNotebookNPUNew base.TplName = "repo/grampus/notebook/npu/new" | |||
tplGrampusTrainJobNPUNew base.TplName = "repo/grampus/trainjob/npu/new" | |||
//GCU | |||
tplGrampusNotebookGCUNew base.TplName = "repo/grampus/notebook/gcu/new" | |||
) | |||
func GrampusNotebookNew(ctx *context.Context) { | |||
@@ -62,6 +64,8 @@ func GrampusNotebookNew(ctx *context.Context) { | |||
processType := grampus.ProcessorTypeGPU | |||
if notebookType == 1 { | |||
processType = grampus.ProcessorTypeNPU | |||
} else if notebookType == 2 { | |||
processType = grampus.ProcessorTypeGCU | |||
} | |||
err := grampusNotebookNewDataPrepare(ctx, processType) | |||
if err != nil { | |||
@@ -70,8 +74,10 @@ func GrampusNotebookNew(ctx *context.Context) { | |||
} | |||
if processType == grampus.ProcessorTypeGPU { | |||
ctx.HTML(http.StatusOK, tplGrampusNotebookGPUNew) | |||
} else { | |||
} else if processType == grampus.ProcessorTypeNPU { | |||
ctx.HTML(http.StatusOK, tplGrampusNotebookNPUNew) | |||
} else if processType == grampus.ProcessorTypeGCU { | |||
ctx.HTML(http.StatusOK, tplGrampusNotebookGCUNew) | |||
} | |||
} | |||
@@ -118,6 +124,12 @@ func GrampusNotebookCreate(ctx *context.Context, form auth.CreateGrampusNotebook | |||
computeSource = models.NPUResource | |||
computeSourceSimple = models.NPU | |||
codeStoragePath = grampus.JobPath + jobName + modelarts.CodePath | |||
} else if form.Type == 2 { | |||
tpl = tplGrampusNotebookGCUNew | |||
processType = grampus.ProcessorTypeGCU | |||
computeSource = models.GCUResource | |||
computeSourceSimple = models.GCU | |||
codeStoragePath = setting.CBCodePathPrefix + jobName + cloudbrain.CodeMountPath + "/" | |||
} | |||
limiterCtx := &lock.LockContext{Repo: ctx.Repo.Repository, DisplayJobName: displayJobName, User: ctx.User} | |||
@@ -221,7 +233,7 @@ func GrampusNotebookCreate(ctx *context.Context, form auth.CreateGrampusNotebook | |||
return | |||
} | |||
if processType == grampus.ProcessorTypeGPU { | |||
if processType == grampus.ProcessorTypeGPU || processType == grampus.ProcessorTypeGCU { | |||
if err := uploadCodeToMinio(codeLocalPath+"/", jobName, cloudbrain.CodeMountPath+"/"); err != nil { | |||
log.Error("Failed to uploadCodeToMinio: %s (%v)", repo.FullName(), err, ctx.Data["MsgID"]) | |||
grampusNotebookNewDataPrepare(ctx, processType) | |||
@@ -261,7 +273,7 @@ func GrampusNotebookCreate(ctx *context.Context, form auth.CreateGrampusNotebook | |||
if form.ModelName != "" { //使用预训练模型训练 | |||
_, err := models.QueryModelByPath(form.PreTrainModelUrl) | |||
m, err := models.QueryModelByPath(form.PreTrainModelUrl) | |||
if err != nil { | |||
log.Error("Can not find model", err) | |||
grampusNotebookNewDataPrepare(ctx, processType) | |||
@@ -274,7 +286,7 @@ func GrampusNotebookCreate(ctx *context.Context, form auth.CreateGrampusNotebook | |||
req.ModelVersion = form.ModelVersion | |||
req.PreTrainModelUrl = form.PreTrainModelUrl | |||
req.PreTrainModelPath = getPreTrainModelPath(form.PreTrainModelUrl, form.CkptName) | |||
req.ModelStorageType = m.Type | |||
} | |||
_, err = grampus.GenerateNotebookJob(ctx, req) | |||
@@ -293,7 +305,7 @@ func grampusNotebookNewDataPrepare(ctx *context.Context, processType string) err | |||
ctx.Data["display_job_name"] = displayJobName | |||
//get valid images | |||
if processType == grampus.ProcessorTypeNPU { | |||
if processType == grampus.ProcessorTypeNPU || processType == grampus.ProcessorTypeGCU { | |||
images, err := grampus.GetImages(processType, string(models.JobTypeDebug)) | |||
if err != nil { | |||
log.Error("GetImages failed:", err.Error()) | |||
@@ -309,6 +321,10 @@ func grampusNotebookNewDataPrepare(ctx *context.Context, processType string) err | |||
computeResourceSimple = models.NPU | |||
datasetType = models.TypeCloudBrainTwo | |||
computeResource = models.NPUResource | |||
} else if processType == grampus.ProcessorTypeGCU { | |||
computeResourceSimple = models.GCU | |||
datasetType = models.TypeCloudBrainAll | |||
computeResource = models.GCUResource | |||
} | |||
prepareGrampusSpecs(ctx, computeResourceSimple, models.JobTypeDebug) | |||
@@ -1643,7 +1659,11 @@ func GrampusNotebookRestart(ctx *context.Context) { | |||
if task.ComputeResource == models.NPUResource { | |||
computeSourceSimple = models.NPU | |||
action = models.ActionCreateGrampusNPUDebugTask | |||
} else if task.ComputeResource == models.GCUResource { | |||
computeSourceSimple = models.GCU | |||
action = models.ActionCreateGrampusGCUDebugTask | |||
} | |||
spec, err = resource.GetAndCheckSpec(ctx.User.ID, oldSpec.ID, models.FindSpecsOptions{ | |||
JobType: models.JobType(task.JobType), | |||
ComputeResource: computeSourceSimple, | |||
@@ -1659,7 +1679,7 @@ func GrampusNotebookRestart(ctx *context.Context) { | |||
errorMsg = ctx.Tr("points.insufficient_points_balance") | |||
break | |||
} | |||
if task.IsGPUTask() { | |||
if task.IsGPUTask() || task.IsGCUTask() { | |||
if _, err := os.Stat(getOldJobPath(task)); err != nil { | |||
log.Error("Can not find job minio path", err) | |||
resultCode = "-1" | |||
@@ -72,6 +72,11 @@ var StatusInfoDict = map[string]StatusInfo{string(models.JobTypeDebug) + "-" + s | |||
JobType: []models.JobType{models.JobTypeDebug}, | |||
NotFinalStatuses: GrampusNotFinalStatuses, | |||
ComputeResource: models.NPUResource, | |||
}, string(models.JobTypeDebug) + "-" + strconv.Itoa(models.TypeC2Net) + "-" + models.GCUResource: { | |||
CloudBrainTypes: []int{models.TypeC2Net}, | |||
JobType: []models.JobType{models.JobTypeDebug}, | |||
NotFinalStatuses: GrampusNotFinalStatuses, | |||
ComputeResource: models.GCUResource, | |||
}} | |||
func GetNotFinalStatusTaskCount(uid int64, cloudbrainType int, jobType string, computeResource ...string) (int, error) { | |||
@@ -10,7 +10,7 @@ import ( | |||
"github.com/elliotchance/orderedmap" | |||
) | |||
var opTypes = []int{1, 2, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 35, 39, 40} | |||
var opTypes = []int{1, 2, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 35, 39, 40, 41} | |||
type ClientsManager struct { | |||
Clients *orderedmap.OrderedMap | |||
@@ -96,7 +96,7 @@ | |||
{{end}} | |||
<!-- {{$JobID}} --> | |||
<div class="two wide column nowrap" style="width:10% !important;"> | |||
{{if eq .JobType "DEBUG"}} | |||
{{if eq .JobType "DEBUG"}} | |||
<a class="title" | |||
href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .Cloudbrain.Type 2}}/grampus/notebook{{else}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{end}}/{{$JobID}}" | |||
title="{{.DisplayJobName}}" style="font-size: 14px;padding-right:0px"> | |||
@@ -233,7 +233,7 @@ | |||
{{if eq .Status "RUNNING" "WAITING" "CREATING" "STARTING"}} | |||
<a style="margin: 0 1rem;" id="ai-debug-{{$JobID}}" | |||
class='ui basic ai_debug {{if eq .Status "CREATING" "STOPPING" "WAITING" "STARTING"}}disabled {{else}}blue {{end}}button' | |||
data-jobid="{{$JobID}}" | |||
data-jobid="{{$JobID}}" | |||
data-repopath='{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .Cloudbrain.Type 2}}/grampus/notebook{{else}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{end}}/{{$JobID}}/'> | |||
{{$.i18n.Tr "repo.debug"}} | |||
</a> | |||
@@ -305,11 +305,11 @@ | |||
</form> | |||
{{else}} | |||
<form class="ui compact buttons" id="delForm-{{$JobID}}" | |||
action='{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .JobType "BENCHMARK"}}/cloudbrain/benchmark{{else if or (eq .JobType "SNN4IMAGENET") (eq .JobType "BRAINSCORE")}}/cloudbrain{{else if eq .JobType "DEBUG"}}{{if eq .Cloudbrain.Type 2}}/grampus/notebook{{else}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{end}}{{else if eq .JobType "TRAIN"}}{{if eq .Cloudbrain.Type 1}}/modelarts/train-job{{else if eq .Cloudbrain.Type 0}}/cloudbrain/train-job{{else if eq .Cloudbrain.Type 2}}/grampus/train-job{{end}}{{else if eq .JobType "INFERENCE"}}{{if eq .Cloudbrain.Type 0}}/cloudbrain/train-job{{end}}{{end}}/{{$JobID}}/del?ishomepage=true' | |||
action='{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .JobType "BENCHMARK"}}/cloudbrain/benchmark{{else if or (eq .JobType "SNN4IMAGENET") (eq .JobType "BRAINSCORE")}}/cloudbrain{{else if eq .JobType "DEBUG"}}{{if eq .Cloudbrain.Type 2}}/grampus/notebook{{else}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{end}}{{else if eq .JobType "TRAIN"}}{{if eq .Cloudbrain.Type 1}}/modelarts/train-job{{else if eq .Cloudbrain.Type 0}}/cloudbrain/train-job{{else if eq .Cloudbrain.Type 2}}/grampus/train-job{{end}}{{else if eq .JobType "INFERENCE"}}{{if eq .Cloudbrain.Type 0}}/cloudbrain/train-job{{end}}{{end}}/{{$JobID}}/del?isadminpage=true' | |||
method="post"> | |||
{{$.CsrfTokenHtml}} | |||
<a style="padding: 0.5rem 1rem;margin-left:0.2rem" id="ai-delete-{{$JobID}}" | |||
data-repopath="{{.Repo.OwnerName}}/{{.Repo.Name}}/modelarts/inference-job/{{$JobID}}/del_version?ishomepage=true" | |||
data-repopath="{{.Repo.OwnerName}}/{{.Repo.Name}}/modelarts/inference-job/{{$JobID}}/del_version?isadminpage=true" | |||
data-version="{{.VersionName}}" class="ui basic ai_delete blue button" | |||
style="border-radius: .28571429rem;"> | |||
{{$.i18n.Tr "repo.delete"}} | |||
@@ -44,6 +44,7 @@ | |||
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&jobType={{$.JobType}}&listType=&jobStatus={{$.JobStatus}}&cluster={{$.cluster}}&aiCenter={{$.aiCenter}}" data-value='{{.i18n.Tr "admin.cloudbrain.all_computing_resources"}}'>{{.i18n.Tr "admin.cloudbrain.all_computing_resources"}}</a> | |||
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&jobType={{$.JobType}}&listType=CPU/GPU&jobStatus={{$.JobStatus}}&cluster={{$.cluster}}&aiCenter={{$.aiCenter}}" data-value="CPU/GPU">CPU/GPU</a> | |||
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&jobType={{$.JobType}}&listType=NPU&jobStatus={{$.JobStatus}}&cluster={{$.cluster}}&aiCenter={{$.aiCenter}}" data-value="NPU">NPU</a> | |||
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&jobType={{$.JobType}}&listType=GCU&jobStatus={{$.JobStatus}}&cluster={{$.cluster}}&aiCenter={{$.aiCenter}}" data-value="GCU">GCU</a> | |||
</div> | |||
</div> | |||
<div class="ui selection dropdown" style="min-width: 10em;min-height:2.6em;border-radius: .28571429rem;margin-right: 1em;padding: .67em 3.2em .7em 1em;"> | |||
@@ -55,6 +55,7 @@ | |||
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&jobType={{$.JobType}}&listType=&jobStatus={{$.JobStatus}}&cluster={{$.cluster}}&aiCenter={{$.aiCenter}}" data-value='{{.i18n.Tr "admin.cloudbrain.all_computing_resources"}}'>{{.i18n.Tr "admin.cloudbrain.all_computing_resources"}}</a> | |||
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&jobType={{$.JobType}}&listType=CPU/GPU&jobStatus={{$.JobStatus}}&cluster={{$.cluster}}&aiCenter={{$.aiCenter}}" data-value="CPU/GPU">CPU/GPU</a> | |||
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&jobType={{$.JobType}}&listType=NPU&jobStatus={{$.JobStatus}}&cluster={{$.cluster}}&aiCenter={{$.aiCenter}}" data-value="NPU">NPU</a> | |||
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&jobType={{$.JobType}}&listType=GCU&jobStatus={{$.JobStatus}}&cluster={{$.cluster}}&aiCenter={{$.aiCenter}}" data-value="GCU">GCU</a> | |||
</div> | |||
</div> | |||
<div class="ui selection dropdown" style="min-width: 10em;min-height:2.6em;border-radius: .28571429rem;margin-right: 1em;padding: .67em 3.2em .7em 1em;"> | |||
@@ -185,7 +185,7 @@ | |||
<span><i class="question circle icon link"></i></span> | |||
<a href="{{AppSubUrl}}/resource_desc" target="_blank">{{.i18n.Tr "custom.resource_description"}}</a> | |||
{{if .CloudBrainPaySwitch}} | |||
<div class="cloudbrain_resource_spec_blance_tip" style="padding:0 5px;margin:6px 0;margin-left:265px;font-size:12px;width: 50%!important;"> | |||
<div class="cloudbrain_resource_spec_blance_tip" style="padding:0 5px;margin:6px 0;margin-left:154px;font-size:12px;width:48.5%!important;"> | |||
<span>{{$.i18n.Tr "points.balance_of_points"}}<span style="color:red;margin: 0 3px">{{.PointAccount.Balance}}</span>{{$.i18n.Tr "points.points"}}</span><span>{{$.i18n.Tr "points.expected_time"}}<span style="color:red;margin: 0 3px" class="can-use-time"></span>{{$.i18n.Tr "points.hours"}}</span> | |||
<span style="float:right;"> | |||
<i class="question circle icon link" data-position="right center" data-variation="mini"></i> | |||
@@ -152,6 +152,7 @@ | |||
<div class="item" data-value="all">{{$.i18n.Tr "repo.gpu_type_all"}}</div> | |||
<div class="item" data-value="CPU/GPU">CPU/GPU</div> | |||
<div class="item" data-value="NPU">NPU</div> | |||
<div class="item" data-value="GCU">GCU</div> | |||
</div> | |||
</div> | |||
{{if .Permission.CanWrite $.UnitTypeCloudBrain}} | |||
@@ -0,0 +1,161 @@ | |||
{{template "base/head" .}} | |||
{{template "custom/global_mask" .}} | |||
<div class="repository"> | |||
{{template "repo/header" .}} | |||
<div class="ui container"> | |||
<div class="cloudbrain-type" style="display: none;" data-cloudbrain-type="{{.datasetType}}" data-repo-link="{{.RepoLink}}" data-flag-model="true"></div> | |||
{{if eq .NotStopTaskCount 0}} | |||
{{template "base/alert" .}} | |||
{{end}} | |||
<div class="ui negative message" id="messageInfo" style="display: none;"> | |||
<p></p> | |||
</div> | |||
<h4 class="ui top attached header"> | |||
{{.i18n.Tr "repo.modelarts.train_job.new_debug"}} | |||
</h4> | |||
{{template "custom/alert_cb" .}} | |||
<div class="ui attached segment"> | |||
<form class="ui form" id="form_id" action="{{.Link}}" method="post"> | |||
<input type="hidden" name="type" value="2"> | |||
<input type="hidden" name="image" value=""> | |||
{{.CsrfTokenHtml}} | |||
<h4 class="train-job-title ui header ">{{.i18n.Tr "repo.modelarts.train_job.basic_info"}}:</h4> | |||
<div class="required min_title inline field"> | |||
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_cluster"}}</label> | |||
<div class="ui blue mini menu compact selectcloudbrain"> | |||
<a class="item" href="{{.RepoLink}}/cloudbrain/create"> | |||
<svg class="svg" sxmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.008 8.008 0 0 0 5.648 6.667zM10.03 13c.151 2.439.848 4.73 1.97 6.752A15.905 15.905 0 0 0 13.97 13h-3.94zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.008 8.008 0 0 0 19.938 13zM4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333 8.008 8.008 0 0 0 4.062 11zm5.969 0h3.938A15.905 15.905 0 0 0 12 4.248 15.905 15.905 0 0 0 10.03 11zm4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.008 8.008 0 0 0-5.648-6.667z"></path></svg> | |||
{{.i18n.Tr "cloudbrain.resource_cluster_openi"}} | |||
</a> | |||
<a class="active item" href="{{.RepoLink}}/grampus/notebook/create?type=1"> | |||
<svg class="svg" sxmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.008 8.008 0 0 0 5.648 6.667zM10.03 13c.151 2.439.848 4.73 1.97 6.752A15.905 15.905 0 0 0 13.97 13h-3.94zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.008 8.008 0 0 0 19.938 13zM4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333 8.008 8.008 0 0 0 4.062 11zm5.969 0h3.938A15.905 15.905 0 0 0 12 4.248 15.905 15.905 0 0 0 10.03 11zm4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.008 8.008 0 0 0-5.648-6.667z"></path></svg> | |||
{{.i18n.Tr "cloudbrain.resource_cluster_c2net"}}(Beta) | |||
</a> | |||
</div> | |||
</div> | |||
<div class="inline required field"> | |||
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.compute_resource"}}</label> | |||
<div class="ui blue small menu compact selectcloudbrain"> | |||
<a class="item" href="{{.RepoLink}}/grampus/notebook/create?type=0"> | |||
<svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"> | |||
<path fill="none" d="M0 0h24v24H0z"/> | |||
<path d="M3 2.992C3 2.444 3.445 2 3.993 2h16.014a1 1 0 0 1 .993.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 21.008V2.992zM19 11V4H5v7h14zm0 2H5v7h14v-7zM9 6h6v2H9V6zm0 9h6v2H9v-2z"/> | |||
</svg> | |||
CPU/GPU</a> | |||
<a class="item" href="{{.RepoLink}}/grampus/notebook/create?type=1"> | |||
<svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"> | |||
<path fill="none" d="M0 0h24v24H0z"/> | |||
<path d="M3 2.992C3 2.444 3.445 2 3.993 2h16.014a1 1 0 0 1 .993.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 21.008V2.992zM19 11V4H5v7h14zm0 2H5v7h14v-7zM9 6h6v2H9V6zm0 9h6v2H9v-2z"/> | |||
</svg> | |||
Ascend NPU</a> | |||
<a class="active item" href="{{.RepoLink}}/grampus/notebook/create?type=2"> | |||
<svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"> | |||
<path fill="none" d="M0 0h24v24H0z"/> | |||
<path d="M3 2.992C3 2.444 3.445 2 3.993 2h16.014a1 1 0 0 1 .993.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 21.008V2.992zM19 11V4H5v7h14zm0 2H5v7h14v-7zM9 6h6v2H9V6zm0 9h6v2H9v-2z"/> | |||
</svg> | |||
GCU</a> | |||
</div> | |||
</div> | |||
<div class="inline field"> | |||
<label class="label-fix-width" style="font-weight: normal;"></label> | |||
{{template "custom/task_wait_count" .}} | |||
<div style="display: flex;align-items: center;margin-left: 156px;margin-top: 0.5rem;"> | |||
<i class="ri-error-warning-line" style="color: #f2711c;margin-right: 0.5rem;"></i> | |||
<span style="color: #888;font-size: 12px;">{{.i18n.Tr "cloudbrain.new_debug_gpu_tooltips1" "/code" "/dataset" "/pretrainmodel" | Safe}}</span> | |||
</div> | |||
</div> | |||
<div class="inline min_title required field" style="margin-bottom: 0rem !important;"> | |||
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.task_name"}}</label> | |||
<input name="display_job_name" id="cloudbrain_job_name" placeholder="任务名称" style="width: 60%;" value="{{.display_job_name}}" tabindex="3" autofocus required maxlength="36" onkeyup="this.value=this.value.replace(/[, ]/g,'')"> | |||
</div> | |||
<span class="tooltips" style="margin-left: 11.5rem;margin-bottom: 2rem;">{{.i18n.Tr "repo.cloudbrain_jobname_err"}}</span> | |||
<div class="inline min_title field"> | |||
<label class="label-fix-width" style="font-weight: normal;" for="description">{{.i18n.Tr "repo.modelarts.train_job.description"}}</label> | |||
{{if .description}} | |||
<textarea style="width: 80%;" id="description" name="description" rows="3" maxlength="255" placeholder={{.i18n.Tr "repo.modelarts.train_job.new_place"}}>{{.description}}</textarea> | |||
{{else}} | |||
<textarea style="width: 80%;" id="description" name="description" rows="3" maxlength="255" placeholder={{.i18n.Tr "repo.modelarts.train_job.new_place"}} onchange="this.value=this.value.substring(0, 255)" onkeydown="this.value=this.value.substring(0, 255)" onkeyup="this.value=this.value.substring(0, 255)"></textarea> | |||
{{end}} | |||
</div> | |||
<div class="ui divider"></div> | |||
<div class="inline min_title required field"> | |||
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.code_version"}}</label> | |||
<select class="ui dropdown width80 left2 {{if not .Branches}}error{{end}}" id="code_version" | |||
name="branch_name"> | |||
{{if .branch_name}} | |||
<option name="branch_name" value="{{.branch_name}}">{{.branch_name}}</option> | |||
{{range $k, $v :=.Branches}} | |||
{{ if ne $v $.branch_name }} | |||
<option name="branch_name" value="{{$v}}">{{$v}}</option> | |||
{{end}} | |||
{{end}} | |||
{{else}} | |||
<option name="branch_name" value="{{.branchName}}">{{.branchName}}</option> | |||
{{range $k, $v :=.Branches}} | |||
{{ if ne $v $.branchName }} | |||
<option name="branch_name" value="{{$v}}">{{$v}}</option> | |||
{{end}} | |||
{{end}} | |||
{{end}} | |||
</select> | |||
</div> | |||
{{template "custom/select_model" .}} | |||
<div class="inline min_title required field"> | |||
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.mirror"}}</label> | |||
<select class="ui search dropdown cloudbrain_image width48" placeholder="{{.i18n.Tr "cloudbrain.choose_mirror"}}" style='width:385px' name="image_id"> | |||
{{range .images}} | |||
<option name="image_id" value="{{.ID}}">{{.Name}}</option> | |||
{{end}} | |||
</select> | |||
</div> | |||
<div id="select-multi-dataset"> | |||
</div> | |||
<span class="tooltips" style="margin-left: 11.5rem;margin-bottom: 1rem;"></span> | |||
<div class="inline min_title required field"> | |||
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.specification"}}</label> | |||
<select id="__specs__" class="ui search dropdown width48" ovalue="{{.spec_id}}" | |||
{{if .CloudBrainPaySwitch}}blance="{{.PointAccount.Balance}}"{{end}} | |||
placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" style='width:385px' name="spec_id"></select> | |||
<span><i class="question circle icon link"></i></span> | |||
<a href="{{AppSubUrl}}/resource_desc" target="_blank">{{.i18n.Tr "custom.resource_description"}}</a> | |||
{{if .CloudBrainPaySwitch}} | |||
<div class="cloudbrain_resource_spec_blance_tip" style="padding:0 5px;margin:6px 0;margin-left:154px;font-size:12px;width:48.5%!important;"> | |||
<span>{{$.i18n.Tr "points.balance_of_points"}}<span style="color:red;margin: 0 3px">{{.PointAccount.Balance}}</span>{{$.i18n.Tr "points.points"}}</span><span>{{$.i18n.Tr "points.expected_time"}}<span style="color:red;margin: 0 3px" class="can-use-time"></span>{{$.i18n.Tr "points.hours"}}</span> | |||
<span style="float:right;"> | |||
<i class="question circle icon link" data-position="right center" data-variation="mini"></i> | |||
<a href="{{AppSubUrl}}/reward/point/rule" target="_blank">{{$.i18n.Tr "points.points_acquisition_instructions"}}</a> | |||
</span> | |||
</div> | |||
{{end}} | |||
</div> | |||
<div class="inline field"> | |||
<label class="label-fix-width" style="font-weight: normal;"></label> | |||
<button class="ui create_train_job green button {{if eq .NotStopTaskCount 1}}disabled{{end}}"> | |||
{{.i18n.Tr "repo.cloudbrain.new"}} | |||
</button> | |||
<a class="ui button cancel" href="{{.RepoLink}}/debugjob?debugListType=all">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a> | |||
</div> | |||
</form> | |||
</div> | |||
</div> | |||
</div> | |||
{{template "base/footer" .}} | |||
<script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script> | |||
<script src="{{StaticUrlPrefix}}/js/cloudbrainNew.js?v={{MD5 AppVer}}" type="text/javascript"></script> | |||
<script> | |||
;(function() { | |||
var SPECS = {{ .Specs }}; | |||
var showPoint = {{ .CloudBrainPaySwitch }}; | |||
window.renderSpecsSelect($('#__specs__'), SPECS, showPoint, { | |||
gpu_memory: {{$.i18n.Tr "cloudbrain.gpu_memory"}}, | |||
free: {{$.i18n.Tr "cloudbrain.free"}}, | |||
point_hr: {{$.i18n.Tr "cloudbrain.point_hr"}}, | |||
memory: {{$.i18n.Tr "cloudbrain.memory"}}, | |||
shared_memory: {{$.i18n.Tr "cloudbrain.shared_memory"}}, | |||
}); | |||
})(); | |||
</script> |
@@ -54,6 +54,14 @@ | |||
d="M3 2.992C3 2.444 3.445 2 3.993 2h16.014a1 1 0 0 1 .993.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 21.008V2.992zM19 11V4H5v7h14zm0 2H5v7h14v-7zM9 6h6v2H9V6zm0 9h6v2H9v-2z" /> | |||
</svg> | |||
Ascend NPU</a> | |||
<a class="item" href="{{.RepoLink}}/grampus/notebook/create?type=2"> | |||
<svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" | |||
height="16"> | |||
<path fill="none" d="M0 0h24v24H0z" /> | |||
<path | |||
d="M3 2.992C3 2.444 3.445 2 3.993 2h16.014a1 1 0 0 1 .993.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 21.008V2.992zM19 11V4H5v7h14zm0 2H5v7h14v-7zM9 6h6v2H9V6zm0 9h6v2H9v-2z" /> | |||
</svg> | |||
GCU</a> | |||
</div> | |||
</div> | |||
<div class="min_title inline field"> | |||
@@ -119,7 +127,7 @@ | |||
<span><i class="question circle icon link"></i></span> | |||
<a href="{{AppSubUrl}}/resource_desc" target="_blank">{{.i18n.Tr "custom.resource_description"}}</a> | |||
{{if .CloudBrainPaySwitch}} | |||
<div class="cloudbrain_resource_spec_blance_tip" style="padding:0 5px;margin:6px 0;margin-left:265px;font-size:12px;width: 50%!important;"> | |||
<div class="cloudbrain_resource_spec_blance_tip" style="padding:0 5px;margin:6px 0;margin-left:154px;font-size:12px;width:48.5%!important;"> | |||
<span>{{$.i18n.Tr "points.balance_of_points"}}<span style="color:red;margin: 0 3px">{{.PointAccount.Balance}}</span>{{$.i18n.Tr "points.points"}}</span><span>{{$.i18n.Tr "points.expected_time"}}<span style="color:red;margin: 0 3px" class="can-use-time"></span>{{$.i18n.Tr "points.hours"}}</span> | |||
<span style="float:right;"> | |||
<i class="question circle icon link" data-position="right center" data-variation="mini"></i> | |||
@@ -147,7 +155,7 @@ | |||
{{template "base/footer" .}} | |||
<script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script> | |||
<script src="{{StaticUrlPrefix}}/js/cloudbrainNew.js?v={{MD5 AppVer}}" type="text/javascript"></script> | |||
<script> | |||
<script> | |||
;(function() { | |||
var SPECS = {{ .Specs }}; | |||
var showPoint = {{ .CloudBrainPaySwitch }}; | |||
@@ -48,6 +48,12 @@ | |||
<path d="M3 2.992C3 2.444 3.445 2 3.993 2h16.014a1 1 0 0 1 .993.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 21.008V2.992zM19 11V4H5v7h14zm0 2H5v7h14v-7zM9 6h6v2H9V6zm0 9h6v2H9v-2z"/> | |||
</svg> | |||
Ascend NPU</a> | |||
<a class="item" href="{{.RepoLink}}/grampus/notebook/create?type=2"> | |||
<svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"> | |||
<path fill="none" d="M0 0h24v24H0z"/> | |||
<path d="M3 2.992C3 2.444 3.445 2 3.993 2h16.014a1 1 0 0 1 .993.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 21.008V2.992zM19 11V4H5v7h14zm0 2H5v7h14v-7zM9 6h6v2H9V6zm0 9h6v2H9v-2z"/> | |||
</svg> | |||
GCU</a> | |||
</div> | |||
</div> | |||
<div class="inline field"> | |||
@@ -124,7 +130,7 @@ | |||
<span><i class="question circle icon link"></i></span> | |||
<a href="{{AppSubUrl}}/resource_desc" target="_blank">{{.i18n.Tr "custom.resource_description"}}</a> | |||
{{if .CloudBrainPaySwitch}} | |||
<div class="cloudbrain_resource_spec_blance_tip" style="padding:0 5px;margin:6px 0;margin-left:265px;font-size:12px;width: 50%!important;"> | |||
<div class="cloudbrain_resource_spec_blance_tip" style="padding:0 5px;margin:6px 0;margin-left:154px;font-size:12px;width:48.5%!important;"> | |||
<span>{{$.i18n.Tr "points.balance_of_points"}}<span style="color:red;margin: 0 3px">{{.PointAccount.Balance}}</span>{{$.i18n.Tr "points.points"}}</span><span>{{$.i18n.Tr "points.expected_time"}}<span style="color:red;margin: 0 3px" class="can-use-time"></span>{{$.i18n.Tr "points.hours"}}</span> | |||
<span style="float:right;"> | |||
<i class="question circle icon link" data-position="right center" data-variation="mini"></i> | |||
@@ -149,7 +155,7 @@ | |||
{{template "base/footer" .}} | |||
<script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script> | |||
<script src="{{StaticUrlPrefix}}/js/cloudbrainNew.js?v={{MD5 AppVer}}" type="text/javascript"></script> | |||
<script> | |||
<script> | |||
;(function() { | |||
var SPECS = {{ .Specs }}; | |||
var showPoint = {{ .CloudBrainPaySwitch }}; | |||
@@ -107,7 +107,7 @@ | |||
<span><i class="question circle icon link"></i></span> | |||
<a href="{{AppSubUrl}}/resource_desc" target="_blank">{{.i18n.Tr "custom.resource_description"}}</a> | |||
{{if .CloudBrainPaySwitch}} | |||
<div class="cloudbrain_resource_spec_blance_tip" style="padding:0 5px;margin:6px 0;margin-left:265px;font-size:12px;width: 50%!important;"> | |||
<div class="cloudbrain_resource_spec_blance_tip" style="padding:0 5px;margin:6px 0;margin-left:154px;font-size:12px;width:48.5%!important;"> | |||
<span>{{$.i18n.Tr "points.balance_of_points"}}<span style="color:red;margin: 0 3px">{{.PointAccount.Balance}}</span>{{$.i18n.Tr "points.points"}}</span><span>{{$.i18n.Tr "points.expected_time"}}<span style="color:red;margin: 0 3px" class="can-use-time"></span>{{$.i18n.Tr "points.hours"}}</span> | |||
<span style="float:right;"> | |||
<i class="question circle icon link" data-position="right center" data-variation="mini"></i> | |||
@@ -75,7 +75,7 @@ | |||
{{else if eq .GetOpType 25}} | |||
{{$.i18n.Tr "action.task_gpudebugjob" .GetRepoLink .Content .RefName | Str2html}} | |||
{{else if eq .GetOpType 26}} | |||
{{$.i18n.Tr "action.task_npudebugjob" .GetRepoLink .Content .RefName | Str2html}} | |||
{{$.i18n.Tr "action.task_npudebugjob" .GetRepoLink .Content .RefName | Str2html}} | |||
{{else if eq .GetOpType 27}} | |||
{{$.i18n.Tr "action.task_nputrainjob" .GetRepoLink .Content .RefName | Str2html}} | |||
{{else if eq .GetOpType 28}} | |||
@@ -96,6 +96,8 @@ | |||
{{$.i18n.Tr "action.task_c2net_npudebugjob" .GetRepoLink .Content .RefName | Str2html}} | |||
{{else if eq .GetOpType 40}} | |||
{{$.i18n.Tr "action.task_c2net_gpudebugjob" .GetRepoLink .Content .RefName | Str2html}} | |||
{{else if eq .GetOpType 41}} | |||
{{$.i18n.Tr "action.task_c2ent_gcudebugjob" .GetRepoLink .Content .RefName | Str2html}} | |||
{{end}} | |||
</p> | |||
{{if or (eq .GetOpType 5) (eq .GetOpType 18)}} | |||
@@ -133,6 +135,12 @@ | |||
<span class="text grey"><i class="ri-voice-recognition-line icon big"></i></span> | |||
{{else if eq .GetOpType 26}} | |||
<span class="text grey"><i class="ri-voice-recognition-line icon big"></i></span> | |||
{{else if eq .GetOpType 39}} | |||
<span class="text grey"><i class="ri-voice-recognition-line icon big"></i></span> | |||
{{else if eq .GetOpType 40}} | |||
<span class="text grey"><i class="ri-voice-recognition-line icon big"></i></span> | |||
{{else if eq .GetOpType 41}} | |||
<span class="text grey"><i class="ri-voice-recognition-line icon big"></i></span> | |||
{{else if eq .GetOpType 27}} | |||
<span class="text grey"><i class="ri-character-recognition-line icon big"></i></span> | |||
{{else if eq .GetOpType 28}} | |||
@@ -1,11 +1,11 @@ | |||
window.ACC_CARD_TYPE = [{ k: 'T4', v: 'T4' }, { k: 'A100', v: 'A100' }, { k: 'V100', v: 'V100' }, { k: 'ASCEND910', v: 'Ascend 910' }, { k: 'MLU270', v: 'MLU270' }, { k: 'RTX3080', v: 'RTX3080' }]; | |||
window.ACC_CARD_TYPE = [{ k: 'T4', v: 'T4' }, { k: 'A100', v: 'A100' }, { k: 'V100', v: 'V100' }, { k: 'ASCEND910', v: 'Ascend 910' }, { k: 'MLU270', v: 'MLU270' }, { k: 'RTX3080', v: 'RTX3080' }, { k: 'ENFLAME-T20', v: 'ENFLAME-T20' }]; | |||
window.getListValueWithKey = (list, key, k = 'k', v = 'v', defaultV = '') => { | |||
for (let i = 0, iLen = list.length; i < iLen; i++) { | |||
const listI = list[i]; | |||
if (listI[k] === key) return listI[v]; | |||
} | |||
return defaultV; | |||
return defaultV || key; | |||
}; | |||
window.renderSpecStr = (spec, showPoint, langObj) => { | |||
@@ -11,8 +11,8 @@ export const JOB_TYPE = [{ k: 'DEBUG', v: i18n.t('debugTask') }, { k: 'TRAIN', v | |||
// 资源管理 | |||
export const CLUSTERS = [{ k: 'OpenI', v: i18n.t('resourcesManagement.OpenI') }, { k: 'C2Net', v: i18n.t('resourcesManagement.C2Net') }]; | |||
export const AI_CENTER = [{ k: 'OpenIOne', v: i18n.t('resourcesManagement.OpenIOne') }, { k: 'OpenITwo', v: i18n.t('resourcesManagement.OpenITwo') }, { k: 'OpenIChengdu', v: i18n.t('resourcesManagement.OpenIChengdu') }, { k: 'pclcci', v: i18n.t('resourcesManagement.pclcci') }, { k: 'hefei', v: i18n.t('resourcesManagement.hefeiCenter') }, { k: 'xuchang', v: i18n.t('resourcesManagement.xuchangCenter') }]; | |||
export const COMPUTER_RESOURCES = [{ k: 'GPU', v: 'GPU' }, { k: 'NPU', v: 'NPU' }, { k: 'MLU', v: 'MLU' }]; | |||
export const ACC_CARD_TYPE = [{ k: 'T4', v: 'T4' }, { k: 'A100', v: 'A100' }, { k: 'V100', v: 'V100' }, { k: 'ASCEND910', v: 'Ascend 910' }, { k: 'MLU270', v: 'MLU270' }, { k: 'RTX3080', v: 'RTX3080' }]; | |||
export const COMPUTER_RESOURCES = [{ k: 'GPU', v: 'GPU' }, { k: 'NPU', v: 'NPU' }, { k: 'MLU', v: 'MLU' }, { k: 'GCU', v: 'GCU' }]; | |||
export const ACC_CARD_TYPE = [{ k: 'T4', v: 'T4' }, { k: 'A100', v: 'A100' }, { k: 'V100', v: 'V100' }, { k: 'ASCEND910', v: 'Ascend 910' }, { k: 'MLU270', v: 'MLU270' }, { k: 'RTX3080', v: 'RTX3080' }, { k: 'ENFLAME-T20', v: 'ENFLAME-T20' }]; | |||
export const SPECIFICATION_STATUS = [{ k: '1', v: i18n.t('resourcesManagement.willOnShelf') }, { k: '2', v: i18n.t('resourcesManagement.onShelf') }, { k: '3', v: i18n.t('resourcesManagement.offShelf') }]; | |||
// 模型 | |||
@@ -29,14 +29,14 @@ const getJobTypeLink = (record, type) => { | |||
const cloudbrain = type === 'INCREASE' ? record.Action?.Cloudbrain : record.Cloudbrain; | |||
switch (cloudbrain?.JobType) { | |||
case 'DEBUG': | |||
console.log("cloudbrain") | |||
if (cloudbrain.Type === 2) { | |||
if (cloudbrain.Type == 2) { | |||
link += `/grampus/notebook/${cloudbrain.ID}`; | |||
} | |||
else if (cloudbrain.ComputeResource === 'CPU/GPU') { | |||
link += `/cloudbrain/${cloudbrain.ID}`; | |||
} else { | |||
link += `/modelarts/notebook/${cloudbrain.ID}`; | |||
if (cloudbrain.ComputeResource === 'CPU/GPU') { | |||
link += `/cloudbrain/${cloudbrain.ID}`; | |||
} else { | |||
link += `/modelarts/notebook/${cloudbrain.ID}`; | |||
} | |||
} | |||
break; | |||
case 'TRAIN': | |||