model-architecture-and-api
Routes MiniMind-V model architecture, VLM API, config, visual token flow, MoE, and generation-semantics questions without launching training or inference services.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- model-architecture-and-api
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Routes MiniMind-V model architecture, VLM API, config, visual token flow, MoE, and generation-semantics questions without launching training or inference services.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md3.0 KB
- 参考文档references/architecture-notes.md1.7 KB
- 参考文档references/troubleshooting.md1.8 KB
- 脚本scripts/inspect_minimind_vlm_api.py3.8 KB
03 SKILL.md 正文
Model Architecture and API
Use this sub-skill when the user asks about MiniMind-V source APIs or model design.
Route here
VLMConfig,MiniMindVLM,MMVisionProjector,MiniMindConfig,MiniMindForCausalLM,image2tensor,get_image_embeddings,count_vision_proj,forward, orgeneratesemantics.- MiniMind base config knobs: hidden size, layer count, attention heads, RoPE/YaRN, vocabulary size, dense/MoE switches.
- How image placeholders become visual embeddings and why 64
<|image_pad|>tokens are needed. - Multi-image
pixel_valuesshape questions andnum_return_sequencesimage-repeat behavior.
Route elsewhere
- Training schedules, checkpoint/resume, or freezing strategy:
training. - Download/resource layout:
data-and-resources. - CLI inference/WebUI:
inference-and-serving. - Export/conversion:
model-export-and-format-conversion.
Operating procedure
- Read API reference for signatures, config defaults, tensor shapes, and function caveats.
- Read architecture notes for visual-token flow, dense/MoE variants, and generation flow.
- Read troubleshooting for missing vision encoder, placeholder, shape, cache, and MoE mismatch failures.
- If live confirmation is needed, run
inspect_minimind_vlm_api.pywith--repo-rootpointing at a MiniMind-V checkout. The helper imports source modules and prints signatures/defaults; it does not load weights or download resources.
Key facts
VLMConfig(image_special_token='<|image_pad|>', image_ids=[12], **kwargs)inherits MiniMind config and defaults toimage_hidden_size=768,image_token_len=64.MiniMindVLM(config=None, vision_model_path='./model/siglip2-base-p32-256-ve')builds the language model, tries to attach SigLIP2, and always creates the projector.- The vision projector is
LayerNorm -> Linear -> GELU -> Linear, mapping SigLIP hidden features into MiniMind hidden size without token-count resampling. - SigLIP2 P32 with fixed 256x256 inputs yields 64 patch tokens; MiniMind-V represents one image as 64
<|image_pad|>tokens. - Dense and MoE variants share the VLM wrapper;
use_moechanges the MiniMind language backbone feed-forward blocks.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).