mflux-model-tiny-test

Writes hermetic tiny model-saving tests for mflux models at toy dimensions.

2.4k|187|Updated Aug 10, 2024
One-click install
npx skills add https://github.com/mflux-community/mflux --skill mflux-model-tiny-test-mflux-community
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mflux-model-tiny-test
Source: https://github.com/mflux-community/mflux/tree/main/.cursor/skills/mflux-model-tiny-test
Command: npx skills add https://github.com/mflux-community/mflux --skill mflux-model-tiny-test-mflux-community

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Slow save/load checkpoint tests in mflux download real model weights and generate images, making them expensive to run. This Skill guides writing a fast twin test that exercises the real ModelSaver/WeightLoader/WeightApplier code path on real component classes built at toy dimensions, completing in about a second with no downloads. ## Core Features & Use Cases - Checkpoint roundtrip coverage: Proves a model's quantized checkpoint survives a save/load roundtrip byte-for-byte using the shared TinyCheckpointRoundtrip harness. - Dimension constraint guidance: Derives shrink knobs from each component's real constructor while respecting interlocking constraints like rope_axes_dim summing to head_dim and quantization_group_size multiples. - Known pitfall handling: Covers component dict keying by name, dual seeds, skip_quantization gaps, and tensors_per_shard tuning for multi-shard coverage. - Use Case: After porting a new model to mflux, ask for a tiny test to get cheap, fast checkpoint coverage that mirrors the slow save/load test without touching src/. ## Quick Start Ask the AI to make a tiny test for a specific mflux model, such as "make tiny test for qwen", and it will produce the test file under tests/model_saving/.

Frequently Asked Questions about mflux-model-tiny-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a fast save/load test for an mflux model?▼

Create one file at tests/model_saving/test_tiny_model_saving_<model>.py that calls TinyCheckpointRoundtrip with a _tiny_components() static method returning real component classes built at toy dimensions. Mirror the ernie_image or ideogram4 reference implementations exactly.

What dimensions should tiny mflux test components use?▼

Shrink layer counts to 2, hidden and intermediate sizes to 128, head counts to 2, and vocab to 128. Every dimension must be a multiple of the model's quantization_group_size, which defaults to 64 but can differ, such as 32 for boogu.

Why does the tiny test fail with KeyError on a component name?▼

The component dict must be keyed by component.name, not model_attr, because TinyCheckpointRoundtrip does a bare components[component.name] lookup. Every component returned by the weight definition's get_components() needs an entry.

Can the tiny test shrink the real VAE component?▼

No, real VAEs are fixed-size architectures with no dimension knobs, so use TinyVAEStandIn instead. ModelSaver and WeightLoader treat components as opaque parameter trees, so the stand-in walks the identical code path.

Why does the shard count assertion fail in the tiny checkpoint test?▼

The helper asserts len(shard_files) > component_count to exercise multi-shard paths. If tiny components have too few tensors, lower tensors_per_shard below 8 until it passes rather than dropping the argument.

Does the tiny test require changes to mflux source code?▼

No, a tiny test is a test-only addition and must not modify src/. If a model appears to require a source change to be testable, stop and report it instead of making the change.