tao-train-mask-auto-label
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMAL
MAL
MAL (Mask Auto-Label) for weakly-supervised segmentation. Produces segmentation masks from minimal annotations (e.g., point or box annotations). Uses ViT-MAE backbone.
Set train.pretrained_model_path for ViT-MAE pretrained weights.
MAL(Mask Auto-Label)用于弱监督分割任务,仅需少量标注(如点标注或框标注)即可生成分割掩码,采用ViT-MAE骨干网络。
设置train.pretrained_model_path以指定ViT-MAE预训练权重路径。
Dataclass Schemas
Dataclass Schemas
Generated TAO Core schemas are packaged in , with listing available actions. Each generated schema also emits from the schema top-level field. AutoML enablement is declared at the model layer in via . Runnable AutoML still requires and to exist and parse. Use the packaged train schema for , , defaults, min/max bounds, enums, option weights, math conditions, dependencies, and popular parameters. Do not expect at runtime; maintainers regenerate schemas/templates before packaging the skill bank.
schemas/<action>.schema.jsonschemas/manifest.jsonreferences/spec_template_<action>.yamldefaultreferences/skill_info.yamlautoml_enabledschemas/train.schema.jsonreferences/spec_template_train.yamlautoml_default_parametersautoml_disabled_parameters~/tao-core生成的TAO Core schema打包在中,会列出所有可用操作。每个生成的schema还会从schema顶层的字段生成。AutoML启用状态在的模型层通过声明。可运行的AutoML仍要求和存在且可解析。使用打包的训练schema来配置、、默认值、最小/最大边界、枚举值、选项权重、数学条件、依赖关系以及常用参数。运行时不要依赖;维护人员在打包技能库前会重新生成schema和模板。
schemas/<action>.schema.jsonschemas/manifest.jsondefaultreferences/spec_template_<action>.yamlreferences/skill_info.yamlautoml_enabledschemas/train.schema.jsonreferences/spec_template_train.yamlautoml_default_parametersautoml_disabled_parameters~/tao-coreTrain Action Policy
Train Action Policy
This model is AutoML-enabled at the model layer. Before handling any train-stage request, read and resolve the run override from either an explicit value or the user's workflow request. Treat phrases like "turn off AutoML", "disable AutoML", "no HPO", or "plain training" as for this run only; otherwise default to . When , , and both and are packaged, route the train action through by default with this model's . Preserve workflow/application overrides for datasets, specs, output directories, GPU/platform settings, parent checkpoints, and . Use direct model training only when or the packaged train schema/template is missing; in the missing-schema case, report that AutoML is enabled but not runnable for this model until schemas are generated.
references/skill_info.yamlautoml_policyautoml_policy: offautoautoml_policy: autoautoml_enabled: trueschemas/train.schema.jsonreferences/spec_template_train.yamltao-skill-bank:tao-run-automlskill_dirautoml_policyautoml_policy: offNon-train actions such as , , , and deploy flows stay in this model skill. The per-run override does not change model metadata.
evaluateinferenceexportautoml_policy该模型在模型层支持AutoML。处理任何训练阶段请求前,请读取,并通过显式的值或用户的工作流请求确定运行覆盖规则。将“turn off AutoML”、“disable AutoML”、“no HPO”或“plain training”这类表述视为本次运行的;否则默认使用。当、,且和已打包时,默认将训练操作通过路由,并传入该模型的。保留数据集、配置、输出目录、GPU/平台设置、父检查点和的工作流/应用覆盖规则。仅当或打包的训练schema/模板缺失时,才使用直接模型训练;若schema缺失,需报告该模型已启用AutoML,但在生成schema前无法运行。
references/skill_info.yamlautoml_policyautoml_policy: offautoautoml_policy: autoautoml_enabled: trueschemas/train.schema.jsonreferences/spec_template_train.yamltao-skill-bank:tao-run-automlskill_dirautoml_policyautoml_policy: off非训练操作(如、、和部署流程)仍在该模型技能中执行。每次运行的覆盖规则不会更改模型元数据。
evaluateinferenceexportautoml_policyTraining Requirements
Training Requirements
- Dataset type: segmentation
- Formats: default
- Monitoring metric: mIoU
- 数据集类型: 分割数据集
- 格式: 默认格式
- 监控指标: mIoU
Per-Action Dataset Requirements
各操作的数据集要求
| Action | Spec Key | Source | Files | List? |
|---|---|---|---|---|
| evaluate | dataset.val_img_dir | eval_dataset | images.tar.gz | No |
| evaluate | dataset.val_ann_path | eval_dataset | annotations.json | No |
| inference | inference.img_dir | inference_dataset | images.tar.gz | No |
| inference | inference.ann_path | inference_dataset | annotations.json | No |
| train | dataset.train_img_dir | train_datasets | images.tar.gz | No |
| train | dataset.train_ann_path | train_datasets | annotations.json | No |
| train | dataset.val_img_dir | eval_dataset | images.tar.gz | No |
| train | dataset.val_ann_path | eval_dataset | annotations.json | No |
| 操作 | 配置键 | 数据源 | 文件 | 是否为列表? |
|---|---|---|---|---|
| evaluate | dataset.val_img_dir | eval_dataset | images.tar.gz | 否 |
| evaluate | dataset.val_ann_path | eval_dataset | annotations.json | 否 |
| inference | inference.img_dir | inference_dataset | images.tar.gz | 否 |
| inference | inference.ann_path | inference_dataset | annotations.json | 否 |
| train | dataset.train_img_dir | train_datasets | images.tar.gz | 否 |
| train | dataset.train_ann_path | train_datasets | annotations.json | 否 |
| train | dataset.val_img_dir | eval_dataset | images.tar.gz | 否 |
| train | dataset.val_ann_path | eval_dataset | annotations.json | 否 |
Typical Spec Overrides
典型配置覆盖
Data source overrides are mandatory for every action — the agent MUST construct data source paths from the Per-Action Dataset Requirements table above and include them in .
spec_overridespython
S3_TRAIN = "s3://bucket/data/train"
S3_EVAL = "s3://bucket/data/eval"train (mandatory data sources):
python
{
"train.num_gpus": 1,
"train.gpu_ids": [
0
],
"train.num_epochs": 5,
"train.checkpoint_interval": 5,
"train.validation_interval": 5,
"dataset.train_img_dir": f"{S3_TRAIN}/images.tar.gz",
"dataset.train_ann_path": f"{S3_TRAIN}/annotations.json",
"dataset.val_img_dir": f"{S3_EVAL}/images.tar.gz",
"dataset.val_ann_path": f"{S3_EVAL}/annotations.json",
}evaluate (mandatory data sources):
python
{
"dataset.val_img_dir": f"{S3_EVAL}/images.tar.gz",
"dataset.val_ann_path": f"{S3_EVAL}/annotations.json",
}inference (mandatory data sources):
python
{
"inference.img_dir": f"{S3_EVAL}/images.tar.gz",
"inference.ann_path": f"{S3_EVAL}/annotations.json",
}数据源覆盖对每个操作都是必填项 —— 智能体必须根据上述“各操作的数据集要求”表格构建数据源路径,并将其包含在中。
spec_overridespython
S3_TRAIN = "s3://bucket/data/train"
S3_EVAL = "s3://bucket/data/eval"train(必填数据源):
python
{
"train.num_gpus": 1,
"train.gpu_ids": [
0
],
"train.num_epochs": 5,
"train.checkpoint_interval": 5,
"train.validation_interval": 5,
"dataset.train_img_dir": f"{S3_TRAIN}/images.tar.gz",
"dataset.train_ann_path": f"{S3_TRAIN}/annotations.json",
"dataset.val_img_dir": f"{S3_EVAL}/images.tar.gz",
"dataset.val_ann_path": f"{S3_EVAL}/annotations.json",
}evaluate(必填数据源):
python
{
"dataset.val_img_dir": f"{S3_EVAL}/images.tar.gz",
"dataset.val_ann_path": f"{S3_EVAL}/annotations.json",
}inference(必填数据源):
python
{
"inference.img_dir": f"{S3_EVAL}/images.tar.gz",
"inference.ann_path": f"{S3_EVAL}/annotations.json",
}Eval Dataset
Eval Dataset
Optional. Val images and annotations configured alongside train paths.
可选。验证集图像和标注与训练路径一同配置。
Important Parameters
重要参数
- model.arch: ViT-MAE backbone variant. Default vit-mae-base/16. Options include vit-mae-large/16 and other ViT-MAE variants.
- train.lr: Learning rate. Default 1e-6 (very low — fine-tuning ViT).
- model.crop_size: Training crop size. Default 512.
- train.warmup_epochs: Warmup epochs before full learning rate.
- model.load_mask: Whether to load pre-computed masks.
- model.arch: ViT-MAE骨干网络变体。默认值为vit-mae-base/16。可选值包括vit-mae-large/16及其他ViT-MAE变体。
- train.lr: 学习率。默认值为1e-6(数值极低,用于ViT微调)。
- model.crop_size: 训练裁剪尺寸。默认值为512。
- train.warmup_epochs: 达到全学习率前的预热轮数。
- model.load_mask: 是否加载预计算掩码。
Multi-GPU / Multi-Node
多GPU / 多节点
Launch method: Lightning-managed (single process, Lightning spawns workers).
python| Spec Key | Description | Default |
|---|---|---|
| Number of GPUs | 1 |
| GPU device indices | [0] |
| Number of nodes | 1 |
- Multi-GPU strategy:
ddp_find_unused_parameters_true - No fsdp support
- LR auto-scaling: (learning rate is scaled automatically by device count and batch size)
lr = lr * num_devices * batch_size
Multi-node env vars (set by orchestrator): , , , , .
WORLD_SIZENODE_RANKMASTER_ADDRMASTER_PORTNUM_GPU_PER_NODE启动方式: Lightning管理(单个进程,Lightning生成工作进程)。
python| 配置键 | 描述 | 默认值 |
|---|---|---|
| GPU数量 | 1 |
| GPU设备索引 | [0] |
| 节点数量 | 1 |
- 多GPU策略:
ddp_find_unused_parameters_true - 不支持fsdp
- 学习率自动缩放: (学习率会根据设备数量和批量大小自动缩放)
lr = lr * num_devices * batch_size
多节点环境变量(由编排器设置):, , , , 。
WORLD_SIZENODE_RANKMASTER_ADDRMASTER_PORTNUM_GPU_PER_NODEHardware
硬件要求
Minimum 1 GPU(s), recommended 2 GPU(s). 24GB+ (A100 recommended) VRAM per GPU. ViT-MAE backbone at crop_size=512 needs 24GB+ GPU memory.
最低需要1块GPU,推荐2块GPU。每块GPU需24GB及以上显存(推荐A100)。当crop_size=512时,ViT-MAE骨干网络需要24GB及以上GPU显存。
Error Patterns
错误场景
CUDA out of memory: Reduce model.crop_size (512 -> 384 -> 256) or use a smaller ViT-MAE variant (base vs large).
CUDA内存不足:减小model.crop_size(从512调整为384再到256)或使用更小的ViT-MAE变体(base版替代large版)。
Spec Param / Parent Model Inference
配置参数 / 父模型推理
Model-specific inference mappings belong in this MD file, not in . Generated runners should read this section and apply the mappings with SDK helpers before . This mirrors the old microservices flow.
config.jsoncreate_job()infer_params.pyInference mappings from TAO Core :
mal.config.json| Action | Spec Field | Inference Function | Meaning |
|---|---|---|---|
| evaluate | | | model file inferred from the parent job results folder |
| evaluate | | | current job results directory |
| inference | | | model file inferred from the parent job results folder |
| inference | | | MAL inference JSON path |
| inference | | | current job results directory |
| train | | | current job results directory |
For or , pass the upstream train/export/AutoML child job id as . The SDK lists the parent result folder, filters checkpoint artifacts, and returns the selected model file or folder. Do not add these mappings back to and do not patch generated runner scripts to guess checkpoint paths.
parent_modelparent_model_folderparent_job_idconfig.json模型特定的推理映射应放在此MD文件中,而非。生成的运行器应读取本节内容,并在调用前使用SDK助手应用这些映射。这与旧微服务的流程一致。
config.jsoncreate_job()infer_params.py来自TAO Core 的推理映射:
mal.config.json| 操作 | 配置字段 | 推理函数 | 含义 |
|---|---|---|---|
| evaluate | | | 从父任务结果文件夹中推断出模型文件 |
| evaluate | | | 当前任务结果目录 |
| inference | | | 从父任务结果文件夹中推断出模型文件 |
| inference | | | MAL推理结果JSON路径 |
| inference | | | 当前任务结果目录 |
| train | | | 当前任务结果目录 |
对于或,将上游训练/导出/AutoML子任务ID作为传入。SDK会列出父任务结果文件夹,过滤检查点工件,并返回选中的模型文件或文件夹。请勿将这些映射添加回,也不要修改生成的运行器脚本以猜测检查点路径。
parent_modelparent_model_folderparent_job_idconfig.json