基于 Lance 宽表的视频全链路精选与多格式生成管线
概述
此管线基于 Lance 列式表为核心数据面,对海量原始视频做全链路质量精选:从场景切分、语义去重、美学评分、NSFW 过滤到结构化 Caption,最终输出训练可用的 WebDataset 分片和 LeRobot v3.0 数据集。
- 输入:原始视频/图像清单(manifest.jsonl,含 sample_id / modality / url)
-
输出:
- WebDataset tar 分片(供视觉-语言训练)
- LeRobot v3.0 数据集(供具身策略训练)
- 业务价值:将散乱原始素材一站式精选为高质量训练数据,前置 CPU/GPU 联合清洗显著降低下游训练噪声
处理流程
1manifest.jsonl → S00 写入Lance → S01 校验入库 → S02 场景切分 → S03 视频嵌入(GPU)
2→ S04 KMeans聚类 → S05 语义去重 → S06 美学评分(GPU) → S07 NSFW检测(GPU)
3→ S08 质量过滤 → S09 结构化Caption(GPU) → S10 WebDataset分片 / S11 导出LeRobot v3.0
算子映射
| 步骤 | 算子 | GPU | 说明 |
|---|---|---|---|
| S00 | IngestToLance |
否 | 从 manifest.jsonl 写入 Lance 宽表 |
| S01 | Ingest |
否 | 字段校验 + 默认值填充 |
| S02 | VideoSplitByScene |
否 | ContentDetector 场景切分,1→N 行 explode |
| S03 | CosmosVideoEmbedding |
是 | Cosmos-Embed1-448p 视频嵌入 |
| S04 | KMeansClustering |
否 | 嵌入向量 KMeans 聚类 |
| S05 | SemanticDedupByCosine |
否 | 余弦相似度语义去重 |
| S06 | DOVERAesthetic |
是 | DOVER 视频美学评分 |
| S07 | VideoNsfwDetect |
是 | Falconsai NSFW 检测 |
| S08 | Filter | 否 | 按去重/美学/NSFW 三维过滤 |
| S09 | StructuredCaptionPipeline |
是 | Qwen2.5-VL 结构化 Caption |
| S10 | ExportToWebDataset |
否 | 输出 WebDataset tar 分片 |
| S11 | ExportLeRobotV30 |
否 | 输出 LeRobot v3.0 数据集 |
数据流向
1manifest.jsonl
2 → S00 → lance://bos://<YOUR-BUCKET-NAME>/aihc/p6-run1/episodes.lance
3 → S01 → (Lance 表内 keep=True 校验)
4 → S02 → (Lance 表追加 clip 列,行 explode)
5 → S03 → (Lance 表追加 video_embed 列)
6 → S04 → (Lance 表追加 cluster_id 列)
7 → S05 → (Lance 表追加 dedup_keep 列)
8 → S06 → (Lance 表追加 dover_aesthetic 列)
9 → S07 → (Lance 表追加 video_nsfw 列)
10 → S08 → (Lance 表更新 keep + drop_reasons)
11 → S09 → (Lance 表追加 caption 列)
12 → S10 → output_dir/*.tar (WebDataset 分片)
13 → S11 → output_dir/ (LeRobot v3.0 数据集)
前置条件
| 资源 | 说明 |
|---|---|
| AIHC 队列 | 需要 CPU 队列和 GPU 队列(分别用于 CPU/GPU 步骤) |
| BOS Bucket | 存放 Lance 表、输入数据和模型(默认 storage-aihc,需提前创建) |
| GPU 资源 | S03/S06/S07 需要 RTX 4090;S09 需要 2×RTX 4090 |
| 镜像 | ccr-registry.baidubce.com/aihc/aihc-daft-gpu:0.5.2.12.2-cu129-py3.12-p6-sm120-sm89-ubuntu22.04 |
| 模型 | Cosmos-Embed1-448p、DOVER、Falconsai/nsfw_image_detection、Qwen2.5-VL-7B-Instruct(镜像内 /opt/aihc/models) |
全局参数说明
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
image |
string | 是 | ccr-registry.baidubce.com/aihc/aihc-daft-gpu:0.5.2.12.2-cu129-py3.12-p6-sm120-sm89-ubuntu22.04 |
镜像地址 |
cpu_queue_id |
string | 是 | — | CPU 计算队列 ID |
gpu_queue_id |
string | 是 | — | GPU 计算队列 ID |
priority |
string | 否 | high |
任务优先级 |
lance_uri |
string | 是 | lance://bos://storage-aihc/aihc/p6-run1/episodes.lance |
Lance 表 URI,需要替换为自己的 BOS 地址 |
manifest |
string | 是 | — | 输入 manifest.jsonl 路径(BOS 上) |
output_dir |
string | 是 | — | 最终输出目录(WebDataset 分片 + LeRobot 数据集) |
bos_env_file |
string | 是 | - | BOS 凭证文件路径(需要包含 ACCESS_KEY/SECRET_KEY,要求可以读写lance_uri参数中的填写的BOS地址),lance 数据的读写基于 bos endpoint,填写示例见下方 |
source |
string | 否 | manifest |
数据来源标签 |
source_dataset |
string | 否 | manifest 父目录名 | 数据集标签 |
head_cpu |
int | 否 | 6 |
Head 节点 CPU 数 |
head_memory |
int | 否 | 12 |
Head 节点内存(GB) |
worker_replicas |
int | 否 | 2 |
Worker 副本数 |
worker_cpu |
int | 否 | 16 |
Worker 节点 CPU 数 |
worker_memory |
int | 否 | 64 |
Worker 节点内存(GB) |
worker_gpu |
int | 否 | 1 |
Worker 节点 GPU 数(GPU 步骤使用) |
bos_env_file文件内容要求:
1export BOS_ENDPOINT=https://bj.bcebos.com
2export BOS_S3_ENDPOINT=https://s3.bj.bcebos.com
3export BOS_REGION=bj
4export BOS_ACCESS_KEY=xxxxxxx
5export BOS_SECRET_KEY=xxxxxxx
步骤详解
S00 写入 Lance(Ingest to Lance)
从 manifest.jsonl 读取记录,写入 Lance 宽表作为后续所有步骤的统一数据面。支持增量追加(按 sample_id 去重),--force 可全量覆盖。
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
manifest |
string | — | 输入 manifest.jsonl 路径 |
output |
string | — | Lance URI |
source |
string | manifest |
来源标签 |
source_dataset |
string | 父目录名 | 数据集标签 |
force |
bool | false |
是否强制覆盖 |
- 输入:manifest.jsonl(字段:sample_id, modality, url)
- 输出:Lance 表(schema:sample_id, modality, url, source, source_dataset, ingest_time, keep, meta)
- 资源:CPU-only,纯 IO 操作
S01 字段校验(Ingest)
校验 manifest.jsonl 字段合法性,跳过缺失 sample_id / 非法 modality / 无 url 的行,为合法行填充 keep=True 默认值。
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
allow_empty |
bool | false |
允许空输入不报错 |
- 输入:manifest.jsonl
- 输出:校验后的 JSONL
- 资源:CPU-only,纯 IO 操作
S02 场景切分(Split Scene)
使用 PySceneDetect ContentDetector 检测画面内容突变点,将长视频切分为独立场景片段。切分后行 explode,每行对应一个 clip。仅处理 modality=video 的行。
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
detector |
string | ContentDetector |
场景检测算法 |
threshold |
float | 27.0 |
检测灵敏度阈值(越小越敏感) |
min_scene_len |
int | 15 |
最小场景帧数 |
- 输入列:
url(视频路径) - 输出列:新增
clip(切分后的片段路径) - 资源:CPU-only(4 CPU / 0 GPU)
S03 视频嵌入(Embed Video)-GPU
使用 NVIDIA Cosmos-Embed1-448p 模型生成视频语义嵌入向量,供后续聚类和去重使用。
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
model_name |
string | nvidia/Cosmos-Embed1-448p |
嵌入模型标识 |
model_path |
string | /opt/aihc/models |
模型根目录 |
model_batch_size |
int | 4 |
GPU forward batch size |
num_frames |
int | 8 |
每段视频采样帧数 |
- 输入列:视频路径(优先级:compressed > cropped > clip > url)
- 输出列:新增
video_embed(嵌入向量) - 资源:1×RTX 4090,2 CPU,16 CPU / 64GB 内存
S04 KMeans 聚类(KMeans)
对嵌入向量做 KMeans 聚类,分配 cluster_id,为语义去重提供分组依据。
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
n_clusters |
int | 1024 |
聚类数 |
backend |
string | auto |
聚类后端(auto/cuml/faiss/sklearn) |
max_iter |
int | 20 |
最大迭代数 |
- 输入列:
video_embed或image_embed - 输出列:新增
cluster_id(-1 表示无嵌入) - 资源:CPU-only,全局单次操作(concurrency=1)
S05 语义去重(Dedup)
在每个 cluster 内按余弦相似度去重,标记重复样本。
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
threshold |
float | 0.95 |
余弦相似度去重阈值 |
- 输入列:
embed,cluster_id - 输出列:新增
dedup_keep(bool,True=保留) - 资源:CPU-only,全局单次操作
S06 美学评分(Dover Aesthetic)- GPU
使用 DOVER 模型对视频进行美学质量评分。
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
backend |
string | dover |
评分后端(dover/laion) |
model_path |
string | /opt/aihc/model/dover |
DOVER 权重目录 |
num_frames |
int | 32 |
采样帧数 |
num_clips |
int | 1 |
采样 clip 数 |
- 输入列:视频路径
- 输出列:新增
dover_aesthetic(float 评分) - 资源:0.5×RTX 4090,2 CPU;Workers 3×(16 CPU / 64GB)
S07 NSFW 检测(NSFW Video)- GPU
使用 Falconsai/nsfw_image_detection 模型检测视频 NSFW 概率。
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
model_name |
string | Falconsai/nsfw_image_detection |
模型标识 |
model_path |
string | /opt/aihc/models |
模型根目录 |
num_frames |
int | 8 |
均匀采样帧数 |
- 输入列:视频路径
- 输出列:新增
video_nsfw(概率 float) - 资源:0.25×RTX 4090,2 CPU;Workers 3×(16 CPU / 64GB)
S08 质量过滤(Filter)
根据去重、美学评分、NSFW 检测三个维度综合过滤,更新 keep 标记。
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
dover_aesthetic_min |
float | 3.0 |
美学评分最低阈值 |
nsfw_threshold |
float | 0.5 |
NSFW 概率上限 |
- 输入列:
dedup_keep,dover_aesthetic,video_nsfw - 输出列:更新
keep(bool)+ 新增drop_reasons(列表) - 资源:CPU-only,纯 pandas/pyarrow 操作
-
过滤规则:
dedup_keep=False→ drop_reason: "dedup"dover_aesthetic < dover_aesthetic_min→ drop_reason: "dover_aes_low"video_nsfw > nsfw_threshold→ drop_reason: "video_nsfw"
S09 结构化 Caption(Caption)- GPU
使用 Qwen2.5-VL-7B-Instruct 通过 vLLM 对保留视频生成结构化文本描述。支持视频和图像双分支。
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
model_name |
string | Qwen/Qwen2.5-VL-7B-Instruct |
模型标识 |
model_path |
string | /opt/aihc/models |
模型根目录 |
backend |
string | auto |
推理后端(auto/vllm/transformers) |
tensor_parallel_size |
int | -1(自动) |
张量并行 GPU 数 |
gpu_memory_utilization |
float | 0.85 |
vLLM 显存占比 |
max_model_len |
int | -1(自动) |
最大序列长度 |
enforce_eager |
bool | false |
禁用 CUDA graphs |
lora_path |
string | 空 | LoRA 适配器路径(可选) |
- 输入列:
keep=True的视频/图像路径 - 输出列:新增
caption(结构化文本) - 资源:2×RTX 4090,16 CPU / 128GB 内存
S10 WebDataset 分片(Shard)
将 keep=True 的样本导出为 WebDataset tar 分片。
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
output_dir |
string | — | 分片输出目录 |
shard_prefix |
string | shard |
tar 文件前缀 |
max_shard_size_mb |
int | 512 |
单个分片最大 MB |
max_samples_per_shard |
int | 10000 |
单个分片最大样本数 |
- 输入:Lance 表中
keep=True的行 - 输出:
output_dir/shard-000000.tar等 - 资源:CPU-only,全局单次有序操作
S11 导出 LeRobot v3.0(Export LeRobot)
将 keep=True 的具身数据(含 action/state)导出为 LeRobot v3.0 格式数据集。
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
out |
string | — | LeRobot v3.0 输出目录 |
repo_id |
string | p6_curated_v3 |
数据集 repo ID |
fps |
int | 30 |
视频帧率 |
robot_type |
string | generic_hand |
机器人类型标签 |
action_dim |
int | 7 |
动作维度 |
use_videos |
bool | false |
是否包含视频列 |
vcodec |
string | h264 |
视频编码器 |
- 输入:Lance 表中
keep=True且含 action/state 的行 - 输出:LeRobot v3.0 数据集目录(data/*.parquet)
- 资源:CPU-only,Workers 2×(16 CPU / 64GB)
任务拓扑
[流程图 7342279715ae42a68dfbc53857a9b751 mxGraph]
- S00 → S09:严格串行,每步依赖前一步
- S09 → S10 / S11:并行执行(两个输出分支互不依赖)
- GPU 步骤:S03、S06、S07、S09
完整工作流YAML
1version: v1
2kind: PipelineTemplate
3
4inputs:
5- name: image
6 type: string
7 hint: 镜像地址
8 defaultValue: ccr-registry.baidubce.com/aihc/aihc-daft-gpu:0.5.2.12.2-cu129-py3.12-p6-sm120-sm89-ubuntu22.04
9- name: cpu_queue_id
10 type: string
11 hint: CPU 队列 ID
12 defaultValue: <YOUR_QUEUE_ID>
13- name: gpu_queue_id
14 type: string
15 hint: GPU 队列 ID
16 defaultValue: <YOUR_QUEUE_ID>
17- name: priority
18 type: string
19 defaultValue: high
20- name: pfs_id
21 type: string
22 hint: PFS 实例 ID
23 defaultValue: <YOUR_PFS_ID>
24- name: pfs_source_path
25 type: string
26 defaultValue: /
27- name: pfs_mount_path
28 type: string
29 defaultValue: /mnt/pfs
30- name: bos_source_path
31 type: string
32 hint: BOS sourcePath(代码/模型)
33 defaultValue: aihc-rdw-bj/aihc-daft
34- name: bos_mount_path
35 type: string
36 hint: BOS 挂载点(代码/模型)
37 defaultValue: /opt/aihc
38- name: input
39 type: string
40 hint: 源视频 manifest.jsonl 路径
41 defaultValue: /mnt/pfs/<YOUR_PATH>/input_data/p6/manifest.jsonl
42- name: lance_uri
43 type: string
44 hint: Lance 宽表 URI(s01-s10 共用)
45 defaultValue: bos://storage-aihc/aihc/<YOUR_PATH>/episodes.lance
46- name: tmp_dir
47 type: string
48 hint: 中间数据目录
49 defaultValue: /mnt/pfs/<YOUR_PATH>/tmp_data/p6
50- name: output_dir
51 type: string
52 hint: 最终产物输出目录
53 defaultValue: /mnt/pfs/<YOUR_PATH>/output_data/p6
54# BOS 凭证
55- name: bos_env_file
56 type: string
57 hint: BOS 凭证文件路径(含 BOS_ACCESS_KEY/BOS_SECRET_KEY)
58 defaultValue: /mnt/pfs/<YOUR_PATH>/env/bos_env
59# S00 IngestToLance
60- name: s00_source
61 type: string
62 defaultValue: manifest
63- name: s00_force
64 type: string
65 hint: 传 "--force" 则强制覆盖 Lance 表,留空则增量 append
66 defaultValue: "--force"
67# S02 SplitScene
68- name: threshold
69 type: string
70 defaultValue: "27.0"
71- name: min_scene_len
72 type: string
73 defaultValue: "15"
74- name: s02_num_cpus
75 type: string
76 defaultValue: "4.0"
77- name: s02_worker_replicas
78 type: int
79 defaultValue: 4
80- name: s02_worker_cpu
81 type: int
82 defaultValue: 16
83- name: s02_worker_memory
84 type: int
85 defaultValue: 64
86# S03 EmbedVideo
87- name: embed_model_name
88 type: string
89 defaultValue: /opt/aihc/model/nvidia/Cosmos-Embed1-448p
90- name: s03_num_gpus
91 type: string
92 defaultValue: "1.0"
93- name: s03_worker_replicas
94 type: int
95 defaultValue: 2
96- name: s03_worker_gpu
97 type: int
98 defaultValue: 1
99# S04 KMeans
100- name: n_clusters
101 type: string
102 defaultValue: "1024"
103# S06 DOVER
104- name: dover_model_name
105 type: string
106 defaultValue: /opt/aihc/model/dover
107- name: dover_backend
108 type: string
109 defaultValue: dover
110- name: dover_laion_mlp_path
111 type: string
112 defaultValue: /opt/aihc/model/laion_aesthetic_v2
113- name: dover_clip_model
114 type: string
115 defaultValue: /opt/aihc/model/openai/clip-vit-large-patch14
116- name: dover_num_frames
117 type: string
118 defaultValue: "32"
119- name: dover_num_clips
120 type: string
121 defaultValue: "1"
122# S07 NSFW
123- name: nsfw_model_name
124 type: string
125 defaultValue: /opt/aihc/model/Falconsai/nsfw_image_detection
126# S08 Filter
127- name: dover_aesthetic_min
128 type: string
129 defaultValue: "3.0"
130- name: nsfw_threshold
131 type: string
132 defaultValue: "0.5"
133# S09 Caption
134- name: caption_model_name
135 type: string
136 defaultValue: /opt/aihc/model/Qwen2.5-VL-7B-Instruct
137- name: s09_num_gpus
138 type: string
139 defaultValue: "2.0"
140- name: s09_backend
141 type: string
142 defaultValue: auto
143- name: s09_tensor_parallel_size
144 type: string
145 defaultValue: "-1"
146- name: s09_gpu_memory_utilization
147 type: string
148 defaultValue: "0.85"
149- name: s09_max_model_len
150 type: string
151 defaultValue: "-1"
152- name: s09_worker_replicas
153 type: int
154 defaultValue: 2
155- name: s09_worker_cpu
156 type: int
157 defaultValue: 16
158- name: s09_worker_memory
159 type: int
160 defaultValue: 128
161- name: s09_worker_gpu
162 type: int
163 defaultValue: 2
164# S10 Shard
165- name: max_shard_size_mb
166 type: string
167 defaultValue: "512.0"
168- name: shard_prefix
169 type: string
170 defaultValue: shard
171- name: max_samples_per_shard
172 type: string
173 defaultValue: "10000"
174# S11 Export LeRobot
175- name: repo_id
176 type: string
177 defaultValue: p6_curated_v3
178- name: s11_fps
179 type: string
180 defaultValue: "30"
181- name: s11_robot_type
182 type: string
183 defaultValue: generic_hand
184- name: s11_action_dim
185 type: string
186 defaultValue: "7"
187# 通用资源
188- name: head_cpu
189 type: int
190 defaultValue: 6
191- name: head_memory
192 type: int
193 defaultValue: 12
194- name: shared_memory
195 type: int
196 defaultValue: 30
197
198taskTemplates:
199# ========== S00: Ingest to Lance ==========
200- name: p6-00-ingest-to-lance
201 type: CustomTask
202 spec:
203 queue: '{{pipeline.parameters.cpu_queue_id}}'
204 priority: '{{pipeline.parameters.priority}}'
205 jobType: RayJob
206 command: >-
207 source {{pipeline.parameters.bos_env_file}} &&
208 export LD_LIBRARY_PATH=$(python3 -c "import os,sys;print(os.path.join(sys.prefix,'lib'))"):$LD_LIBRARY_PATH &&
209 python3 {{pipeline.parameters.bos_mount_path}}/workflow/p6_00_ingest_to_lance.py
210 --manifest {{pipeline.parameters.input}}
211 --output {{pipeline.parameters.lance_uri}}
212 --tmp-dir {{pipeline.parameters.tmp_dir}}
213 --source {{pipeline.parameters.s00_source}}
214 --num-cpus 1.0
215 {{pipeline.parameters.s00_force}}
216 jobSpec:
217 Head:
218 replicas: 1
219 restartPolicy: Never
220 image: '{{pipeline.parameters.image}}'
221 resources:
222 - name: cpu
223 quantity: '{{pipeline.parameters.head_cpu}}'
224 - name: memory
225 quantity: '{{pipeline.parameters.head_memory}}'
226 - name: sharedMemory
227 quantity: '{{pipeline.parameters.shared_memory}}'
228 cardLabel: ""
229 envs:
230 - name: LOG_COLLECTION
231 value: "true"
232 - name: DAFT_RUNNER
233 value: "ray"
234 - name: BOS_ENDPOINT
235 value: "https://bj.bcebos.com"
236 - name: BOS_S3_ENDPOINT
237 value: "https://s3.bj.bcebos.com"
238 - name: BOS_REGION
239 value: "bj"
240 - name: LANCE_DATA_STORAGE_VERSION
241 value: "stable"
242 - name: LANCE_ENABLE_V2_MANIFEST_PATHS
243 value: "1"
244 - name: HF_HUB_OFFLINE
245 value: "1"
246 - name: TRANSFORMERS_OFFLINE
247 value: "1"
248 command: ""
249 args: ""
250 postStart: ""
251 preStop: ""
252 Worker:
253 replicas: 2
254 restartPolicy: Never
255 image: '{{pipeline.parameters.image}}'
256 resources:
257 - name: cpu
258 quantity: 16
259 - name: memory
260 quantity: 64
261 - name: sharedMemory
262 quantity: '{{pipeline.parameters.shared_memory}}'
263 cardLabel: ""
264 envs:
265 - name: LOG_COLLECTION
266 value: "true"
267 - name: DAFT_RUNNER
268 value: "ray"
269 - name: BOS_ENDPOINT
270 value: "https://bj.bcebos.com"
271 - name: BOS_S3_ENDPOINT
272 value: "https://s3.bj.bcebos.com"
273 - name: BOS_REGION
274 value: "bj"
275 - name: LANCE_DATA_STORAGE_VERSION
276 value: "stable"
277 - name: LANCE_ENABLE_V2_MANIFEST_PATHS
278 value: "1"
279 - name: HF_HUB_OFFLINE
280 value: "1"
281 - name: TRANSFORMERS_OFFLINE
282 value: "1"
283 command: ""
284 args: ""
285 postStart: ""
286 preStop: ""
287 datasources:
288 - type: pfs
289 sourcePath: '{{pipeline.parameters.pfs_source_path}}'
290 mountPath: '{{pipeline.parameters.pfs_mount_path}}'
291 name: '{{pipeline.parameters.pfs_id}}'
292 - type: bos
293 name: ""
294 sourcePath: '{{pipeline.parameters.bos_source_path}}'
295 mountPath: '{{pipeline.parameters.bos_mount_path}}'
296 labels:
297 aijob.cce.baidubce.com/create-from-aihcp: "true"
298 aijob.cce.baidubce.com/log-collection: v3
299 autoCreatePVC: true
300 hostNetwork: false
301# ========== S01: Ingest ==========
302- name: p6-01-ingest
303 type: CustomTask
304 spec:
305 queue: '{{pipeline.parameters.cpu_queue_id}}'
306 priority: '{{pipeline.parameters.priority}}'
307 jobType: RayJob
308 command: >-
309 source {{pipeline.parameters.bos_env_file}} &&
310 export LD_LIBRARY_PATH=$(python3 -c "import os,sys;print(os.path.join(sys.prefix,'lib'))"):$LD_LIBRARY_PATH &&
311 python3 {{pipeline.parameters.bos_mount_path}}/workflow/p6_01_ingest.py
312 --input {{pipeline.parameters.lance_uri}}
313 --output {{pipeline.parameters.lance_uri}}
314 --tmp-dir {{pipeline.parameters.tmp_dir}}
315 --num-cpus 1.0
316 jobSpec:
317 Head:
318 replicas: 1
319 restartPolicy: Never
320 image: '{{pipeline.parameters.image}}'
321 resources:
322 - name: cpu
323 quantity: '{{pipeline.parameters.head_cpu}}'
324 - name: memory
325 quantity: '{{pipeline.parameters.head_memory}}'
326 - name: sharedMemory
327 quantity: '{{pipeline.parameters.shared_memory}}'
328 cardLabel: ""
329 envs:
330 - name: LOG_COLLECTION
331 value: "true"
332 - name: DAFT_RUNNER
333 value: "ray"
334 - name: BOS_ENDPOINT
335 value: "https://bj.bcebos.com"
336 - name: BOS_S3_ENDPOINT
337 value: "https://s3.bj.bcebos.com"
338 - name: BOS_REGION
339 value: "bj"
340 - name: LANCE_DATA_STORAGE_VERSION
341 value: "stable"
342 - name: LANCE_ENABLE_V2_MANIFEST_PATHS
343 value: "1"
344 - name: HF_HUB_OFFLINE
345 value: "1"
346 - name: TRANSFORMERS_OFFLINE
347 value: "1"
348 command: ""
349 args: ""
350 postStart: ""
351 preStop: ""
352 Worker:
353 replicas: 2
354 restartPolicy: Never
355 image: '{{pipeline.parameters.image}}'
356 resources:
357 - name: cpu
358 quantity: 16
359 - name: memory
360 quantity: 64
361 - name: sharedMemory
362 quantity: '{{pipeline.parameters.shared_memory}}'
363 cardLabel: ""
364 envs:
365 - name: LOG_COLLECTION
366 value: "true"
367 - name: DAFT_RUNNER
368 value: "ray"
369 - name: BOS_ENDPOINT
370 value: "https://bj.bcebos.com"
371 - name: BOS_S3_ENDPOINT
372 value: "https://s3.bj.bcebos.com"
373 - name: BOS_REGION
374 value: "bj"
375 - name: LANCE_DATA_STORAGE_VERSION
376 value: "stable"
377 - name: LANCE_ENABLE_V2_MANIFEST_PATHS
378 value: "1"
379 - name: HF_HUB_OFFLINE
380 value: "1"
381 - name: TRANSFORMERS_OFFLINE
382 value: "1"
383 command: ""
384 args: ""
385 postStart: ""
386 preStop: ""
387 datasources:
388 - type: pfs
389 sourcePath: '{{pipeline.parameters.pfs_source_path}}'
390 mountPath: '{{pipeline.parameters.pfs_mount_path}}'
391 name: '{{pipeline.parameters.pfs_id}}'
392 - type: bos
393 name: ""
394 sourcePath: '{{pipeline.parameters.bos_source_path}}'
395 mountPath: '{{pipeline.parameters.bos_mount_path}}'
396 labels:
397 aijob.cce.baidubce.com/create-from-aihcp: "true"
398 aijob.cce.baidubce.com/log-collection: v3
399 autoCreatePVC: true
400 hostNetwork: false
401# ========== S02: Split Scene (CPU) ==========
402- name: p6-02-split-scene
403 type: CustomTask
404 spec:
405 queue: '{{pipeline.parameters.cpu_queue_id}}'
406 priority: '{{pipeline.parameters.priority}}'
407 jobType: RayJob
408 command: >-
409 source {{pipeline.parameters.bos_env_file}} &&
410 export LD_LIBRARY_PATH=$(python3 -c "import os,sys;print(os.path.join(sys.prefix,'lib'))"):$LD_LIBRARY_PATH &&
411 DAFT_RUNNER=ray python3 {{pipeline.parameters.bos_mount_path}}/workflow/p6_02_split_scene.py
412 --input {{pipeline.parameters.lance_uri}}
413 --output {{pipeline.parameters.lance_uri}}
414 --tmp-dir {{pipeline.parameters.tmp_dir}}
415 --threshold {{pipeline.parameters.threshold}}
416 --min-scene-len {{pipeline.parameters.min_scene_len}}
417 --num-cpus {{pipeline.parameters.s02_num_cpus}}
418 --batch-size 1
419 jobSpec:
420 Head:
421 replicas: 1
422 restartPolicy: Never
423 image: '{{pipeline.parameters.image}}'
424 resources:
425 - name: cpu
426 quantity: '{{pipeline.parameters.head_cpu}}'
427 - name: memory
428 quantity: '{{pipeline.parameters.head_memory}}'
429 - name: sharedMemory
430 quantity: '{{pipeline.parameters.shared_memory}}'
431 cardLabel: ""
432 envs:
433 - name: LOG_COLLECTION
434 value: "true"
435 - name: DAFT_RUNNER
436 value: "ray"
437 - name: BOS_ENDPOINT
438 value: "https://bj.bcebos.com"
439 - name: BOS_S3_ENDPOINT
440 value: "https://s3.bj.bcebos.com"
441 - name: BOS_REGION
442 value: "bj"
443 - name: LANCE_DATA_STORAGE_VERSION
444 value: "stable"
445 - name: LANCE_ENABLE_V2_MANIFEST_PATHS
446 value: "1"
447 - name: HF_HUB_OFFLINE
448 value: "1"
449 - name: TRANSFORMERS_OFFLINE
450 value: "1"
451 command: ""
452 args: ""
453 postStart: ""
454 preStop: ""
455 Worker:
456 replicas: '{{pipeline.parameters.s02_worker_replicas}}'
457 restartPolicy: Never
458 image: '{{pipeline.parameters.image}}'
459 resources:
460 - name: cpu
461 quantity: '{{pipeline.parameters.s02_worker_cpu}}'
462 - name: memory
463 quantity: '{{pipeline.parameters.s02_worker_memory}}'
464 - name: sharedMemory
465 quantity: '{{pipeline.parameters.shared_memory}}'
466 cardLabel: ""
467 envs:
468 - name: LOG_COLLECTION
469 value: "true"
470 - name: DAFT_RUNNER
471 value: "ray"
472 - name: BOS_ENDPOINT
473 value: "https://bj.bcebos.com"
474 - name: BOS_S3_ENDPOINT
475 value: "https://s3.bj.bcebos.com"
476 - name: BOS_REGION
477 value: "bj"
478 - name: LANCE_DATA_STORAGE_VERSION
479 value: "stable"
480 - name: LANCE_ENABLE_V2_MANIFEST_PATHS
481 value: "1"
482 - name: HF_HUB_OFFLINE
483 value: "1"
484 - name: TRANSFORMERS_OFFLINE
485 value: "1"
486 command: ""
487 args: ""
488 postStart: ""
489 preStop: ""
490 datasources:
491 - type: pfs
492 sourcePath: '{{pipeline.parameters.pfs_source_path}}'
493 mountPath: '{{pipeline.parameters.pfs_mount_path}}'
494 name: '{{pipeline.parameters.pfs_id}}'
495 - type: bos
496 name: ""
497 sourcePath: '{{pipeline.parameters.bos_source_path}}'
498 mountPath: '{{pipeline.parameters.bos_mount_path}}'
499 labels:
500 aijob.cce.baidubce.com/create-from-aihcp: "true"
501 aijob.cce.baidubce.com/log-collection: v3
502 autoCreatePVC: true
503 hostNetwork: false
504# ========== S03: Embed Video (GPU) ==========
505- name: p6-03-embed-video
506 type: CustomTask
507 spec:
508 queue: '{{pipeline.parameters.gpu_queue_id}}'
509 priority: '{{pipeline.parameters.priority}}'
510 jobType: RayJob
511 command: >-
512 source {{pipeline.parameters.bos_env_file}} &&
513 export LD_LIBRARY_PATH=$(python3 -c "import os,sys;print(os.path.join(sys.prefix,'lib'))"):$LD_LIBRARY_PATH &&
514 DAFT_RUNNER=ray python3 {{pipeline.parameters.bos_mount_path}}/workflow/p6_03_embed_video.py
515 --input {{pipeline.parameters.lance_uri}}
516 --output {{pipeline.parameters.lance_uri}}
517 --tmp-dir {{pipeline.parameters.tmp_dir}}
518 --model-name {{pipeline.parameters.embed_model_name}}
519 --num-cpus 2.0
520 --num-gpus {{pipeline.parameters.s03_num_gpus}}
521 --batch-size 1
522 jobSpec:
523 Head:
524 replicas: 1
525 restartPolicy: Never
526 image: '{{pipeline.parameters.image}}'
527 resources:
528 - name: cpu
529 quantity: '{{pipeline.parameters.head_cpu}}'
530 - name: memory
531 quantity: '{{pipeline.parameters.head_memory}}'
532 - name: sharedMemory
533 quantity: '{{pipeline.parameters.shared_memory}}'
534 cardLabel: ""
535 envs:
536 - name: LOG_COLLECTION
537 value: "true"
538 - name: DAFT_RUNNER
539 value: "ray"
540 - name: BOS_ENDPOINT
541 value: "https://bj.bcebos.com"
542 - name: BOS_S3_ENDPOINT
543 value: "https://s3.bj.bcebos.com"
544 - name: BOS_REGION
545 value: "bj"
546 - name: LANCE_DATA_STORAGE_VERSION
547 value: "stable"
548 - name: LANCE_ENABLE_V2_MANIFEST_PATHS
549 value: "1"
550 - name: HF_HUB_OFFLINE
551 value: "1"
552 - name: TRANSFORMERS_OFFLINE
553 value: "1"
554 - name: AIHC_MODEL_DIR
555 value: "{{pipeline.parameters.embed_model_name}}"
556 command: ""
557 args: ""
558 postStart: ""
559 preStop: ""
560 Worker:
561 replicas: '{{pipeline.parameters.s03_worker_replicas}}'
562 restartPolicy: Never
563 image: '{{pipeline.parameters.image}}'
564 resources:
565 - name: cpu
566 quantity: 16
567 - name: memory
568 quantity: 64
569 - name: sharedMemory
570 quantity: '{{pipeline.parameters.shared_memory}}'
571 - name: baidu.com/rtx_4090_cgpu
572 quantity: '{{pipeline.parameters.s03_worker_gpu}}'
573 cardLabel: ""
574 envs:
575 - name: LOG_COLLECTION
576 value: "true"
577 - name: DAFT_RUNNER
578 value: "ray"
579 - name: BOS_ENDPOINT
580 value: "https://bj.bcebos.com"
581 - name: BOS_S3_ENDPOINT
582 value: "https://s3.bj.bcebos.com"
583 - name: BOS_REGION
584 value: "bj"
585 - name: LANCE_DATA_STORAGE_VERSION
586 value: "stable"
587 - name: LANCE_ENABLE_V2_MANIFEST_PATHS
588 value: "1"
589 - name: HF_HUB_OFFLINE
590 value: "1"
591 - name: TRANSFORMERS_OFFLINE
592 value: "1"
593 - name: AIHC_MODEL_DIR
594 value: "{{pipeline.parameters.embed_model_name}}"
595 command: ""
596 args: ""
597 postStart: ""
598 preStop: ""
599 datasources:
600 - type: pfs
601 sourcePath: '{{pipeline.parameters.pfs_source_path}}'
602 mountPath: '{{pipeline.parameters.pfs_mount_path}}'
603 name: '{{pipeline.parameters.pfs_id}}'
604 - type: bos
605 name: ""
606 sourcePath: '{{pipeline.parameters.bos_source_path}}'
607 mountPath: '{{pipeline.parameters.bos_mount_path}}'
608 labels:
609 aijob.cce.baidubce.com/create-from-aihcp: "true"
610 aijob.cce.baidubce.com/log-collection: v3
611 autoCreatePVC: true
612 hostNetwork: false
613# ========== S04: KMeans (CPU) ==========
614- name: p6-04-kmeans
615 type: CustomTask
616 spec:
617 queue: '{{pipeline.parameters.cpu_queue_id}}'
618 priority: '{{pipeline.parameters.priority}}'
619 jobType: RayJob
620 command: >-
621 source {{pipeline.parameters.bos_env_file}} &&
622 export LD_LIBRARY_PATH=$(python3 -c "import os,sys;print(os.path.join(sys.prefix,'lib'))"):$LD_LIBRARY_PATH &&
623 DAFT_RUNNER=ray python3 {{pipeline.parameters.bos_mount_path}}/workflow/p6_04_kmeans.py
624 --input {{pipeline.parameters.lance_uri}}
625 --output {{pipeline.parameters.lance_uri}}
626 --tmp-dir {{pipeline.parameters.tmp_dir}}
627 --n-clusters {{pipeline.parameters.n_clusters}}
628 --num-cpus 4.0
629 jobSpec:
630 Head:
631 replicas: 1
632 restartPolicy: Never
633 image: '{{pipeline.parameters.image}}'
634 resources:
635 - name: cpu
636 quantity: '{{pipeline.parameters.head_cpu}}'
637 - name: memory
638 quantity: '{{pipeline.parameters.head_memory}}'
639 - name: sharedMemory
640 quantity: '{{pipeline.parameters.shared_memory}}'
641 cardLabel: ""
642 envs:
643 - name: LOG_COLLECTION
644 value: "true"
645 - name: DAFT_RUNNER
646 value: "ray"
647 - name: BOS_ENDPOINT
648 value: "https://bj.bcebos.com"
649 - name: BOS_S3_ENDPOINT
650 value: "https://s3.bj.bcebos.com"
651 - name: BOS_REGION
652 value: "bj"
653 - name: LANCE_DATA_STORAGE_VERSION
654 value: "stable"
655 - name: LANCE_ENABLE_V2_MANIFEST_PATHS
656 value: "1"
657 - name: HF_HUB_OFFLINE
658 value: "1"
659 - name: TRANSFORMERS_OFFLINE
660 value: "1"
661 command: ""
662 args: ""
663 postStart: ""
664 preStop: ""
665 Worker:
666 replicas: 1
667 restartPolicy: Never
668 image: '{{pipeline.parameters.image}}'
669 resources:
670 - name: cpu
671 quantity: 16
672 - name: memory
673 quantity: 64
674 - name: sharedMemory
675 quantity: '{{pipeline.parameters.shared_memory}}'
676 cardLabel: ""
677 envs:
678 - name: LOG_COLLECTION
679 value: "true"
680 - name: DAFT_RUNNER
681 value: "ray"
682 - name: BOS_ENDPOINT
683 value: "https://bj.bcebos.com"
684 - name: BOS_S3_ENDPOINT
685 value: "https://s3.bj.bcebos.com"
686 - name: BOS_REGION
687 value: "bj"
688 - name: LANCE_DATA_STORAGE_VERSION
689 value: "stable"
690 - name: LANCE_ENABLE_V2_MANIFEST_PATHS
691 value: "1"
692 - name: HF_HUB_OFFLINE
693 value: "1"
694 - name: TRANSFORMERS_OFFLINE
695 value: "1"
696 command: ""
697 args: ""
698 postStart: ""
699 preStop: ""
700 datasources:
701 - type: pfs
702 sourcePath: '{{pipeline.parameters.pfs_source_path}}'
703 mountPath: '{{pipeline.parameters.pfs_mount_path}}'
704 name: '{{pipeline.parameters.pfs_id}}'
705 - type: bos
706 name: ""
707 sourcePath: '{{pipeline.parameters.bos_source_path}}'
708 mountPath: '{{pipeline.parameters.bos_mount_path}}'
709 labels:
710 aijob.cce.baidubce.com/create-from-aihcp: "true"
711 aijob.cce.baidubce.com/log-collection: v3
712 autoCreatePVC: true
713 hostNetwork: false
714# ========== S05: Dedup (CPU) ==========
715- name: p6-05-dedup
716 type: CustomTask
717 spec:
718 queue: '{{pipeline.parameters.cpu_queue_id}}'
719 priority: '{{pipeline.parameters.priority}}'
720 jobType: RayJob
721 command: >-
722 source {{pipeline.parameters.bos_env_file}} &&
723 export LD_LIBRARY_PATH=$(python3 -c "import os,sys;print(os.path.join(sys.prefix,'lib'))"):$LD_LIBRARY_PATH &&
724 DAFT_RUNNER=ray python3 {{pipeline.parameters.bos_mount_path}}/workflow/p6_05_dedup.py
725 --input {{pipeline.parameters.lance_uri}}
726 --output {{pipeline.parameters.lance_uri}}
727 --tmp-dir {{pipeline.parameters.tmp_dir}}
728 --threshold 0.95
729 --num-cpus 4.0
730 jobSpec:
731 Head:
732 replicas: 1
733 restartPolicy: Never
734 image: '{{pipeline.parameters.image}}'
735 resources:
736 - name: cpu
737 quantity: '{{pipeline.parameters.head_cpu}}'
738 - name: memory
739 quantity: '{{pipeline.parameters.head_memory}}'
740 - name: sharedMemory
741 quantity: '{{pipeline.parameters.shared_memory}}'
742 cardLabel: ""
743 envs:
744 - name: LOG_COLLECTION
745 value: "true"
746 - name: DAFT_RUNNER
747 value: "ray"
748 - name: BOS_ENDPOINT
749 value: "https://bj.bcebos.com"
750 - name: BOS_S3_ENDPOINT
751 value: "https://s3.bj.bcebos.com"
752 - name: BOS_REGION
753 value: "bj"
754 - name: LANCE_DATA_STORAGE_VERSION
755 value: "stable"
756 - name: LANCE_ENABLE_V2_MANIFEST_PATHS
757 value: "1"
758 - name: HF_HUB_OFFLINE
759 value: "1"
760 - name: TRANSFORMERS_OFFLINE
761 value: "1"
762 command: ""
763 args: ""
764 postStart: ""
765 preStop: ""
766 Worker:
767 replicas: 3
768 restartPolicy: Never
769 image: '{{pipeline.parameters.image}}'
770 resources:
771 - name: cpu
772 quantity: 16
773 - name: memory
774 quantity: 64
775 - name: sharedMemory
776 quantity: '{{pipeline.parameters.shared_memory}}'
777 cardLabel: ""
778 envs:
779 - name: LOG_COLLECTION
780 value: "true"
781 - name: DAFT_RUNNER
782 value: "ray"
783 - name: BOS_ENDPOINT
784 value: "https://bj.bcebos.com"
785 - name: BOS_S3_ENDPOINT
786 value: "https://s3.bj.bcebos.com"
787 - name: BOS_REGION
788 value: "bj"
789 - name: LANCE_DATA_STORAGE_VERSION
790 value: "stable"
791 - name: LANCE_ENABLE_V2_MANIFEST_PATHS
792 value: "1"
793 - name: HF_HUB_OFFLINE
794 value: "1"
795 - name: TRANSFORMERS_OFFLINE
796 value: "1"
797 command: ""
798 args: ""
799 postStart: ""
800 preStop: ""
801 datasources:
802 - type: pfs
803 sourcePath: '{{pipeline.parameters.pfs_source_path}}'
804 mountPath: '{{pipeline.parameters.pfs_mount_path}}'
805 name: '{{pipeline.parameters.pfs_id}}'
806 - type: bos
807 name: ""
808 sourcePath: '{{pipeline.parameters.bos_source_path}}'
809 mountPath: '{{pipeline.parameters.bos_mount_path}}'
810 labels:
811 aijob.cce.baidubce.com/create-from-aihcp: "true"
812 aijob.cce.baidubce.com/log-collection: v3
813 autoCreatePVC: true
814 hostNetwork: false
815# ========== S06: DOVER Aesthetic (GPU) ==========
816- name: p6-06-dover-aesthetic
817 type: CustomTask
818 spec:
819 queue: '{{pipeline.parameters.gpu_queue_id}}'
820 priority: '{{pipeline.parameters.priority}}'
821 jobType: RayJob
822 command: >-
823 source {{pipeline.parameters.bos_env_file}} &&
824 export LD_LIBRARY_PATH=$(python3 -c "import os,sys;print(os.path.join(sys.prefix,'lib'))"):$LD_LIBRARY_PATH &&
825 DAFT_RUNNER=ray python3 {{pipeline.parameters.bos_mount_path}}/workflow/p6_06_dover_aesthetic.py
826 --input {{pipeline.parameters.lance_uri}}
827 --output {{pipeline.parameters.lance_uri}}
828 --tmp-dir {{pipeline.parameters.tmp_dir}}
829 --model-path {{pipeline.parameters.dover_model_name}}
830 --backend {{pipeline.parameters.dover_backend}}
831 --laion-mlp-path {{pipeline.parameters.dover_laion_mlp_path}}
832 --clip-model {{pipeline.parameters.dover_clip_model}}
833 --num-frames {{pipeline.parameters.dover_num_frames}}
834 --num-clips {{pipeline.parameters.dover_num_clips}}
835 --num-cpus 2.0
836 --num-gpus 0.5
837 --batch-size 1
838 jobSpec:
839 Head:
840 replicas: 1
841 restartPolicy: Never
842 image: '{{pipeline.parameters.image}}'
843 resources:
844 - name: cpu
845 quantity: '{{pipeline.parameters.head_cpu}}'
846 - name: memory
847 quantity: '{{pipeline.parameters.head_memory}}'
848 - name: sharedMemory
849 quantity: '{{pipeline.parameters.shared_memory}}'
850 cardLabel: ""
851 envs:
852 - name: LOG_COLLECTION
853 value: "true"
854 - name: DAFT_RUNNER
855 value: "ray"
856 - name: BOS_ENDPOINT
857 value: "https://bj.bcebos.com"
858 - name: BOS_S3_ENDPOINT
859 value: "https://s3.bj.bcebos.com"
860 - name: BOS_REGION
861 value: "bj"
862 - name: LANCE_DATA_STORAGE_VERSION
863 value: "stable"
864 - name: LANCE_ENABLE_V2_MANIFEST_PATHS
865 value: "1"
866 - name: HF_HUB_OFFLINE
867 value: "1"
868 - name: TRANSFORMERS_OFFLINE
869 value: "1"
870 - name: AIHC_MODEL_DIR
871 value: "{{pipeline.parameters.dover_model_name}}"
872 command: ""
873 args: ""
874 postStart: ""
875 preStop: ""
876 Worker:
877 replicas: 3
878 restartPolicy: Never
879 image: '{{pipeline.parameters.image}}'
880 resources:
881 - name: cpu
882 quantity: 16
883 - name: memory
884 quantity: 64
885 - name: sharedMemory
886 quantity: '{{pipeline.parameters.shared_memory}}'
887 - name: baidu.com/rtx_4090_cgpu
888 quantity: 1
889 cardLabel: ""
890 envs:
891 - name: LOG_COLLECTION
892 value: "true"
893 - name: DAFT_RUNNER
894 value: "ray"
895 - name: BOS_ENDPOINT
896 value: "https://bj.bcebos.com"
897 - name: BOS_S3_ENDPOINT
898 value: "https://s3.bj.bcebos.com"
899 - name: BOS_REGION
900 value: "bj"
901 - name: LANCE_DATA_STORAGE_VERSION
902 value: "stable"
903 - name: LANCE_ENABLE_V2_MANIFEST_PATHS
904 value: "1"
905 - name: HF_HUB_OFFLINE
906 value: "1"
907 - name: TRANSFORMERS_OFFLINE
908 value: "1"
909 - name: AIHC_MODEL_DIR
910 value: "{{pipeline.parameters.dover_model_name}}"
911 command: ""
912 args: ""
913 postStart: ""
914 preStop: ""
915 datasources:
916 - type: pfs
917 sourcePath: '{{pipeline.parameters.pfs_source_path}}'
918 mountPath: '{{pipeline.parameters.pfs_mount_path}}'
919 name: '{{pipeline.parameters.pfs_id}}'
920 - type: bos
921 name: ""
922 sourcePath: '{{pipeline.parameters.bos_source_path}}'
923 mountPath: '{{pipeline.parameters.bos_mount_path}}'
924 labels:
925 aijob.cce.baidubce.com/create-from-aihcp: "true"
926 aijob.cce.baidubce.com/log-collection: v3
927 autoCreatePVC: true
928 hostNetwork: false
929# ========== S07: NSFW Video (GPU) ==========
930- name: p6-07-nsfw-video
931 type: CustomTask
932 spec:
933 queue: '{{pipeline.parameters.gpu_queue_id}}'
934 priority: '{{pipeline.parameters.priority}}'
935 jobType: RayJob
936 command: >-
937 source {{pipeline.parameters.bos_env_file}} &&
938 export LD_LIBRARY_PATH=$(python3 -c "import os,sys;print(os.path.join(sys.prefix,'lib'))"):$LD_LIBRARY_PATH &&
939 DAFT_RUNNER=ray python3 {{pipeline.parameters.bos_mount_path}}/workflow/p6_07_nsfw_video.py
940 --input {{pipeline.parameters.lance_uri}}
941 --output {{pipeline.parameters.lance_uri}}
942 --tmp-dir {{pipeline.parameters.tmp_dir}}
943 --model-name {{pipeline.parameters.nsfw_model_name}}
944 --num-cpus 2.0
945 --num-gpus 0.25
946 --batch-size 1
947 jobSpec:
948 Head:
949 replicas: 1
950 restartPolicy: Never
951 image: '{{pipeline.parameters.image}}'
952 resources:
953 - name: cpu
954 quantity: '{{pipeline.parameters.head_cpu}}'
955 - name: memory
956 quantity: '{{pipeline.parameters.head_memory}}'
957 - name: sharedMemory
958 quantity: '{{pipeline.parameters.shared_memory}}'
959 cardLabel: ""
960 envs:
961 - name: LOG_COLLECTION
962 value: "true"
963 - name: DAFT_RUNNER
964 value: "ray"
965 - name: BOS_ENDPOINT
966 value: "https://bj.bcebos.com"
967 - name: BOS_S3_ENDPOINT
968 value: "https://s3.bj.bcebos.com"
969 - name: BOS_REGION
970 value: "bj"
971 - name: LANCE_DATA_STORAGE_VERSION
972 value: "stable"
973 - name: LANCE_ENABLE_V2_MANIFEST_PATHS
974 value: "1"
975 - name: HF_HUB_OFFLINE
976 value: "1"
977 - name: TRANSFORMERS_OFFLINE
978 value: "1"
979 - name: AIHC_MODEL_DIR
980 value: "{{pipeline.parameters.nsfw_model_name}}"
981 command: ""
982 args: ""
983 postStart: ""
984 preStop: ""
985 Worker:
986 replicas: 3
987 restartPolicy: Never
988 image: '{{pipeline.parameters.image}}'
989 resources:
990 - name: cpu
991 quantity: 16
992 - name: memory
993 quantity: 64
994 - name: sharedMemory
995 quantity: '{{pipeline.parameters.shared_memory}}'
996 - name: baidu.com/rtx_4090_cgpu
997 quantity: 1
998 cardLabel: ""
999 envs:
1000 - name: LOG_COLLECTION
1001 value: "true"
1002 - name: DAFT_RUNNER
1003 value: "ray"
1004 - name: BOS_ENDPOINT
1005 value: "https://bj.bcebos.com"
1006 - name: BOS_S3_ENDPOINT
1007 value: "https://s3.bj.bcebos.com"
1008 - name: BOS_REGION
1009 value: "bj"
1010 - name: LANCE_DATA_STORAGE_VERSION
1011 value: "stable"
1012 - name: LANCE_ENABLE_V2_MANIFEST_PATHS
1013 value: "1"
1014 - name: HF_HUB_OFFLINE
1015 value: "1"
1016 - name: TRANSFORMERS_OFFLINE
1017 value: "1"
1018 - name: AIHC_MODEL_DIR
1019 value: "{{pipeline.parameters.nsfw_model_name}}"
1020 command: ""
1021 args: ""
1022 postStart: ""
1023 preStop: ""
1024 datasources:
1025 - type: pfs
1026 sourcePath: '{{pipeline.parameters.pfs_source_path}}'
1027 mountPath: '{{pipeline.parameters.pfs_mount_path}}'
1028 name: '{{pipeline.parameters.pfs_id}}'
1029 - type: bos
1030 name: ""
1031 sourcePath: '{{pipeline.parameters.bos_source_path}}'
1032 mountPath: '{{pipeline.parameters.bos_mount_path}}'
1033 labels:
1034 aijob.cce.baidubce.com/create-from-aihcp: "true"
1035 aijob.cce.baidubce.com/log-collection: v3
1036 autoCreatePVC: true
1037 hostNetwork: false
1038# ========== S08: Filter (CPU) ==========
1039- name: p6-08-filter
1040 type: CustomTask
1041 spec:
1042 queue: '{{pipeline.parameters.cpu_queue_id}}'
1043 priority: '{{pipeline.parameters.priority}}'
1044 jobType: RayJob
1045 command: >-
1046 source {{pipeline.parameters.bos_env_file}} &&
1047 export LD_LIBRARY_PATH=$(python3 -c "import os,sys;print(os.path.join(sys.prefix,'lib'))"):$LD_LIBRARY_PATH &&
1048 python3 {{pipeline.parameters.bos_mount_path}}/workflow/p6_08_filter.py
1049 --input {{pipeline.parameters.lance_uri}}
1050 --output {{pipeline.parameters.lance_uri}}
1051 --tmp-dir {{pipeline.parameters.tmp_dir}}
1052 --dover-aesthetic-min {{pipeline.parameters.dover_aesthetic_min}}
1053 --nsfw-threshold {{pipeline.parameters.nsfw_threshold}}
1054 --num-cpus 1.0
1055 jobSpec:
1056 Head:
1057 replicas: 1
1058 restartPolicy: Never
1059 image: '{{pipeline.parameters.image}}'
1060 resources:
1061 - name: cpu
1062 quantity: '{{pipeline.parameters.head_cpu}}'
1063 - name: memory
1064 quantity: '{{pipeline.parameters.head_memory}}'
1065 - name: sharedMemory
1066 quantity: '{{pipeline.parameters.shared_memory}}'
1067 cardLabel: ""
1068 envs:
1069 - name: LOG_COLLECTION
1070 value: "true"
1071 - name: DAFT_RUNNER
1072 value: "ray"
1073 - name: BOS_ENDPOINT
1074 value: "https://bj.bcebos.com"
1075 - name: BOS_S3_ENDPOINT
1076 value: "https://s3.bj.bcebos.com"
1077 - name: BOS_REGION
1078 value: "bj"
1079 - name: LANCE_DATA_STORAGE_VERSION
1080 value: "stable"
1081 - name: LANCE_ENABLE_V2_MANIFEST_PATHS
1082 value: "1"
1083 - name: HF_HUB_OFFLINE
1084 value: "1"
1085 - name: TRANSFORMERS_OFFLINE
1086 value: "1"
1087 command: ""
1088 args: ""
1089 postStart: ""
1090 preStop: ""
1091 Worker:
1092 replicas: 2
1093 restartPolicy: Never
1094 image: '{{pipeline.parameters.image}}'
1095 resources:
1096 - name: cpu
1097 quantity: 16
1098 - name: memory
1099 quantity: 64
1100 - name: sharedMemory
1101 quantity: '{{pipeline.parameters.shared_memory}}'
1102 cardLabel: ""
1103 envs:
1104 - name: LOG_COLLECTION
1105 value: "true"
1106 - name: DAFT_RUNNER
1107 value: "ray"
1108 - name: BOS_ENDPOINT
1109 value: "https://bj.bcebos.com"
1110 - name: BOS_S3_ENDPOINT
1111 value: "https://s3.bj.bcebos.com"
1112 - name: BOS_REGION
1113 value: "bj"
1114 - name: LANCE_DATA_STORAGE_VERSION
1115 value: "stable"
1116 - name: LANCE_ENABLE_V2_MANIFEST_PATHS
1117 value: "1"
1118 - name: HF_HUB_OFFLINE
1119 value: "1"
1120 - name: TRANSFORMERS_OFFLINE
1121 value: "1"
1122 command: ""
1123 args: ""
1124 postStart: ""
1125 preStop: ""
1126 datasources:
1127 - type: pfs
1128 sourcePath: '{{pipeline.parameters.pfs_source_path}}'
1129 mountPath: '{{pipeline.parameters.pfs_mount_path}}'
1130 name: '{{pipeline.parameters.pfs_id}}'
1131 - type: bos
1132 name: ""
1133 sourcePath: '{{pipeline.parameters.bos_source_path}}'
1134 mountPath: '{{pipeline.parameters.bos_mount_path}}'
1135 labels:
1136 aijob.cce.baidubce.com/create-from-aihcp: "true"
1137 aijob.cce.baidubce.com/log-collection: v3
1138 autoCreatePVC: true
1139 hostNetwork: false
1140# ========== S09: Caption (GPU) ==========
1141- name: p6-09-caption
1142 type: CustomTask
1143 spec:
1144 queue: '{{pipeline.parameters.gpu_queue_id}}'
1145 priority: '{{pipeline.parameters.priority}}'
1146 jobType: RayJob
1147 command: >-
1148 source {{pipeline.parameters.bos_env_file}} &&
1149 export LD_LIBRARY_PATH=$(python3 -c "import os,sys;print(os.path.join(sys.prefix,'lib'))"):$LD_LIBRARY_PATH &&
1150 DAFT_RUNNER=ray python3 {{pipeline.parameters.bos_mount_path}}/workflow/p6_09_caption.py
1151 --input {{pipeline.parameters.lance_uri}}
1152 --output {{pipeline.parameters.lance_uri}}
1153 --tmp-dir {{pipeline.parameters.tmp_dir}}
1154 --model-name {{pipeline.parameters.caption_model_name}}
1155 --backend {{pipeline.parameters.s09_backend}}
1156 --tensor-parallel-size {{pipeline.parameters.s09_tensor_parallel_size}}
1157 --gpu-memory-utilization {{pipeline.parameters.s09_gpu_memory_utilization}}
1158 --max-model-len {{pipeline.parameters.s09_max_model_len}}
1159 --num-cpus 2.0
1160 --num-gpus {{pipeline.parameters.s09_num_gpus}}
1161 --concurrency 1
1162 --batch-size 1
1163 jobSpec:
1164 Head:
1165 replicas: 1
1166 restartPolicy: Never
1167 image: '{{pipeline.parameters.image}}'
1168 resources:
1169 - name: cpu
1170 quantity: '{{pipeline.parameters.head_cpu}}'
1171 - name: memory
1172 quantity: '{{pipeline.parameters.head_memory}}'
1173 - name: sharedMemory
1174 quantity: '{{pipeline.parameters.shared_memory}}'
1175 cardLabel: ""
1176 envs:
1177 - name: LOG_COLLECTION
1178 value: "true"
1179 - name: DAFT_RUNNER
1180 value: "ray"
1181 - name: BOS_ENDPOINT
1182 value: "https://bj.bcebos.com"
1183 - name: BOS_S3_ENDPOINT
1184 value: "https://s3.bj.bcebos.com"
1185 - name: BOS_REGION
1186 value: "bj"
1187 - name: LANCE_DATA_STORAGE_VERSION
1188 value: "stable"
1189 - name: LANCE_ENABLE_V2_MANIFEST_PATHS
1190 value: "1"
1191 - name: HF_HUB_OFFLINE
1192 value: "1"
1193 - name: TRANSFORMERS_OFFLINE
1194 value: "1"
1195 - name: AIHC_MODEL_DIR
1196 value: "{{pipeline.parameters.caption_model_name}}"
1197 - name: CUDA_VISIBLE_DEVICES
1198 value: "0,1"
1199 - name: VLM_NUM_GPUS
1200 value: "2"
1201 - name: VLM_CONCURRENCY
1202 value: "1"
1203 command: ""
1204 args: ""
1205 postStart: ""
1206 preStop: ""
1207 Worker:
1208 replicas: '{{pipeline.parameters.s09_worker_replicas}}'
1209 restartPolicy: Never
1210 image: '{{pipeline.parameters.image}}'
1211 resources:
1212 - name: cpu
1213 quantity: '{{pipeline.parameters.s09_worker_cpu}}'
1214 - name: memory
1215 quantity: '{{pipeline.parameters.s09_worker_memory}}'
1216 - name: sharedMemory
1217 quantity: '{{pipeline.parameters.shared_memory}}'
1218 - name: baidu.com/rtx_4090_cgpu
1219 quantity: '{{pipeline.parameters.s09_worker_gpu}}'
1220 cardLabel: ""
1221 envs:
1222 - name: LOG_COLLECTION
1223 value: "true"
1224 - name: DAFT_RUNNER
1225 value: "ray"
1226 - name: BOS_ENDPOINT
1227 value: "https://bj.bcebos.com"
1228 - name: BOS_S3_ENDPOINT
1229 value: "https://s3.bj.bcebos.com"
1230 - name: BOS_REGION
1231 value: "bj"
1232 - name: LANCE_DATA_STORAGE_VERSION
1233 value: "stable"
1234 - name: LANCE_ENABLE_V2_MANIFEST_PATHS
1235 value: "1"
1236 - name: HF_HUB_OFFLINE
1237 value: "1"
1238 - name: TRANSFORMERS_OFFLINE
1239 value: "1"
1240 - name: CUDA_VISIBLE_DEVICES
1241 value: "0,1"
1242 - name: VLM_NUM_GPUS
1243 value: "2"
1244 - name: VLM_CONCURRENCY
1245 value: "1"
1246 command: ""
1247 args: ""
1248 postStart: ""
1249 preStop: ""
1250 datasources:
1251 - type: pfs
1252 sourcePath: '{{pipeline.parameters.pfs_source_path}}'
1253 mountPath: '{{pipeline.parameters.pfs_mount_path}}'
1254 name: '{{pipeline.parameters.pfs_id}}'
1255 - type: bos
1256 name: ""
1257 sourcePath: '{{pipeline.parameters.bos_source_path}}'
1258 mountPath: '{{pipeline.parameters.bos_mount_path}}'
1259 labels:
1260 aijob.cce.baidubce.com/create-from-aihcp: "true"
1261 aijob.cce.baidubce.com/log-collection: v3
1262 autoCreatePVC: true
1263 hostNetwork: false
1264# ========== S10: Shard (CPU) ==========
1265- name: p6-10-shard
1266 type: CustomTask
1267 spec:
1268 queue: '{{pipeline.parameters.cpu_queue_id}}'
1269 priority: '{{pipeline.parameters.priority}}'
1270 jobType: RayJob
1271 command: >-
1272 source {{pipeline.parameters.bos_env_file}} &&
1273 export LD_LIBRARY_PATH=$(python3 -c "import os,sys;print(os.path.join(sys.prefix,'lib'))"):$LD_LIBRARY_PATH &&
1274 DAFT_RUNNER=ray python3 {{pipeline.parameters.bos_mount_path}}/workflow/p6_10_shard.py
1275 --input {{pipeline.parameters.lance_uri}}
1276 --output {{pipeline.parameters.lance_uri}}
1277 --tmp-dir {{pipeline.parameters.tmp_dir}}
1278 --output-dir {{pipeline.parameters.output_dir}}/shards
1279 --shard-prefix {{pipeline.parameters.shard_prefix}}
1280 --max-shard-size-mb {{pipeline.parameters.max_shard_size_mb}}
1281 --max-samples-per-shard {{pipeline.parameters.max_samples_per_shard}}
1282 --num-cpus 2.0
1283 jobSpec:
1284 Head:
1285 replicas: 1
1286 restartPolicy: Never
1287 image: '{{pipeline.parameters.image}}'
1288 resources:
1289 - name: cpu
1290 quantity: '{{pipeline.parameters.head_cpu}}'
1291 - name: memory
1292 quantity: '{{pipeline.parameters.head_memory}}'
1293 - name: sharedMemory
1294 quantity: '{{pipeline.parameters.shared_memory}}'
1295 cardLabel: ""
1296 envs:
1297 - name: LOG_COLLECTION
1298 value: "true"
1299 - name: DAFT_RUNNER
1300 value: "ray"
1301 - name: BOS_ENDPOINT
1302 value: "https://bj.bcebos.com"
1303 - name: BOS_S3_ENDPOINT
1304 value: "https://s3.bj.bcebos.com"
1305 - name: BOS_REGION
1306 value: "bj"
1307 - name: LANCE_DATA_STORAGE_VERSION
1308 value: "stable"
1309 - name: LANCE_ENABLE_V2_MANIFEST_PATHS
1310 value: "1"
1311 - name: HF_HUB_OFFLINE
1312 value: "1"
1313 - name: TRANSFORMERS_OFFLINE
1314 value: "1"
1315 command: ""
1316 args: ""
1317 postStart: ""
1318 preStop: ""
1319 Worker:
1320 replicas: 0
1321 restartPolicy: Never
1322 image: '{{pipeline.parameters.image}}'
1323 resources:
1324 - name: cpu
1325 quantity: 16
1326 - name: memory
1327 quantity: 64
1328 - name: sharedMemory
1329 quantity: '{{pipeline.parameters.shared_memory}}'
1330 cardLabel: ""
1331 envs:
1332 - name: LOG_COLLECTION
1333 value: "true"
1334 - name: DAFT_RUNNER
1335 value: "ray"
1336 - name: BOS_ENDPOINT
1337 value: "https://bj.bcebos.com"
1338 - name: BOS_S3_ENDPOINT
1339 value: "https://s3.bj.bcebos.com"
1340 - name: BOS_REGION
1341 value: "bj"
1342 - name: LANCE_DATA_STORAGE_VERSION
1343 value: "stable"
1344 - name: LANCE_ENABLE_V2_MANIFEST_PATHS
1345 value: "1"
1346 - name: HF_HUB_OFFLINE
1347 value: "1"
1348 - name: TRANSFORMERS_OFFLINE
1349 value: "1"
1350 command: ""
1351 args: ""
1352 postStart: ""
1353 preStop: ""
1354 datasources:
1355 - type: pfs
1356 sourcePath: '{{pipeline.parameters.pfs_source_path}}'
1357 mountPath: '{{pipeline.parameters.pfs_mount_path}}'
1358 name: '{{pipeline.parameters.pfs_id}}'
1359 - type: bos
1360 name: ""
1361 sourcePath: '{{pipeline.parameters.bos_source_path}}'
1362 mountPath: '{{pipeline.parameters.bos_mount_path}}'
1363 labels:
1364 aijob.cce.baidubce.com/create-from-aihcp: "true"
1365 aijob.cce.baidubce.com/log-collection: v3
1366 autoCreatePVC: true
1367 hostNetwork: false
1368# ========== S11: Export LeRobot v3.0 (CPU) ==========
1369- name: p6-11-export-lerobot-v30
1370 type: CustomTask
1371 spec:
1372 queue: '{{pipeline.parameters.cpu_queue_id}}'
1373 priority: '{{pipeline.parameters.priority}}'
1374 jobType: RayJob
1375 command: >-
1376 source {{pipeline.parameters.bos_env_file}} &&
1377 export LD_LIBRARY_PATH=$(python3 -c "import os,sys;print(os.path.join(sys.prefix,'lib'))"):$LD_LIBRARY_PATH &&
1378 DAFT_RUNNER=ray python3 {{pipeline.parameters.bos_mount_path}}/workflow/p6_11_export_lerobot_v30.py
1379 --input {{pipeline.parameters.lance_uri}}
1380 --output {{pipeline.parameters.lance_uri}}
1381 --tmp-dir {{pipeline.parameters.tmp_dir}}
1382 --out {{pipeline.parameters.output_dir}}/lerobot_v3
1383 --repo-id {{pipeline.parameters.repo_id}}
1384 --fps {{pipeline.parameters.s11_fps}}
1385 --robot-type {{pipeline.parameters.s11_robot_type}}
1386 --action-dim {{pipeline.parameters.s11_action_dim}}
1387 --num-cpus 1.0
1388 --concurrency 1
1389 --batch-size 1
1390 jobSpec:
1391 Head:
1392 replicas: 1
1393 restartPolicy: Never
1394 image: '{{pipeline.parameters.image}}'
1395 resources:
1396 - name: cpu
1397 quantity: '{{pipeline.parameters.head_cpu}}'
1398 - name: memory
1399 quantity: '{{pipeline.parameters.head_memory}}'
1400 - name: sharedMemory
1401 quantity: '{{pipeline.parameters.shared_memory}}'
1402 cardLabel: ""
1403 envs:
1404 - name: LOG_COLLECTION
1405 value: "true"
1406 - name: DAFT_RUNNER
1407 value: "ray"
1408 - name: BOS_ENDPOINT
1409 value: "https://bj.bcebos.com"
1410 - name: BOS_S3_ENDPOINT
1411 value: "https://s3.bj.bcebos.com"
1412 - name: BOS_REGION
1413 value: "bj"
1414 - name: LANCE_DATA_STORAGE_VERSION
1415 value: "stable"
1416 - name: LANCE_ENABLE_V2_MANIFEST_PATHS
1417 value: "1"
1418 - name: HF_HUB_OFFLINE
1419 value: "1"
1420 - name: TRANSFORMERS_OFFLINE
1421 value: "1"
1422 command: ""
1423 args: ""
1424 postStart: ""
1425 preStop: ""
1426 Worker:
1427 replicas: 2
1428 restartPolicy: Never
1429 image: '{{pipeline.parameters.image}}'
1430 resources:
1431 - name: cpu
1432 quantity: 16
1433 - name: memory
1434 quantity: 64
1435 - name: sharedMemory
1436 quantity: '{{pipeline.parameters.shared_memory}}'
1437 cardLabel: ""
1438 envs:
1439 - name: LOG_COLLECTION
1440 value: "true"
1441 - name: DAFT_RUNNER
1442 value: "ray"
1443 - name: BOS_ENDPOINT
1444 value: "https://bj.bcebos.com"
1445 - name: BOS_S3_ENDPOINT
1446 value: "https://s3.bj.bcebos.com"
1447 - name: BOS_REGION
1448 value: "bj"
1449 - name: LANCE_DATA_STORAGE_VERSION
1450 value: "stable"
1451 - name: LANCE_ENABLE_V2_MANIFEST_PATHS
1452 value: "1"
1453 - name: HF_HUB_OFFLINE
1454 value: "1"
1455 - name: TRANSFORMERS_OFFLINE
1456 value: "1"
1457 command: ""
1458 args: ""
1459 postStart: ""
1460 preStop: ""
1461 datasources:
1462 - type: pfs
1463 sourcePath: '{{pipeline.parameters.pfs_source_path}}'
1464 mountPath: '{{pipeline.parameters.pfs_mount_path}}'
1465 name: '{{pipeline.parameters.pfs_id}}'
1466 - type: bos
1467 name: ""
1468 sourcePath: '{{pipeline.parameters.bos_source_path}}'
1469 mountPath: '{{pipeline.parameters.bos_mount_path}}'
1470 labels:
1471 aijob.cce.baidubce.com/create-from-aihcp: "true"
1472 aijob.cce.baidubce.com/log-collection: v3
1473 autoCreatePVC: true
1474 hostNetwork: false
1475
1476# ========== DAG: 线性 12 步 ==========
1477tasks:
1478- name: step00-ingest-to-lance
1479 taskTemplateName: p6-00-ingest-to-lance
1480
1481- name: step01-ingest
1482 taskTemplateName: p6-01-ingest
1483 dependencies:
1484 - step00-ingest-to-lance
1485
1486- name: step02-split-scene
1487 taskTemplateName: p6-02-split-scene
1488 dependencies:
1489 - step01-ingest
1490
1491- name: step03-embed-video
1492 taskTemplateName: p6-03-embed-video
1493 dependencies:
1494 - step02-split-scene
1495
1496- name: step04-kmeans
1497 taskTemplateName: p6-04-kmeans
1498 dependencies:
1499 - step03-embed-video
1500
1501- name: step05-dedup
1502 taskTemplateName: p6-05-dedup
1503 dependencies:
1504 - step04-kmeans
1505
1506- name: step06-dover-aesthetic
1507 taskTemplateName: p6-06-dover-aesthetic
1508 dependencies:
1509 - step05-dedup
1510
1511- name: step07-nsfw-video
1512 taskTemplateName: p6-07-nsfw-video
1513 dependencies:
1514 - step06-dover-aesthetic
1515
1516- name: step08-filter
1517 taskTemplateName: p6-08-filter
1518 dependencies:
1519 - step07-nsfw-video
1520
1521- name: step09-caption
1522 taskTemplateName: p6-09-caption
1523 dependencies:
1524 - step08-filter
1525
1526- name: step10-shard
1527 taskTemplateName: p6-10-shard
1528 dependencies:
1529 - step09-caption
1530
1531- name: step11-export-lerobot
1532 taskTemplateName: p6-11-export-lerobot-v30
1533 dependencies:
1534 - step09-caption
单步独立执行
每个步骤也提供独立的工作流模板,可以单独提交运行,适用于调试或从中间步骤恢复执行。
例如单独运行 S03 视频嵌入:
1version: v1
2kind: PipelineTemplate
3
4inputs:
5- name: image
6 type: string
7 defaultValue: ccr-registry.baidubce.com/aihc/aihc-daft-gpu:0.5.2.12.2-cu129-py3.12-p6-sm120-sm89-ubuntu22.04
8- name: queue_id
9 type: string
10 hint: GPU 队列 ID
11- name: lance_uri
12 type: string
13 hint: Lance 表 URI
14- name: model_name
15 type: string
16 defaultValue: nvidia/Cosmos-Embed1-448p
17- name: num_frames
18 type: int
19 defaultValue: 8
20- name: model_batch_size
21 type: int
22 defaultValue: 4
23
24taskTemplates:
25- name: p6-03-embed-video
26 type: CustomTask
27 spec:
28 queue: '{{pipeline.parameters.queue_id}}'
29 priority: high
30 jobType: RayJob
31 command: >-
32 DAFT_RUNNER=ray python3 /opt/aihc/workflow/p6_03_embed_video.py
33 --input {{pipeline.parameters.lance_uri}}
34 --output {{pipeline.parameters.lance_uri}}
35 --model-name {{pipeline.parameters.model_name}}
36 --num-frames {{pipeline.parameters.num_frames}}
37 --model-batch-size {{pipeline.parameters.model_batch_size}}
38 jobSpec:
39 Head:
40 replicas: 1
41 restartPolicy: Never
42 image: '{{pipeline.parameters.image}}'
43 resources:
44 - name: cpu
45 quantity: 6
46 - name: memory
47 quantity: 12
48 Worker:
49 replicas: 2
50 restartPolicy: Never
51 image: '{{pipeline.parameters.image}}'
52 resources:
53 - name: cpu
54 quantity: 16
55 - name: memory
56 quantity: 64
57 - name: baidu.com/rtx_4090_cgpu
58 quantity: 1
59
60tasks:
61- name: embed-video-task
62 taskTemplateName: p6-03-embed-video
使用建议
- Lance 增量处理:S00 支持增量追加(按 sample_id diff),无需每次全量重跑;
--force可强制覆盖重建 - GPU 步骤是瓶颈:S03/S06/S07/S09 需要 GPU,可通过增加
worker_replicas提升吞吐 - S09 Caption 资源较重:默认需要 2×RTX 4090 + 128GB 内存,如显存不足可降低
gpu_memory_utilization或使用更小模型 - 过滤阈值可调:
dover_aesthetic_min和nsfw_threshold可根据数据质量灵活调整 - S10/S11 并行输出:WebDataset 分片供视觉-语言训练,LeRobot 供具身策略训练,按需启用
- 离线模式:镜像内模型预装在
/opt/aihc/models,设置HF_HUB_OFFLINE=1避免网络依赖 - 全局单次操作:S04(KMeans)和 S05(Dedup)为全局操作,concurrency 和 batch-size 参数无效
评价此篇文章
