LLaVA-OneVision-2 is an openly released multimodal AI model and training framework that processes images, long-form video, and spatial information. Researchers use it to train, evaluate, and reproduce vision-language models with the project’s released data, encoders, checkpoints, and training records. The catalogue skills support work with this model and its training resources.
Borrowing it
Nothing to install: this file belongs to EvolvingLMMs-Lab/LLaVA-OneVision-2. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/EvolvingLMMs-Lab/LLaVA-OneVision-2/main/.opencode/skills/length-pool-sort-dataset/SKILL.mdgit clone --depth 1 https://github.com/EvolvingLMMs-Lab/LLaVA-OneVision-2Wrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/evolvinglmms-lab/llava-onevision-2/length-pool-sort-dataset)<a href="https://agentmods.dev/skills/evolvinglmms-lab/llava-onevision-2/length-pool-sort-dataset"><img src="https://agentmods.dev/badge/skills/evolvinglmms-lab/llava-onevision-2/length-pool-sort-dataset.svg" alt="Measured on agentmods" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00027 | $0.02644 |
| Opus 5 | $0.00014 | $0.01322 |
| Sonnet 5 | $0.00005 | $0.00529 |
| Haiku 4.5 | $0.00003 | $0.00264 |
Grade A, and why
length-pool-sort-dataset scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 218 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Purpose / 用途
Use this skill when analyzing, debugging, or tuning LengthPoolSortDataset — the cross-rank length synchronization mechanism used in this repository's training pipeline.
在分析、调试或调优本仓库训练 pipeline 中的跨 rank 长度同步机制 LengthPoolSortDataset 时,使用这个 skill。
This skill is specifically for:
aiak_training_llm/data/multimodal/length_sort_dataset.py- Understanding why training speed improves when
length_sort_pool_size > 0 - Tuning
pool_sizefor optimal multi-GPU efficiency - Diagnosing rank synchronization bottlenecks
这个 skill 专门用于:
aiak_training_llm/data/multimodal/length_sort_dataset.py- 理解为什么
length_sort_pool_size > 0时训练速度提升 - 调优
pool_size以获得最佳多卡效率 - 排查 rank 间同步瓶颈
Core mechanism / 核心机制
Three-step pipeline / 三步流水线
上游 dataset → 累积 pool_size 个 sample → 按序列长度排序 → 用确定性 seed shuffle → 逐个 yield
for batch_idx, sample in enumerate(self.dataset):
pool.append(sample)
if len(pool) >= self.pool_size:
pool.sort(key=self.key_fn) # 1. 按长度排序
shuffle_seed = 42 + batch_idx # 2. 确定性 seed
random.Random(shuffle_seed).shuffle(pool) # 3. 同 seed shuffle
for s in pool:
yield s
pool.clear()
Pipeline position / 在 pipeline 中的位置
CrudeWebdataset → ShuffleBuffer → cook_crude_sample → encode_sample
→ LengthPoolSortDataset → BatchDataset → EpochizeDataset → LogSampleDataset
Inserted after encode_sample (where total_len / tokens are available) and before BatchDataset.
插在 encode_sample 之后(此时已有 total_len / tokens)、BatchDataset 之前。
Activated by: --length-sort-pool-size N (where N > 0).
通过 --length-sort-pool-size N(N > 0)激活。
Why it accelerates training / 为什么能加速训练
The problem / 问题
In multi-GPU data-parallel training, all ranks must synchronize at each step (gradient all-reduce). If different ranks process samples of very different lengths, fast ranks idle waiting for slow ranks.
多卡数据并行训练中,所有 rank 每步都要同步(梯度 all-reduce)。如果不同 rank 处理的 sample 长度差异很大,快的 rank 空等慢的 rank。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago First seen · 218 lines · 27 tokens per session scan A 4362345ebfe5
length-pool-sort-dataset is a skill published in the GitHub repository EvolvingLMMs-Lab/LLaVA-OneVision-2 (1,199 stars, last pushed today), licensed Apache-2.0. It adds 27 tokens to every session and 2,644 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
add-new-model
Use this skill when the user wants to add or port a new model architecture to MLX-VLM — mapping a Hugging Face modeltype to a new file under mlxvlm/models, writing the ModelConfig, matching layer/weight names, reusing a similar existing model, adding a test class, and validating the port. Covers vision-language…
convert-quantize
Use this skill when the user wants to convert a Hugging Face model to MLX or quantize/dequantize one with mlxvlm.convert, including bits and group size, quant modes (affine, mxfp4, nvfp4, mxfp8), RTN vs AWQ, mixed-bit recipes, dtype casts, calibration (text or multimodal), local vs Hub paths, revisions, uploading to…
cli-inference
Use this skill when the user wants to run or debug MLX-VLM inference from the command line, including uv run mlxvlm.generate, image/audio/video inputs, local model paths, Hugging Face model IDs, deterministic repro commands, and CLI errors around processors, prompts, model loading, or missing weights.
server-inference
Use this skill when the user wants to run or debug MLX-VLM server inference, including uv run mlxvlm.server, /v1/models, /v1/chat/completions, /v1/responses, streaming, OpenAI-compatible clients, health checks, metrics, model unload/reload, adapters, trust-remote-code, and server request/response failures.
hf-cache-models
Use this skill when the user wants to list, inspect, or report MLX-VLM model candidates available in the local Hugging Face cache directory, including the server's opt-in hf-cache discovery mode, cache-dir overrides, JSON output, or issue-ready cached model lists.
weights-and-biases
W&B: log ML experiments, sweeps, model registry, dashboards.