Objectives
Migrate the source dataset logic into the MindSpeed-MM FSDP2 data plugin structure, preserve preprocessing semantics, and ensure trainer/model input compatibility.
Applicable Scenarios
- The migration task requires creating a data plugin under
mindspeed_mm/fsdp/data/. - The source preprocessing function needs to be reused or minimally adapted.
- Need to implement
dataset_typeregistration,__getitem__andcollate_fn。
Non-Applicable Scenarios
- The task is model loading or model registration.
- The task only performs configuration mapping and does not involve data behavior changes.
- The task is the final verification gate execution.
Inputs
- Source dataset entry file
- Target
dataset_type - Expected model input fields
- Data and path format assumptions
runtime_assets.dataset_path
Outputs
- Data plugin implementation
- Data migration checklist with pass/fail status
- Adaptation rationale for "non-direct-copy changes"
Mandatory Checks
- Registration contract:
@data_register.register("<dataset_type>")
- Data contract:
__getitem__returns the fields required by the model forward passcollate_fncan safely handle variable-length batches
- Reuse contract:
- When compatible, the source preprocessing function should be reused first
- Robustness contract:
- Safely handle path type variants (
str、list[str]) - Raise clear errors for invalid schema assumptions
- Safely handle path type variants (
Bias-Prevention Execution Protocol
- Must be completed before implementation:
- Validate that
runtime_assets.dataset_pathexists and is readable - Sample and read the first N samples to confirm the schema fields exist
- Validate that
- Must be produced after implementation:
dataset_schema_report.mdfields_contract_report.md
- Stop on failure:
__getitem__If fields are incomplete or collate crashes, entering the configuration/verification phase is prohibited
Prohibited Actions
- It is prohibited to assume the path type is only
str - It is prohibited to silently swallow schema errors
- It is prohibited to delete modality-critical fields (
pixel_values、image_flagsetc.) without declaring it - It is prohibited to replace "real path sampling verification" with "sample data passing"
Implementation Rules
- First copy the core preprocessing logic from the source repository.
- The adaptation scope is limited to imports, registration, field mapping, and contract alignment.
- Modality-critical fields must not be silently discarded.
- Clearly record the reason each function cannot be directly reused.
Exit Criteria
- The dataset can be constructed via
build_mm_dataset. - The data fields and collate output meet model expectations.
- All conclusions in the data-side checklist are supported by evidence.
Progressive Resources
checks/data-acceptance.mdchecks/data-contract-gates.mderrors/data-error-dictionary.mderrors/triage-severity.mdexamples/minimal-io.md
Read these files only when detailed criteria are needed for acceptance or data error triage.