LLaVA-OneVision-2: Skill for OpenCode

.opencode/skills/length-pool-sort-dataset/SKILL.md

length-pool-sort-dataset is a skill for OpenCode from EvolvingLMMs-Lab/LLaVA-OneVision-2. It costs 27 tokens per session (2,644 once invoked), scanned A, original, Apache-2.0.

A bilingual guide to LengthPoolSortDataset, a dataset component that groups samples by sequence length before sending them to multiple GPUs. Multi-GPU training uses several graphics processors at the same time.

In plain words
What is it for?
Use it to inspect, debug, or tune the pool size and cross-GPU length synchronization in the repository's multimodal training pipeline.
Why use it?
It helps explain why grouping similar-length samples can speed training and where synchronization between GPUs may slow it down.

Skill for OpenCode

Written for OpenCode: installed under .opencode/. Also seen: mentions OpenCode.

This is EvolvingLMMs-Lab/LLaVA-OneVision-2's own configuration. It tells OpenCode how to work on LLaVA-OneVision-2 itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything LLaVA-OneVision-2 configures →

About the project

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.

EvolvingLMMs-Lab/LLaVA-OneVision-2 · 1,232 stars · on GitHub · evolvinglmms-lab.github.io

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/EvolvingLMMs-Lab/LLaVA-OneVision-2/main/.opencode/skills/length-pool-sort-dataset/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/EvolvingLMMs-Lab/LLaVA-OneVision-2

Made for: OpenCode.

Wrote 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.

agentmods badge for length-pool-sort-dataset

README.md
[![agentmods](https://agentmods.dev/badge/skills/evolvinglmms-lab/llava-onevision-2/length-pool-sort-dataset/github.svg)](https://agentmods.dev/skills/evolvinglmms-lab/llava-onevision-2/length-pool-sort-dataset)
Your own site
<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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for length-pool-sort-dataset

Your own site · 80×15
<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="Reviewed on agentmods" width="80" height="20"></a>
Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,644 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00027 $0.02644
Opus 5.5 $0.00011 $0.01058
Sonnet 5.5 $0.00005 $0.00529
Haiku 4.5 $0.00003 $0.00264

Measured 2mo ago against content hash 4362345ebfe5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 2mo 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.

.opencode/skills/length-pool-sort-dataset/SKILL.md · 218 lines

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_size for 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。

Read the full file on GitHub · 218 lines

Changes

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.

  1. 2mo ago First seen · 218 lines · 27 tokens per session scan A 4362345ebfe5

Subscribe to this mod's changes

length-pool-sort-dataset is a skill published in the GitHub repository EvolvingLMMs-Lab/LLaVA-OneVision-2 (1,232 stars, last pushed yesterday), licensed Apache-2.0. It adds 27 tokens to every session and 2,644 once invoked, about $0.0001 per session on Opus 5.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.

Related

length-pool-sort-dataset compared with skills from other repositories

length-pool-sort-dataset next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
length-pool-sort-datasetEvolvingLMMs-Lab/LLaVA-OneVision-2Skill1.2kyesterdayApache-2.0A27OpenCode
add-new-modelBlaizzy/mlx-vlmSkill5.7k4d agoMITA83Claude Code
cli-inferenceBlaizzy/mlx-vlmSkill5.7k4d agoMITA67Claude Code
convert-quantizeBlaizzy/mlx-vlmSkill5.7k4d agoMITA99Claude Code
server-inferenceBlaizzy/mlx-vlmSkill5.7k4d agoMITA80Claude Code
hf-cache-modelsBlaizzy/mlx-vlmSkill5.7k4d agoMITA38Claude Code
mle-workflowaffaan-m/ECCSkill298k4d agoMITA44Claude Code, Codex