Commit ·
64efe73
1
Parent(s): 03e006d
docs: add contribution guide and organize legacy schemas (#14)
Browse files- docs: add current dataset contribution and schema guide (c0b6f7ddd3814988296dc57f57935e48c6e4e8cd)
- refactor: move legacy schema contracts into history (5a11fbbb30d6155d368ca716830a72948d147a9a)
- docs: include AgentX dependencies in dataset test command (bb1953a4fa0daec48a906c7fe076ee6189ac7c36)
Files changed (7)
- README.md+141-1
- schemas/catalog-index-v5.schema.json → schemas/history/catalog-index-v5.schema.jsonRenamed+1-1
- schemas/configuration-manifest-v3.schema.json → schemas/history/configuration-manifest-v3.schema.jsonRenamed+1-1
- schemas/measurement-manifest-v4.schema.json → schemas/history/measurement-manifest-v4.schema.jsonRenamed+1-1
- scripts/manage_dataset.py+3-3
- scripts/migrate_measurements.py+2-2
- scripts/test_measurement_storage.py+28-1
41 unmodified lines42434445464748201 unmodified lines25025125225325425541 unmodified linesmeasurements/catalog/ # global discovery indexesschemas/audit/scripts/manage_dataset.py```201 unmodified lines[reconciliation](audit/reconciliation-report.md), and[validation output](audit/validation-report.txt).## Validate or refreshValidation is source-independent:41 unmodified lines4243444546474849201 unmodified lines25125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439541 unmodified linesmeasurements/catalog/ # global discovery indexesschemas/ # current contractshistory/ # older manifest/catalog contracts used by migrationaudit/scripts/manage_dataset.py```201 unmodified lines[reconciliation](audit/reconciliation-report.md), and[validation output](audit/validation-report.txt).## Developer guide: contribute a datasetSubmit additions as a Hugging Face dataset pull request against current `main`.Include the data, sidecars, manifests, regenerated catalogs, and reproduciblevalidation evidence in the same PR. Use the contracts below as the checklist;copying an existing directory does not establish schema compliance.### Choose the artifact contract| Artifact | Required contract | Key requirements || --- | --- | --- || Configuration leaf `manifest.json` | [Configuration manifest v4](schemas/configuration-manifest-v4.schema.json) | Flat runtime identity, producer revision/status, collector attribution, FPM and measurement references, source provenance, and history. || FPM Parquet and adjacent `.metadata.json` | [FPM v6 logical schema](schemas/aisim-fpm-forward-v6.schema.json) | Exact query identity, workload coordinates, field types, positive finite `latency_ms`, row count, and matching digest/sidecar. || Reviewed DeepSeek V4.1 schema-7 FPM | [Schema-7 admission policy](scripts/dsv41.py) and [profile guide](docs/dsv41-pr304.md) | Preserve schema 7 and source-qualified execution identity, including `full` versus `decoder_bounded`; do not relabel as v6. || `measurements/manifest.json` | [Measurement manifest v5](schemas/measurement-manifest-v5.schema.json) | Protocol ID, file roles, repository-relative paths, published/source hashes, source revision, and grouping provenance where required. || Canonical measurement storage | [Arrow schemas](scripts/measurement_storage.py) and [storage v1 descriptor](schemas/measurement-storage-v1.json) | Parquet bulk records, explicit storage schema/version, logical row count, ordering index, and collection-run bindings. || Full scheduler/rank observations | [Forward-pass measurement v1](schemas/forward-pass-measurement-v1.schema.json) | Explicit iteration membership, all contributing rank observations, and declared timing/grouping policy. || Reduced measured points | [Forward-pass record v1](schemas/forward-pass-record-v1.schema.json) | Batch/token coordinates and finite positive `truth_latency_ms`, with source provenance. || Discovery indexes | [Catalog index v6](schemas/catalog-index-v6.schema.json) | Consistent configuration/history references, counts, and generated JSON/Parquet catalogs. |The JSON manifest schemas define required fields and allowed values. The FPMv6 file is a logical Arrow contract, not a JSON-record schema. Use the datasetvalidator for physical types, sidecars, and cross-file checks.Schema versions do not make campaign contracts interchangeable. DeepSeek V4.1uses its own admission code; Inkling uses the[Inkling schema-7 extension](schemas/aisim-fpm-forward-v7-inkling.schema.json) and[admission policy](scripts/inkling_six_run.py). GLM uses the[GLM admission policy](scripts/glm53flash.py). New schemas or protocols needcorresponding validation support and tests in the same PR. Current contributionsuse configuration v4, measurement v5, and catalog v6. Older manifest/catalogcontracts live in [`schemas/history/`](schemas/history/) for legacy validationand migration. New contributions must use the current contracts in `schemas/`.FPM variants and measurement protocols still in use remain in `schemas/`; theirversion numbers describe separate contracts, not a shared upgrade sequence.### Prepare the contribution1. Start from the latest dataset `main` with actual data files downloaded, notGit LFS pointer files. Pin the source repository/archive revision and recordsource SHA-256 digests before transforming data.2. Place each exact configuration under`data/<org>--<model>/<system>/<framework>/<framework-version>/<parallelism>/`.Preserve case-sensitive model IDs, model revision, topology, quantization,KV-cache dtype, and optional DCP. Keep distinct runtime identities separate.3. Put predictor libraries and sidecars under `fpm/`. Put usable truth directlyunder `measurements/`; put its supporting files under`measurements/provenance/`. Calibration inputs must retain their collectionmethod and must not be presented as independent measurement truth.4. Populate both manifests using the linked schemas. For measurement-onlycontributions, use `fpm: []`, omit `fpm/`, and include validated truth.Summary-only evidence uses a null protocol and an evidence format ID.Calibration-only bundles without measured truth retain `files: []` and`collection_runs: []`; do not invent measurement runs.5. Use an existing matching ingestion path, or add a focused importer andvalidation tests for a new source format. Existing examples include[AgentX ingestion](scripts/ingest_agentx.py) and[DSV4.1 ingestion](scripts/ingest_dsv41.py). These importers are source-specific;the base `import --replace` command is not a general contribution command.6. Regenerate catalogs through the ingestion code and`write_catalogs` in [manage_dataset.py](scripts/manage_dataset.py). Preserveunrelated configurations. When replacing a promoted snapshot, move its FPMand measurement artifacts together into history and update references.For rank measurements, follow [measurement protocols](docs/measurement-protocols.md):local counters and file order are not implicit cross-rank join keys. Declareproducer or derived grouping authority, expected ranks, and hashed groupingprovenance. Retain incomplete observations as evidence without labeling themcomplete-iteration truth.### Measurement storage and collection metadata- Publish bulk iterations, reduced records, iteration indexes, and requestmetrics through the shared storage writer: Zstd level 3, 16,384-row groups.Manifests/settings/provenance remain JSON. Preserve null versus zero,int64 nanoseconds, rank membership, completeness, and source ordering.- Each measurement file declares `format`, `storage_schema`,`logical_row_count`, `ordering_index`, hashes, and immutable source references.Indexes use `record_file_id` and one-based `record_id`, not physical row offsets.- Bind truth records to `collection_runs` using disjoint half-open logicalranges; a null range covers the whole file. Unattributed truth belongs to anexplicit unknown run. Record collection type, preset, collector, workload,replay mode, and serving layout from evidence; names do not establish them.- Preserve request-level timing boundaries and outcomes. Do not reconstructrequest metrics from percentiles or forward-pass iterations. See[measurement v5 and collection runs](#measurement-v5-migration-and-collection-runs)for naming, metadata, and storage details.### Validate and request reviewRun from the dataset root after downloading the referenced payloads:```bashuv run --with pyarrow==25.0.1 --with jsonschema --with ijson \python scripts/manage_dataset.py validateuv run --python 3.12 --with pyarrow==25.0.1 --with jsonschema --with ijson \--with pytest --with numba python -m pytest scriptsgit diff --check```Include these items in the PR description:- **Scope:** added/replaced configurations, file and row counts, schema/protocolversions, and whether this is new collection, transformation, or migration.- **Provenance:** immutable source revision, producer identity, collectioncommand/configuration, model revision, runtime/package versions, and licenses.- **Integrity:** validation/test commands and results, source/published hashes,and any intentional transformations. For unchanged migrations, comparepayloads byte-for-byte against the pinned source.- **Qualification:** calibration versus heldout/independent evidence, supportedworkloads, missing measurements, exclusions, and known collection failures.- **Consumers:** affected AISimulate references and the full dataset commit SHAand file hashes they will pin. Refresh pins after changing metadata.The shared validator dispatches each imported FPM artifact to its admissionpolicy and requires a unique matching validated snapshot. Hashes alone do notestablish model, hardware, parallelism, quantization, or execution identity.When adding an importer, test mismatched identities and remove/re-import catalogstability, not only successful ingestion.Reviewers check the exact submitted commit. Passing storage validation establishesintegrity; it does not establish new GPU accuracy or remove existing quarantineand qualification limits.### Lessons from dataset PR reviews- Keep `aisim_commit` for the producer code and `provenance.source_revision` forthe source archive. Preserve original producer identities; use null with`unknown` or `mixed` when no single producer SHA is established. See[PR #11](https://huggingface.co/datasets/nvidia/aisimulate-fpm-dataset/discussions/11).- Removing prediction/error metrics must preserve collection evidence: imagedigests, known checkpoint revisions, package versions, attempt-selectionpolicy, and runtime qualification. A source-sidecar hash alone does not retainthese fields. See[PR #12](https://huggingface.co/datasets/nvidia/aisimulate-fpm-dataset/discussions/12).- If another dataset PR merges first, update from `main`, regenerate combinedcatalogs, and rerun validation. Resolve catalog conflicts by retaining bothcontributions; verify uploaded files and consumer hashes at the reviewed SHA.## Validate or refreshValidation is source-independent:
123456{"$schema": "https://json-schema.org/draft/2020-12/schema","$id": "https://huggingface.co/datasets/nvidia/aisimulate-fpm-dataset/raw/main/schemas/catalog-index-v5.schema.json","title": "AISimulate FPM catalog index v5","type": "object","additionalProperties": false,123456{"$schema": "https://json-schema.org/draft/2020-12/schema","$id": "https://huggingface.co/datasets/nvidia/aisimulate-fpm-dataset/raw/main/schemas/history/catalog-index-v5.schema.json","title": "AISimulate FPM catalog index v5","type": "object","additionalProperties": false,
213 unmodified lines214215216217218219220213 unmodified lines"type": "object"}},"$id": "https://huggingface.co/datasets/nvidia/aisimulate-fpm-dataset/raw/main/schemas/configuration-manifest-v3.schema.json","$schema": "https://json-schema.org/draft/2020-12/schema","additionalProperties": false,"allOf": [213 unmodified lines214215216217218219220213 unmodified lines"type": "object"}},"$id": "https://huggingface.co/datasets/nvidia/aisimulate-fpm-dataset/raw/main/schemas/history/configuration-manifest-v3.schema.json","$schema": "https://json-schema.org/draft/2020-12/schema","additionalProperties": false,"allOf": [
123456{"$schema": "https://json-schema.org/draft/2020-12/schema","$id": "https://huggingface.co/datasets/nvidia/aisimulate-fpm-dataset/raw/main/schemas/measurement-manifest-v4.schema.json","title": "AISimulate FPM measurement manifest v4","type": "object","required": [123456{"$schema": "https://json-schema.org/draft/2020-12/schema","$id": "https://huggingface.co/datasets/nvidia/aisimulate-fpm-dataset/raw/main/schemas/history/measurement-manifest-v4.schema.json","title": "AISimulate FPM measurement manifest v4","type": "object","required": [
63 unmodified lines64656667686970717263 unmodified linesMEASUREMENT_CATALOG_VERSION = 4MEASUREMENT_TRUTH_ROLES = frozenset({"truth", "derived_truth"})DOCUMENT_SCHEMAS = {"catalog_index": "schemas/catalog-index-v5.schema.json","configuration_manifest": "schemas/configuration-manifest-v3.schema.json","measurement_manifest": "schemas/measurement-manifest-v4.schema.json",}MEASUREMENT_PROTOCOL_SCHEMAS = {"forward-pass-measurement-v1": "schemas/forward-pass-measurement-v1.schema.json",63 unmodified lines64656667686970717263 unmodified linesMEASUREMENT_CATALOG_VERSION = 4MEASUREMENT_TRUTH_ROLES = frozenset({"truth", "derived_truth"})DOCUMENT_SCHEMAS = {"catalog_index": "schemas/history/catalog-index-v5.schema.json","configuration_manifest": "schemas/history/configuration-manifest-v3.schema.json","measurement_manifest": "schemas/history/measurement-manifest-v4.schema.json",}MEASUREMENT_PROTOCOL_SCHEMAS = {"forward-pass-measurement-v1": "schemas/forward-pass-measurement-v1.schema.json",
166 unmodified lines167168169170171172173174166 unmodified lines),("catalog-index-v5", "catalog-index-v6", "catalog_version", 6),]:d = read(root / f"schemas/{old}.schema.json")d["$id"] = d["$id"].replace(old, new)d["title"] = d["title"].rsplit(" v", 1)[0] + f" v{version}"d["properties"][key] = {"const": version}if key == "manifest_version" and version == 5:166 unmodified lines167168169170171172173174166 unmodified lines),("catalog-index-v5", "catalog-index-v6", "catalog_version", 6),]:d = read(root / f"schemas/history/{old}.schema.json")d["$id"] = d["$id"].replace("/schemas/history/", "/schemas/").replace(old, new)d["title"] = d["title"].rsplit(" v", 1)[0] + f" v{version}"d["properties"][key] = {"const": version}if key == "manifest_version" and version == 5:
123451 unmodified line78910111213311 unmodified lines325326327"""Storage round trips retain scientific values and explicit logical identity."""from pathlib import Pathimport pyarrow as pa1 unmodified lineimport pytestfrom jsonschema import Draft202012Validator, ValidationErrorfrom collection_metadata import empty_run, run_schemafrom migrate_measurements import fallback_run, next_parquet_path, normalize_asset_pathsfrom measurement_storage import (decode_iteration,encode_iteration,311 unmodified linesfor i, f in enumerate(updated["files"]):assert (tmp_path / f["path"]).read_bytes() == f"capture {i}".encode()assert normalize_asset_paths(tmp_path, updated) == (updated, {})12345671 unmodified line910111213141516311 unmodified lines328329330331332333334335336337338339340341342343344345346347348349350351352353354"""Storage round trips retain scientific values and explicit logical identity."""import jsonimport shutilfrom pathlib import Pathimport pyarrow as pa1 unmodified lineimport pytestfrom jsonschema import Draft202012Validator, ValidationErrorfrom collection_metadata import empty_run, run_schemafrom manage_dataset import schema_violationsfrom migrate_measurements import fallback_run, next_parquet_path, normalize_asset_paths, schema_filesfrom measurement_storage import (decode_iteration,encode_iteration,311 unmodified linesfor i, f in enumerate(updated["files"]):assert (tmp_path / f["path"]).read_bytes() == f"capture {i}".encode()assert normalize_asset_paths(tmp_path, updated) == (updated, {})@pytest.mark.parametrize("kind, filename, version_key, legacy_version, current_version",[("catalog_index", "catalog-index", "catalog_version", 5, 6),("configuration_manifest", "configuration-manifest", "manifest_version", 3, 4),("measurement_manifest", "measurement-manifest", "manifest_version", 4, 5),],)def test_historical_schemas_support_validation_and_regeneration(tmp_path, kind, filename, version_key, legacy_version, current_version):root = Path(__file__).resolve().parents[1]shutil.copytree(root / "schemas", tmp_path / "schemas")current_path = tmp_path / "schemas" / f"{filename}-v{current_version}.schema.json"expected = json.loads(current_path.read_text())current_path.unlink()schema_files(tmp_path)assert json.loads(current_path.read_text()) == expectedfor version in (legacy_version, current_version):errors = schema_violations(tmp_path, kind, {version_key: version})assert errors # Missing required fields are rejected after loading the schema.assert not any(version_key in error for error in errors)
README.md+141-1
schemas/catalog-index-v5.schema.json → schemas/history/catalog-index-v5.schema.jsonRenamed+1-1
schemas/configuration-manifest-v3.schema.json → schemas/history/configuration-manifest-v3.schema.jsonRenamed+1-1
schemas/measurement-manifest-v4.schema.json → schemas/history/measurement-manifest-v4.schema.jsonRenamed+1-1
scripts/manage_dataset.py+3-3
scripts/migrate_measurements.py+2-2
scripts/test_measurement_storage.py+28-1