LLaVA-OneVision-2: Skill for OpenCode

.opencode/skills/megatron-checkpoint-layout/SKILL.md

megatron-checkpoint-layout is a skill for OpenCode from EvolvingLMMs-Lab/LLaVA-OneVision-2. It costs 33 tokens per session (1,367 once invoked), scanned A, original, Apache-2.0.

A bilingual guide to how Megatron and Megatron-Core model checkpoints are arranged across tensor, pipeline, and expert parallelism. A checkpoint is a saved model state, and parallelism means splitting model work or data across devices.

In plain words
What is it for?
Use it to identify whether a checkpoint uses one, two, or three layout dimensions and to interpret names such as mp_rank_{tp}_{pp}_{ep}.
Why use it?
It prevents confusing pipeline parallelism with expert parallelism when locating or converting checkpoint files. The directory naming depends on which kinds of splitting are used.

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,199 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/megatron-checkpoint-layout/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 megatron-checkpoint-layout

README.md
[![agentmods](https://agentmods.dev/badge/skills/evolvinglmms-lab/llava-onevision-2/megatron-checkpoint-layout/github.svg)](https://agentmods.dev/skills/evolvinglmms-lab/llava-onevision-2/megatron-checkpoint-layout)
Your own site
<a href="https://agentmods.dev/skills/evolvinglmms-lab/llava-onevision-2/megatron-checkpoint-layout"><img src="https://agentmods.dev/badge/skills/evolvinglmms-lab/llava-onevision-2/megatron-checkpoint-layout/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 megatron-checkpoint-layout

Your own site · 80×15
<a href="https://agentmods.dev/skills/evolvinglmms-lab/llava-onevision-2/megatron-checkpoint-layout"><img src="https://agentmods.dev/badge/skills/evolvinglmms-lab/llava-onevision-2/megatron-checkpoint-layout.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,367 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.00033 $0.01367
Opus 5 $0.00016 $0.00683
Sonnet 5 $0.00007 $0.00273
Haiku 4.5 $0.00003 $0.00137

Measured 9d ago against content hash b212be2d57c6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

megatron-checkpoint-layout 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 9d 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/megatron-checkpoint-layout/SKILL.md · 138 lines

How it starts

The opening of the file, as written. The whole thing — 138 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Purpose / 用途

Use this skill when diagnosing, designing, or converting Megatron/Megatron-Core checkpoints that may use TP, PP, and EP.

在排查、设计或转换使用 TP、PP、EP 的 Megatron / Megatron-Core checkpoint 时,使用这个 skill。

Core rule / 核心规则

  • TP only: mp_rank_{tp}

  • TP + PP: mp_rank_{tp}_{pp}

  • TP + PP + EP: mp_rank_{tp}_{pp}_{ep}

  • 只有 TP:mp_rank_{tp}

  • TP + PP:mp_rank_{tp}_{pp}

  • TP + PP + EP:mp_rank_{tp}_{pp}_{ep}

The key discriminator is whether expert parallelism participates in checkpoint sharding.

真正的分界点是:expert parallelism 是否参与了 checkpoint 切分。

  • If EP is present, treat the checkpoint layout as 3D.

  • If EP is absent, treat the checkpoint layout as non-EP and use 1D or 2D.

  • 如果存在 EP,就按 3D 布局处理。

  • 如果不存在 EP,就按非 EP 布局处理,即 1D 或 2D。

Mental model / 心智模型

Megatron does not treat pp > 1 as meaning 3D by itself.

Megatron 不会因为 pp > 1 就自动把 checkpoint 视为 3D。

  • PP adds a pipeline index.

  • EP adds an expert index.

  • The third coordinate exists because EP exists, not because PP exists.

  • PP 只是在目录里增加 pipeline 这一维。

  • EP 才会增加 expert 这一维。

  • 第三维存在的原因是 EP 存在,而不是因为 PP 存在。

So even if tp=1 and pp=1, once EP is enabled the checkpoint naming is still conceptually 3D because ranks are addressed by (tp, pp, ep).

所以即使 tp=1pp=1,只要启用了 EP,checkpoint 在语义上仍然是 3D,因为 rank 仍然由 (tp, pp, ep) 共同定位。

Practical interpretation / 实际使用解释

When reading or converting checkpoints:

在读取或转换 checkpoint 时:

  1. First decide whether EP exists in the checkpoint contract.

  2. If EP exists, require mp_rank_{tp}_{pp}_{ep}.

  3. If EP does not exist, read as mp_rank_{tp} or mp_rank_{tp}_{pp}.

  4. Do not infer 3D solely from pipeline_model_parallel_size > 1.

  5. 先判断这个 checkpoint 契约里是否存在 EP。

  6. 如果存在 EP,就要求目录是 mp_rank_{tp}_{pp}_{ep}

  7. 如果不存在 EP,就按 mp_rank_{tp}mp_rank_{tp}_{pp} 去读。

  8. 不要仅凭 pipeline_model_parallel_size > 1 就推断它一定是 3D。

Typical failure pattern / 典型错误模式

Bad assumption:

错误假设:

  • pp > 1 so loader chooses a 3D reader.

  • 只要 pp > 1,loader 就应该走 3D reader。

Read the full file on GitHub · 138 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. 9d ago First seen · 138 lines · 33 tokens per session scan A b212be2d57c6

Subscribe to this mod's changes

megatron-checkpoint-layout is a skill published in the GitHub repository EvolvingLMMs-Lab/LLaVA-OneVision-2 (1,199 stars, last pushed yesterday), licensed Apache-2.0. It adds 33 tokens to every session and 1,367 once invoked, about $0.0002 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.

Related

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…

Blaizzy/mlx-vlm · 83 tokens

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.

Blaizzy/mlx-vlm · 67 tokens

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…

Blaizzy/mlx-vlm · 99 tokens

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.

Blaizzy/mlx-vlm · 80 tokens

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.

Blaizzy/mlx-vlm · 60 tokens

weights-and-biases

W&B: log ML experiments, sweeps, model registry, dashboards.

NousResearch/hermes-agent · 21 tokens