Veomni develop

From ByteDance-Seed/VeOmni · View interactive version

Veomni develop is an AI agent skill from the GitHub repository ByteDance-Seed/VeOmni. VeOmni-specific checklist for feature development and refactoring. Covers impact analysis across modalities, trainer hierarchy, data pipeline, and distributed code. Use before implementing any non-trivial change. For model-specific or ops-specific work, use veomni-new-model or veomni-new-op instead.

How to use this skill

Skill file

Impact Analysis

Before implementing, check which areas your change affects:

| Area | What to check | Why it matters |

|------|--------------|----------------|

| veomni/trainer/ | All trainer subclasses (TextTrainer, VLMTrainer, DitTrainer, RL trainers) | Changing BaseTrainer method signatures breaks all subclasses |

| veomni/data/data_collator.py | All modalities (text, VLM, DiT) | Collators are tightly coupled to model-specific preprocessing |

| veomni/distributed/ | FSDP2 + ExtraParallel/MoE/SP paths | Shared distributed code is used by many downstream modalities |

| veomni/models/auto.py, registry.py | Model registry, import-time side effects | MODELING_REGISTRY is populated at import time; moving registrations breaks loading |

| configs/ | YAML config keys | Renaming config keys breaks existing training configs silently |

| veomni/models/transformers/*/ | __init__.py registration + modeling_*.py | Model packages own standalone HF-derived modeling_<m>.py modules shared across all accelerators (VeomniOp + explicit IS_NPU_AVAILABLE where needed) |

Refactoring Safety Rules

When restructuring code (same behavior, better structure):

  1. Baseline first: run pytest tests/ before any change, record results.
  2. One change per commit: ONE structural change → update ALL callers → verify tests match baseline → commit.
  3. Never batch multiple refactoring steps into one commit.
  4. Check baseline again at the end — results must be identical.

Common Traps

Documentation

Before committing, check if the change requires documentation updates:

Documenting an extension point

A contract that other code has to implement gets its own page in the same PR,

not a bullet in a usage doc. Mirror the source layout (SeedOmni mixins go to

docs/seed_omni/mixins/<name>.md) and add the page to a toctree in

docs/index.md: the docs build runs with -W, so a page outside every toctree

fails CI.

For each function in the contract, the page states:

  1. Who owns it: the module must implement it, must call it, may override

it, or the framework provides it and it must not be overridden.

  1. What it does: inputs, return value, units, and edge cases (for example

what it must return for empty input).

  1. Where the framework calls it: the exact call site, not only the file

that defines it.

  1. The end effect: the metrics, outputs or behavior a user observes, and

what happens for a module that does not opt in.

Also include a minimal opt-in example that matches the real module layout, the

call flow of one step or request as a nested list, the rules a correct

implementation must follow, and the tests that cover the contract.

Link every symbol and call site with a path relative to the doc plus a line

anchor, e.g.

[metric_meter_add](../../../veomni/models/seed_omni/mixins/metric_meter_mixin.py#L120),

so the reader can jump to the code from the IDE and from GitHub. Prefer this

over https://github.com/.../blob/main/... URLs, which do not resolve until the

PR merges and do not open in the IDE. Keep call flows out of code fences: links

inside a fence are not clickable. Line anchors drift when code above them

changes, so re-check them after every code change in the PR (see

/veomni-fix-docs). Build with make -C docs html SPHINXOPTS=-W before

committing. Reference page: docs/seed_omni/mixins/metric_meter.md.

Tests

Follow .agents/knowledge/testing.md. In short: extend an existing

CI-enumerated test before creating a new file. If you do create one, check its

path against the table there and wire it into the workflow that owns that path

— the directory-level entries (tests/data/, tests/checkpoints/, tests/ops/ on GPU,

tests/parallel/context_parallel/ on GPU) need no line, e2e paths belong to

{gpu,npu}_e2e_test.yml, and everything else is invisible to CI until it is

listed. A pure refactor with existing coverage does not need a new test — say

so in the PR instead of adding one.

When to Use Other Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.