| { |
| "$schema": "https://json-schema.org/draft/2020-12/schema", |
| "$id": "https://example.invalid/mcu-ir/model.schema.json", |
| "title": "MCU IR model execution configuration", |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["schema_version", "model", "artifacts", "stages"], |
| "properties": { |
| "schema_version": {"const": "1.0"}, |
| "model": { |
| "type": "object", |
| "additionalProperties": false, |
| "required": [ |
| "model_id", "model_name", "task", "architecture_family", |
| "source_framework", "source_repository", "license", |
| "public_quantized_available", "paired_fp32_available", |
| "pair_compatibility", "dataset", "input_shape", "eligibility", |
| "priority" |
| ], |
| "properties": { |
| "model_id": {"type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]*$"}, |
| "model_name": {"type": "string", "minLength": 1}, |
| "task": {"type": "string", "minLength": 1}, |
| "architecture_family": {"type": "string", "minLength": 1}, |
| "source_framework": {"type": "string", "minLength": 1}, |
| "source_repository": {"type": "string", "minLength": 1}, |
| "license": {"type": "string", "minLength": 1}, |
| "public_quantized_available": {"type": "boolean"}, |
| "paired_fp32_available": {"type": "boolean"}, |
| "pair_compatibility": {"enum": ["VERIFIED", "PARTIAL", "MISMATCH", "UNKNOWN"]}, |
| "dataset": {"type": "string", "minLength": 1}, |
| "metric": {"type": "string"}, |
| "input_shape": { |
| "type": "array", |
| "items": {"anyOf": [{"type": "integer", "minimum": 1}, {"const": "DYNAMIC"}]} |
| }, |
| "output_shape": { |
| "type": "array", |
| "items": {"anyOf": [{"type": "integer", "minimum": 1}, {"const": "DYNAMIC"}]} |
| }, |
| "preprocessing": {"type": "string"}, |
| "label_space": {"type": "string"}, |
| "eligibility": { |
| "enum": ["ELIGIBLE", "DISCOVERY_ONLY", "BLOCKED_SOURCE", "BLOCKED_BASELINE_PAIR"] |
| }, |
| "priority": {"enum": ["P0", "P1", "P2", "P3"]}, |
| "random_seed": {"type": "integer", "minimum": 0} |
| } |
| }, |
| "artifacts": { |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["fp32", "public_quantized"], |
| "properties": { |
| "fp32": {"$ref": "#/$defs/artifact"}, |
| "public_quantized": {"$ref": "#/$defs/artifact"} |
| } |
| }, |
| "stages": { |
| "type": "array", |
| "minItems": 1, |
| "items": {"$ref": "#/$defs/stage"} |
| } |
| }, |
| "$defs": { |
| "artifact": { |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["artifact_id", "source_url", "local_path", "format", "sha256", "license"], |
| "properties": { |
| "artifact_id": {"type": "string", "minLength": 1}, |
| "source_url": {"type": "string", "minLength": 1}, |
| "local_path": {"type": "string", "minLength": 1}, |
| "format": {"type": "string", "minLength": 1}, |
| "version": {"type": "string"}, |
| "sha256": {"type": "string", "pattern": "^([0-9a-f]{64}|UNVERIFIED)$"}, |
| "license": {"type": "string", "minLength": 1} |
| } |
| }, |
| "stage": { |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["id", "stage", "variant", "command", "inputs", "outputs", "timeout_sec", "failure_code_on_error"], |
| "properties": { |
| "id": {"type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]*$"}, |
| "stage": {"type": "string", "minLength": 1}, |
| "variant": {"enum": ["fp32", "public_quantized", "pair", "common"]}, |
| "artifact_id": {"type": "string"}, |
| "command": {"type": "array", "minItems": 1, "items": {"type": "string"}}, |
| "working_directory": {"type": "string", "default": "{repo_root}"}, |
| "inputs": {"type": "array", "items": {"type": "string"}}, |
| "outputs": {"type": "array", "items": {"type": "string"}}, |
| "requires": {"type": "array", "items": {"type": "string"}}, |
| "timeout_sec": {"type": "integer", "minimum": 1}, |
| "failure_code_on_error": { |
| "enum": [ |
| "FAIL_SOURCE", "FAIL_ENVIRONMENT", "FAIL_BASELINE", |
| "FAIL_PUBLIC_QUANTIZED_ARTIFACT", "FAIL_PUBLIC_QUANTIZED_LOAD", |
| "FAIL_BASELINE_PAIR_MISMATCH", "FAIL_EXPORT", "FAIL_UNSUPPORTED_OP", |
| "FAIL_DYNAMIC_SHAPE", "FAIL_CONTROL_FLOW", |
| "FAIL_QUANTIZATION_PRESERVATION", "FAIL_NUMERICAL_MISMATCH", |
| "FAIL_RUNTIME", "FAIL_MLIR_IMPORT", "FAIL_MLIR_QUANT_LEGALIZATION", |
| "FAIL_MLIR_LOWERING", "FAIL_CODEGEN", "FAIL_ANALYSIS", "OVER_8MIB" |
| ] |
| }, |
| "validation_report": {"type": "string"}, |
| "options": {"type": "object"}, |
| "patch": {"type": ["string", "null"]} |
| } |
| } |
| } |
| } |
|
|
|
|