Datasets:
Fix Dataset Viewer train split configuration
Browse filesExplicitly map the default train split to data/train/**, use metadata.jsonl plus images/, prevent scientific validation JSON from being inferred as a split, and remove redundant embedded-image Parquet Viewer shards.
- .gitignore +4 -0
- README.md +5 -5
- checksums/SHA256SUMS +5 -6
- scripts/prepare_release.py +35 -41
- scripts/upload_to_huggingface.py +21 -5
- scripts/validate_release.py +115 -38
.gitignore
CHANGED
|
@@ -20,3 +20,7 @@ viewer_data/
|
|
| 20 |
Krea-2-Turbo-Viewer-Fix-UPLOAD.zip
|
| 21 |
viewer_fix_*.log
|
| 22 |
viewer_server_diagnostics.json
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
Krea-2-Turbo-Viewer-Fix-UPLOAD.zip
|
| 21 |
viewer_fix_*.log
|
| 22 |
viewer_server_diagnostics.json
|
| 23 |
+
|
| 24 |
+
# Local Dataset Viewer repair artifacts
|
| 25 |
+
imagefolder_viewer_*.log
|
| 26 |
+
imagefolder_viewer_diagnostics.json
|
README.md
CHANGED
|
@@ -8,7 +8,9 @@ size_categories:
|
|
| 8 |
configs:
|
| 9 |
- config_name: default
|
| 10 |
default: true
|
| 11 |
-
|
|
|
|
|
|
|
| 12 |
drop_labels: true
|
| 13 |
task_categories:
|
| 14 |
- text-to-image
|
|
@@ -29,7 +31,7 @@ tags:
|
|
| 29 |
- q8-0
|
| 30 |
- q4-k-m
|
| 31 |
---
|
| 32 |
-
<!-- Dataset Viewer
|
| 33 |
# Krea 2 Turbo ComfyUI Format Fidelity Benchmark
|
| 34 |
|
| 35 |
This release is a paired, deterministic comparison of eight Krea 2 Turbo checkpoint formats in ComfyUI: BF16, FP8 Scaled, INT8 ConvRot, MXFP8, NVFP4, INT4 ConvRot W4A4, GGUF Q8_0, and GGUF Q4_K_M. It contains 240 scored 1024×1024 images, saved float32 decoded tensors and final latents, every denoising trajectory, raw metric tables, telemetry, statistical comparisons, and reproduction code.
|
|
@@ -56,10 +58,8 @@ The test GPU was an NVIDIA GeForce RTX 4060 Ti 16 GB (SM 8.9). MXFP8 and NVFP4 n
|
|
| 56 |
The original five formats and the three additions were measured in separate sessions. Five unscored BF16 and INT8 ConvRot bridge repeats quantify drift. INT8 crossed the preregistered 5% drift threshold, so exact old-versus-new timing comparisons remain caveated; fidelity comparisons remain paired to the same saved BF16 prompt/seed outputs.
|
| 57 |
|
| 58 |
## Dataset organization
|
| 59 |
-
* `data/train/metadata.jsonl` and `data/train/images/` are the Dataset Viewer and loading source, using Hugging Face ImageFolder. Each metadata row links an image to its prompt, seed, format, checkpoint provenance, raw scientific artifacts, and flattened metric values.
|
| 60 |
|
| 61 |
-
- `
|
| 62 |
-
- `data/train/metadata.jsonl` and `data/train/images/` are the equivalent ImageFolder tree kept for direct file access. Each metadata row links an image to its prompt, seed, format, checkpoint provenance, raw scientific artifacts, and flattened metric values.
|
| 63 |
- `raw/` contains `decoded_float32.npy`, `final_latent_float32.npy`, `trajectory.npz`, and capture `metadata.json` for every scored run.
|
| 64 |
- `metrics/` contains raw per-image, per-parameter, paired-statistics, summary, trajectory, latency, and performance tables.
|
| 65 |
- `comparison_sheets/` contains eight-format sheets, BF16-relative difference maps, and automatically selected detail crops.
|
|
|
|
| 8 |
configs:
|
| 9 |
- config_name: default
|
| 10 |
default: true
|
| 11 |
+
data_files:
|
| 12 |
+
- split: train
|
| 13 |
+
path: "data/train/**"
|
| 14 |
drop_labels: true
|
| 15 |
task_categories:
|
| 16 |
- text-to-image
|
|
|
|
| 31 |
- q8-0
|
| 32 |
- q4-k-m
|
| 33 |
---
|
| 34 |
+
<!-- Dataset Viewer source: the explicit train split reads data/train/metadata.jsonl and data/train/images/ with Hugging Face ImageFolder. -->
|
| 35 |
# Krea 2 Turbo ComfyUI Format Fidelity Benchmark
|
| 36 |
|
| 37 |
This release is a paired, deterministic comparison of eight Krea 2 Turbo checkpoint formats in ComfyUI: BF16, FP8 Scaled, INT8 ConvRot, MXFP8, NVFP4, INT4 ConvRot W4A4, GGUF Q8_0, and GGUF Q4_K_M. It contains 240 scored 1024×1024 images, saved float32 decoded tensors and final latents, every denoising trajectory, raw metric tables, telemetry, statistical comparisons, and reproduction code.
|
|
|
|
| 58 |
The original five formats and the three additions were measured in separate sessions. Five unscored BF16 and INT8 ConvRot bridge repeats quantify drift. INT8 crossed the preregistered 5% drift threshold, so exact old-versus-new timing comparisons remain caveated; fidelity comparisons remain paired to the same saved BF16 prompt/seed outputs.
|
| 59 |
|
| 60 |
## Dataset organization
|
|
|
|
| 61 |
|
| 62 |
+
- `data/train/metadata.jsonl` and `data/train/images/` are the Dataset Viewer and loading source, using Hugging Face ImageFolder. The dataset card explicitly limits the `train` split to this tree so scientific JSON files elsewhere in the repository are not inferred as dataset splits. Each metadata row links an image to its prompt, seed, format, checkpoint provenance, raw scientific artifacts, and flattened metric values.
|
|
|
|
| 63 |
- `raw/` contains `decoded_float32.npy`, `final_latent_float32.npy`, `trajectory.npz`, and capture `metadata.json` for every scored run.
|
| 64 |
- `metrics/` contains raw per-image, per-parameter, paired-statistics, summary, trajectory, latency, and performance tables.
|
| 65 |
- `comparison_sheets/` contains eight-format sheets, BF16-relative difference maps, and automatically selected detail crops.
|
checksums/SHA256SUMS
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
26dd9f691c984a8676e4ff0dccf50239d35c174e863d6884c3d43818b0ab577c .gitattributes
|
| 2 |
-
|
| 3 |
afbd7232877f7fb929d8e7a2b3b396a41179a3106ee6c1c99f90aa470062f969 CITATION.cff
|
| 4 |
fe888a3acbf08a05c3e976f76aa635f2a7034d09589955117c890f3f3a05c0a6 LICENSE-CODE
|
| 5 |
10232ffb753de2527c89b1f4a69bb1479e846892c3b3e26a8550866d0f0fe440 LICENSE-DATA
|
| 6 |
-
|
| 7 |
7860f02cff561fc62a93cabc452ea76a20452063e8207f97fecedb1a74fbadb2 TECHNICAL_REPORT.md
|
| 8 |
f020293711e8ad7eab2758442e5479b39648cd6c725fd076403f66a029c60b5c comparison_sheets/complete.json
|
| 9 |
d71bfb4a773b3998636d68998ad885b52907b285a703cb2348976f4b613ba4de comparison_sheets/contact_sheet_replicate0.png
|
|
@@ -98,7 +98,6 @@ a1495f17df7382e30c740db4d07574f34e5e31cb20020ac7fc9f71a4fea002bb comparison_she
|
|
| 98 |
b2705f64ed3fca264b0e7d6c6d3a01fa2f977477fd0a19ca94537552b5bba036 comparison_sheets/full/p15_scientific_poster__r0.png
|
| 99 |
d3d58661e35a3b4b6b0c4fe11f6f09f2c66dab482c89f4264a872806e3ead10a comparison_sheets/full/p15_scientific_poster__r1.png
|
| 100 |
a4335e2c6da478e4eab3e2ccaa933553d0b4810179064893b57ed52001a1677a comparison_sheets/index.json
|
| 101 |
-
08b9c4cb964aed1251a1835eda6943397cdf94dac89e14161086761a743b94d6 data/train-00000-of-00001.parquet
|
| 102 |
fd760338f2c01688676cd31a47421de131674706ae9d18b364bc5d5346ce6de2 data/train/images/bf16/p01_portrait__r0__bf16.png
|
| 103 |
5f332fe49f9202be8ebc0d43f122fcf1725a384fcfa9d14a5caee0471f005e08 data/train/images/bf16/p01_portrait__r1__bf16.png
|
| 104 |
55fb84113e54887184c8f216ac376cb6af3f311f2a44b4dbb8a24861576d5014 data/train/images/bf16/p02_hands_group__r0__bf16.png
|
|
@@ -1360,9 +1359,9 @@ e77eff0f644162b32fdbb19e0787b1381a007b41897a4bacb9b47c18791b6a4d reproduction/b
|
|
| 1360 |
150a133f4ff5508ca9828fd436fd3db854fbc7218c8fcd9217395eabdb51e3b3 reproduction/download_models.py
|
| 1361 |
ac43fe8c1625b5754ab3d829591758a50607320f4f694c32784e5ce026c2bc59 reproduction/requirements-release.txt
|
| 1362 |
56ecc0611beb0a2ed147b3eed17da521b2c21c0394776082ced988ec8ae63dc7 scripts/build_parquet.py
|
| 1363 |
-
|
| 1364 |
-
|
| 1365 |
-
|
| 1366 |
99eb77d4339d532e6fc11cfd50cd55b4f8db54f58f1ddcd93cf74361a9252012 tables/decision_table.csv
|
| 1367 |
74f759089450fe7f074d67a389988251422d78260bdd728d040cf7fde7a365fb tables/format_ranking.csv
|
| 1368 |
1434a8b74c4e55dc0dcbe7b0aac9fae34c4fc8fc088051724aaf3b139fc7392c tables/metadata_schema.json
|
|
|
|
| 1 |
26dd9f691c984a8676e4ff0dccf50239d35c174e863d6884c3d43818b0ab577c .gitattributes
|
| 2 |
+
52d93f44a3403e5e85615ce04b8371d60ff079867ac700f3f134107acc1244e1 .gitignore
|
| 3 |
afbd7232877f7fb929d8e7a2b3b396a41179a3106ee6c1c99f90aa470062f969 CITATION.cff
|
| 4 |
fe888a3acbf08a05c3e976f76aa635f2a7034d09589955117c890f3f3a05c0a6 LICENSE-CODE
|
| 5 |
10232ffb753de2527c89b1f4a69bb1479e846892c3b3e26a8550866d0f0fe440 LICENSE-DATA
|
| 6 |
+
6497d1fda5a3d0b4dc0be66fe50b3253c2c35f0977f3eac87ab42301651688e9 README.md
|
| 7 |
7860f02cff561fc62a93cabc452ea76a20452063e8207f97fecedb1a74fbadb2 TECHNICAL_REPORT.md
|
| 8 |
f020293711e8ad7eab2758442e5479b39648cd6c725fd076403f66a029c60b5c comparison_sheets/complete.json
|
| 9 |
d71bfb4a773b3998636d68998ad885b52907b285a703cb2348976f4b613ba4de comparison_sheets/contact_sheet_replicate0.png
|
|
|
|
| 98 |
b2705f64ed3fca264b0e7d6c6d3a01fa2f977477fd0a19ca94537552b5bba036 comparison_sheets/full/p15_scientific_poster__r0.png
|
| 99 |
d3d58661e35a3b4b6b0c4fe11f6f09f2c66dab482c89f4264a872806e3ead10a comparison_sheets/full/p15_scientific_poster__r1.png
|
| 100 |
a4335e2c6da478e4eab3e2ccaa933553d0b4810179064893b57ed52001a1677a comparison_sheets/index.json
|
|
|
|
| 101 |
fd760338f2c01688676cd31a47421de131674706ae9d18b364bc5d5346ce6de2 data/train/images/bf16/p01_portrait__r0__bf16.png
|
| 102 |
5f332fe49f9202be8ebc0d43f122fcf1725a384fcfa9d14a5caee0471f005e08 data/train/images/bf16/p01_portrait__r1__bf16.png
|
| 103 |
55fb84113e54887184c8f216ac376cb6af3f311f2a44b4dbb8a24861576d5014 data/train/images/bf16/p02_hands_group__r0__bf16.png
|
|
|
|
| 1359 |
150a133f4ff5508ca9828fd436fd3db854fbc7218c8fcd9217395eabdb51e3b3 reproduction/download_models.py
|
| 1360 |
ac43fe8c1625b5754ab3d829591758a50607320f4f694c32784e5ce026c2bc59 reproduction/requirements-release.txt
|
| 1361 |
56ecc0611beb0a2ed147b3eed17da521b2c21c0394776082ced988ec8ae63dc7 scripts/build_parquet.py
|
| 1362 |
+
d2e33bcf2ff59345414a00be97737776f0d46058abefb6a72e242ed2f89c1d94 scripts/prepare_release.py
|
| 1363 |
+
4e6a346c63f2d8ad0d00a7589177fbcb4b895c9c9df8cdef10d3dc26cd97a270 scripts/upload_to_huggingface.py
|
| 1364 |
+
0e75a48c4bbea75d36ce0ecce98b0db7a6552a9f77be14810c385745faca4792 scripts/validate_release.py
|
| 1365 |
99eb77d4339d532e6fc11cfd50cd55b4f8db54f58f1ddcd93cf74361a9252012 tables/decision_table.csv
|
| 1366 |
74f759089450fe7f074d67a389988251422d78260bdd728d040cf7fde7a365fb tables/format_ranking.csv
|
| 1367 |
1434a8b74c4e55dc0dcbe7b0aac9fae34c4fc8fc088051724aaf3b139fc7392c tables/metadata_schema.json
|
scripts/prepare_release.py
CHANGED
|
@@ -364,12 +364,13 @@ license: cc-by-4.0
|
|
| 364 |
pretty_name: Krea 2 Turbo ComfyUI Format Fidelity Benchmark
|
| 365 |
size_categories:
|
| 366 |
- n<1K
|
| 367 |
-
configs:
|
| 368 |
-
- config_name: default
|
| 369 |
-
default: true
|
| 370 |
-
data_files:
|
| 371 |
-
- split: train
|
| 372 |
-
path: data/train
|
|
|
|
| 373 |
task_categories:
|
| 374 |
- text-to-image
|
| 375 |
tags:
|
|
@@ -388,7 +389,8 @@ tags:
|
|
| 388 |
- gguf
|
| 389 |
- q8-0
|
| 390 |
- q4-k-m
|
| 391 |
-
---
|
|
|
|
| 392 |
|
| 393 |
# Krea 2 Turbo ComfyUI Format Fidelity Benchmark
|
| 394 |
|
|
@@ -415,10 +417,9 @@ The test GPU was an NVIDIA GeForce RTX 4060 Ti 16 GB (SM 8.9). MXFP8 and NVFP4 n
|
|
| 415 |
|
| 416 |
The original five formats and the three additions were measured in separate sessions. Five unscored BF16 and INT8 ConvRot bridge repeats quantify drift. INT8 crossed the preregistered 5% drift threshold, so exact old-versus-new timing comparisons remain caveated; fidelity comparisons remain paired to the same saved BF16 prompt/seed outputs.
|
| 417 |
|
| 418 |
-
## Dataset organization
|
| 419 |
-
|
| 420 |
-
- `data/train
|
| 421 |
-
- `data/train/metadata.jsonl` and `data/train/images/` are the equivalent ImageFolder tree kept for direct file access. Each metadata row links an image to its prompt, seed, format, checkpoint provenance, raw scientific artifacts, and flattened metric values.
|
| 422 |
- `raw/` contains `decoded_float32.npy`, `final_latent_float32.npy`, `trajectory.npz`, and capture `metadata.json` for every scored run.
|
| 423 |
- `metrics/` contains raw per-image, per-parameter, paired-statistics, summary, trajectory, latency, and performance tables.
|
| 424 |
- `comparison_sheets/` contains eight-format sheets, BF16-relative difference maps, and automatically selected detail crops.
|
|
@@ -649,8 +650,10 @@ if __name__ == "__main__":
|
|
| 649 |
def build_upload_script() -> str:
|
| 650 |
return '''from __future__ import annotations
|
| 651 |
|
| 652 |
-
import argparse
|
| 653 |
-
|
|
|
|
|
|
|
| 654 |
|
| 655 |
from huggingface_hub import HfApi
|
| 656 |
|
|
@@ -665,8 +668,14 @@ def main() -> int:
|
|
| 665 |
root = args.root.resolve()
|
| 666 |
required = [root / "README.md", root / "data" / "train" / "metadata.jsonl", root / "checksums" / "SHA256SUMS"]
|
| 667 |
missing = [str(path) for path in required if not path.is_file()]
|
| 668 |
-
if missing:
|
| 669 |
-
raise RuntimeError("Release is incomplete: " + ", ".join(missing))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 670 |
files = [path for path in root.rglob("*") if path.is_file()]
|
| 671 |
total = sum(path.stat().st_size for path in files)
|
| 672 |
print(f"ready: {len(files)} files, {total / 1024**3:.3f} GiB -> datasets/{args.repo_id}")
|
|
@@ -679,7 +688,15 @@ def main() -> int:
|
|
| 679 |
repo_type="dataset",
|
| 680 |
folder_path=str(root),
|
| 681 |
private=args.private,
|
| 682 |
-
ignore_patterns=[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 683 |
num_workers=4,
|
| 684 |
print_report_every=30,
|
| 685 |
)
|
|
@@ -692,29 +709,7 @@ if __name__ == "__main__":
|
|
| 692 |
'''
|
| 693 |
|
| 694 |
|
| 695 |
-
def
|
| 696 |
-
import pyarrow.parquet as pq
|
| 697 |
-
from datasets import load_dataset
|
| 698 |
-
from datasets.table import embed_table_storage
|
| 699 |
-
|
| 700 |
-
out = destination / "data" / "train-00000-of-00001.parquet"
|
| 701 |
-
dataset = load_dataset(str(destination), split="train")
|
| 702 |
-
ordered = ["image"] + [name for name in dataset.column_names if name != "image"]
|
| 703 |
-
dataset = dataset.select_columns(ordered)
|
| 704 |
-
table = embed_table_storage(dataset.with_format("arrow")[:])
|
| 705 |
-
writer = pq.ParquetWriter(str(out), table.schema)
|
| 706 |
-
try:
|
| 707 |
-
for batch in table.to_batches(max_chunksize=row_group_size):
|
| 708 |
-
writer.write_batch(batch, row_group_size=row_group_size)
|
| 709 |
-
finally:
|
| 710 |
-
writer.close()
|
| 711 |
-
first = pq.read_table(str(out)).column("image")[0].as_py()
|
| 712 |
-
if not (isinstance(first, dict) and first.get("bytes")):
|
| 713 |
-
raise RuntimeError("Parquet build did not embed image bytes")
|
| 714 |
-
return out
|
| 715 |
-
|
| 716 |
-
|
| 717 |
-
def build_release(benchmark_root: Path, destination: Path, config_path: Path) -> None:
|
| 718 |
benchmark_root = benchmark_root.resolve()
|
| 719 |
config_path = config_path if config_path.is_absolute() else benchmark_root / config_path
|
| 720 |
config = load_configuration(config_path)
|
|
@@ -797,8 +792,7 @@ def build_release(benchmark_root: Path, destination: Path, config_path: Path) ->
|
|
| 797 |
if key not in IDENTIFIER_COLUMNS:
|
| 798 |
row[f"{group}_{key}"] = coerce(value)
|
| 799 |
metadata_rows.append(row)
|
| 800 |
-
jsonl_dump(destination / "data" / "train" / "metadata.jsonl", metadata_rows)
|
| 801 |
-
build_image_parquet(destination)
|
| 802 |
|
| 803 |
copy_tree(results / "metrics", destination / "metrics")
|
| 804 |
copy_tree(results / "comparison_sheets", destination / "comparison_sheets")
|
|
|
|
| 364 |
pretty_name: Krea 2 Turbo ComfyUI Format Fidelity Benchmark
|
| 365 |
size_categories:
|
| 366 |
- n<1K
|
| 367 |
+
configs:
|
| 368 |
+
- config_name: default
|
| 369 |
+
default: true
|
| 370 |
+
data_files:
|
| 371 |
+
- split: train
|
| 372 |
+
path: "data/train/**"
|
| 373 |
+
drop_labels: true
|
| 374 |
task_categories:
|
| 375 |
- text-to-image
|
| 376 |
tags:
|
|
|
|
| 389 |
- gguf
|
| 390 |
- q8-0
|
| 391 |
- q4-k-m
|
| 392 |
+
---
|
| 393 |
+
<!-- Dataset Viewer source: the explicit train split reads data/train/metadata.jsonl and data/train/images/ with Hugging Face ImageFolder. -->
|
| 394 |
|
| 395 |
# Krea 2 Turbo ComfyUI Format Fidelity Benchmark
|
| 396 |
|
|
|
|
| 417 |
|
| 418 |
The original five formats and the three additions were measured in separate sessions. Five unscored BF16 and INT8 ConvRot bridge repeats quantify drift. INT8 crossed the preregistered 5% drift threshold, so exact old-versus-new timing comparisons remain caveated; fidelity comparisons remain paired to the same saved BF16 prompt/seed outputs.
|
| 419 |
|
| 420 |
+
## Dataset organization
|
| 421 |
+
|
| 422 |
+
- `data/train/metadata.jsonl` and `data/train/images/` are the Dataset Viewer and loading source, using Hugging Face ImageFolder. The dataset card explicitly limits the `train` split to this tree so scientific JSON files elsewhere in the repository are not inferred as dataset splits. Each metadata row links an image to its prompt, seed, format, checkpoint provenance, raw scientific artifacts, and flattened metric values.
|
|
|
|
| 423 |
- `raw/` contains `decoded_float32.npy`, `final_latent_float32.npy`, `trajectory.npz`, and capture `metadata.json` for every scored run.
|
| 424 |
- `metrics/` contains raw per-image, per-parameter, paired-statistics, summary, trajectory, latency, and performance tables.
|
| 425 |
- `comparison_sheets/` contains eight-format sheets, BF16-relative difference maps, and automatically selected detail crops.
|
|
|
|
| 650 |
def build_upload_script() -> str:
|
| 651 |
return '''from __future__ import annotations
|
| 652 |
|
| 653 |
+
import argparse
|
| 654 |
+
import subprocess
|
| 655 |
+
import sys
|
| 656 |
+
from pathlib import Path
|
| 657 |
|
| 658 |
from huggingface_hub import HfApi
|
| 659 |
|
|
|
|
| 668 |
root = args.root.resolve()
|
| 669 |
required = [root / "README.md", root / "data" / "train" / "metadata.jsonl", root / "checksums" / "SHA256SUMS"]
|
| 670 |
missing = [str(path) for path in required if not path.is_file()]
|
| 671 |
+
if missing:
|
| 672 |
+
raise RuntimeError("Release is incomplete: " + ", ".join(missing))
|
| 673 |
+
if (root / "viewer_data").exists() or (root / "data" / "train-00000-of-00001.parquet").exists():
|
| 674 |
+
raise RuntimeError("Obsolete Dataset Viewer Parquet artifacts are present")
|
| 675 |
+
subprocess.run(
|
| 676 |
+
[sys.executable, str(root / "scripts" / "validate_release.py"), "--root", str(root)],
|
| 677 |
+
check=True,
|
| 678 |
+
)
|
| 679 |
files = [path for path in root.rglob("*") if path.is_file()]
|
| 680 |
total = sum(path.stat().st_size for path in files)
|
| 681 |
print(f"ready: {len(files)} files, {total / 1024**3:.3f} GiB -> datasets/{args.repo_id}")
|
|
|
|
| 688 |
repo_type="dataset",
|
| 689 |
folder_path=str(root),
|
| 690 |
private=args.private,
|
| 691 |
+
ignore_patterns=[
|
| 692 |
+
".cache/**",
|
| 693 |
+
".viewer_fix_venv/**",
|
| 694 |
+
"viewer_data/**",
|
| 695 |
+
"viewer_fix_output/**",
|
| 696 |
+
"**/__pycache__/**",
|
| 697 |
+
"*.pyc",
|
| 698 |
+
"viewer_fix_*.log",
|
| 699 |
+
],
|
| 700 |
num_workers=4,
|
| 701 |
print_report_every=30,
|
| 702 |
)
|
|
|
|
| 709 |
'''
|
| 710 |
|
| 711 |
|
| 712 |
+
def build_release(benchmark_root: Path, destination: Path, config_path: Path) -> None:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 713 |
benchmark_root = benchmark_root.resolve()
|
| 714 |
config_path = config_path if config_path.is_absolute() else benchmark_root / config_path
|
| 715 |
config = load_configuration(config_path)
|
|
|
|
| 792 |
if key not in IDENTIFIER_COLUMNS:
|
| 793 |
row[f"{group}_{key}"] = coerce(value)
|
| 794 |
metadata_rows.append(row)
|
| 795 |
+
jsonl_dump(destination / "data" / "train" / "metadata.jsonl", metadata_rows)
|
|
|
|
| 796 |
|
| 797 |
copy_tree(results / "metrics", destination / "metrics")
|
| 798 |
copy_tree(results / "comparison_sheets", destination / "comparison_sheets")
|
scripts/upload_to_huggingface.py
CHANGED
|
@@ -1,7 +1,9 @@
|
|
| 1 |
from __future__ import annotations
|
| 2 |
|
| 3 |
-
import argparse
|
| 4 |
-
|
|
|
|
|
|
|
| 5 |
|
| 6 |
from huggingface_hub import HfApi
|
| 7 |
|
|
@@ -16,8 +18,14 @@ def main() -> int:
|
|
| 16 |
root = args.root.resolve()
|
| 17 |
required = [root / "README.md", root / "data" / "train" / "metadata.jsonl", root / "checksums" / "SHA256SUMS"]
|
| 18 |
missing = [str(path) for path in required if not path.is_file()]
|
| 19 |
-
if missing:
|
| 20 |
-
raise RuntimeError("Release is incomplete: " + ", ".join(missing))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
files = [path for path in root.rglob("*") if path.is_file()]
|
| 22 |
total = sum(path.stat().st_size for path in files)
|
| 23 |
print(f"ready: {len(files)} files, {total / 1024**3:.3f} GiB -> datasets/{args.repo_id}")
|
|
@@ -30,7 +38,15 @@ def main() -> int:
|
|
| 30 |
repo_type="dataset",
|
| 31 |
folder_path=str(root),
|
| 32 |
private=args.private,
|
| 33 |
-
ignore_patterns=[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
num_workers=4,
|
| 35 |
print_report_every=30,
|
| 36 |
)
|
|
|
|
| 1 |
from __future__ import annotations
|
| 2 |
|
| 3 |
+
import argparse
|
| 4 |
+
import subprocess
|
| 5 |
+
import sys
|
| 6 |
+
from pathlib import Path
|
| 7 |
|
| 8 |
from huggingface_hub import HfApi
|
| 9 |
|
|
|
|
| 18 |
root = args.root.resolve()
|
| 19 |
required = [root / "README.md", root / "data" / "train" / "metadata.jsonl", root / "checksums" / "SHA256SUMS"]
|
| 20 |
missing = [str(path) for path in required if not path.is_file()]
|
| 21 |
+
if missing:
|
| 22 |
+
raise RuntimeError("Release is incomplete: " + ", ".join(missing))
|
| 23 |
+
if (root / "viewer_data").exists() or (root / "data" / "train-00000-of-00001.parquet").exists():
|
| 24 |
+
raise RuntimeError("Obsolete Dataset Viewer Parquet artifacts are present")
|
| 25 |
+
subprocess.run(
|
| 26 |
+
[sys.executable, str(root / "scripts" / "validate_release.py"), "--root", str(root)],
|
| 27 |
+
check=True,
|
| 28 |
+
)
|
| 29 |
files = [path for path in root.rglob("*") if path.is_file()]
|
| 30 |
total = sum(path.stat().st_size for path in files)
|
| 31 |
print(f"ready: {len(files)} files, {total / 1024**3:.3f} GiB -> datasets/{args.repo_id}")
|
|
|
|
| 38 |
repo_type="dataset",
|
| 39 |
folder_path=str(root),
|
| 40 |
private=args.private,
|
| 41 |
+
ignore_patterns=[
|
| 42 |
+
".cache/**",
|
| 43 |
+
".viewer_fix_venv/**",
|
| 44 |
+
"viewer_data/**",
|
| 45 |
+
"viewer_fix_output/**",
|
| 46 |
+
"**/__pycache__/**",
|
| 47 |
+
"*.pyc",
|
| 48 |
+
"viewer_fix_*.log",
|
| 49 |
+
],
|
| 50 |
num_workers=4,
|
| 51 |
print_report_every=30,
|
| 52 |
)
|
scripts/validate_release.py
CHANGED
|
@@ -8,10 +8,19 @@ import math
|
|
| 8 |
import re
|
| 9 |
from collections import Counter
|
| 10 |
from pathlib import Path
|
| 11 |
-
from urllib.parse import unquote
|
|
|
|
|
|
|
| 12 |
|
| 13 |
|
| 14 |
-
FORMATS = ("bf16", "fp8_scaled", "int8_convrot", "mxfp8", "nvfp4", "int4_convrot", "gguf_q8_0", "gguf_q4_k_m")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
|
| 17 |
def strict_json_loads(payload: str) -> object:
|
|
@@ -36,9 +45,59 @@ def checksum(path: Path) -> str:
|
|
| 36 |
return value.hexdigest()
|
| 37 |
|
| 38 |
|
| 39 |
-
def fail(condition: bool, message: str, errors: list[str]) -> None:
|
| 40 |
-
if condition:
|
| 41 |
-
errors.append(message)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
|
| 44 |
def main() -> int:
|
|
@@ -46,8 +105,9 @@ def main() -> int:
|
|
| 46 |
parser.add_argument("--root", type=Path, default=Path(__file__).resolve().parents[1])
|
| 47 |
parser.add_argument("--full", action="store_true", help="Decode all images, inspect all arrays, verify all SHA-256 values, and load ImageFolder")
|
| 48 |
args = parser.parse_args()
|
| 49 |
-
root = args.root.resolve()
|
| 50 |
-
errors: list[str] = []
|
|
|
|
| 51 |
metadata_path = root / "data" / "train" / "metadata.jsonl"
|
| 52 |
rows = []
|
| 53 |
for line_number, line in enumerate(metadata_path.read_text(encoding="utf-8").splitlines(), start=1):
|
|
@@ -77,8 +137,9 @@ def main() -> int:
|
|
| 77 |
required_paths.append(path)
|
| 78 |
fail(not path.is_file(), f"missing {key}: {path}", errors)
|
| 79 |
fail(len(list((root / "data" / "train" / "images").rglob("*.png"))) != expected_rows, f"expected {expected_rows} PNG images", errors)
|
| 80 |
-
parquet_path = root / "data" / "train-00000-of-00001.parquet"
|
| 81 |
-
fail(
|
|
|
|
| 82 |
fail(len(list((root / "raw").rglob("*.npy"))) != expected_rows * 2, f"expected {expected_rows * 2} NPY files", errors)
|
| 83 |
fail(len(list((root / "raw").rglob("*.npz"))) != expected_rows, f"expected {expected_rows} NPZ files", errors)
|
| 84 |
fail(len(list((root / "comparison_sheets").rglob("*.*"))) != 93, "expected 93 comparison artifacts", errors)
|
|
@@ -97,21 +158,27 @@ def main() -> int:
|
|
| 97 |
fail(len(metric_rows) != expected, f"{filename}: expected {expected} rows, found {len(metric_rows)}", errors)
|
| 98 |
if filename in {"image_core.csv", "image_advanced.csv", "latency_components.csv", "performance_runs.csv"}:
|
| 99 |
fail(len({row["run_id"] for row in metric_rows}) != expected_rows, f"{filename}: run_id values are not unique", errors)
|
| 100 |
-
forbidden_names = {".vendor", "advanced_metric_cache", "logs", "comfy_output", "__pycache__", ".cache", "cache"}
|
| 101 |
-
for path in root.rglob("*"):
|
| 102 |
-
|
|
|
|
|
|
|
| 103 |
if path.is_file():
|
| 104 |
fail(path.suffix.lower() in {".safetensors", ".ckpt", ".gguf", ".pyc"}, f"forbidden file: {path}", errors)
|
| 105 |
text_suffixes = {".md", ".json", ".jsonl", ".csv", ".yaml", ".yml", ".txt", ".cff", ".py", ".ps1", ".sh"}
|
| 106 |
-
path_pattern = re.compile(r"E:\\\\Benchmark Krea 2 Turbo Formats|C:\\\\Users\\\\|GPU-[0-9a-fA-F-]{8,}|[0-9A-Fa-f]{8}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}\\.[0-7]|mihai", re.IGNORECASE)
|
| 107 |
-
for path in root.rglob("*"):
|
| 108 |
-
if
|
|
|
|
|
|
|
| 109 |
if path.relative_to(root).as_posix() in {"scripts/prepare_release.py", "scripts/validate_release.py"}:
|
| 110 |
continue
|
| 111 |
text = path.read_text(encoding="utf-8", errors="replace")
|
| 112 |
fail(bool(path_pattern.search(text)), f"private machine identifier in {path.relative_to(root)}", errors)
|
| 113 |
-
link_pattern = re.compile(r"\[[^\]]*\]\(([^)]+)\)")
|
| 114 |
-
for markdown in root.rglob("*.md"):
|
|
|
|
|
|
|
| 115 |
for target in link_pattern.findall(markdown.read_text(encoding="utf-8")):
|
| 116 |
target = target.strip().strip("<>")
|
| 117 |
if target.startswith(("http://", "https://", "mailto:", "#")):
|
|
@@ -151,28 +218,38 @@ def main() -> int:
|
|
| 151 |
fail(not path.is_file(), f"checksum target missing: {relative}", errors)
|
| 152 |
if path.is_file():
|
| 153 |
fail(checksum(path) != expected, f"checksum mismatch: {relative}", errors)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 154 |
try:
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
parquet_file = pq.ParquetFile(str(parquet_path))
|
| 158 |
-
fail(parquet_file.metadata.num_rows != expected_rows, f"parquet rows: {parquet_file.metadata.num_rows}", errors)
|
| 159 |
-
first_image = parquet_file.read_row_group(0, columns=["image"]).column("image")[0].as_py()
|
| 160 |
-
fail(not (isinstance(first_image, dict) and first_image.get("bytes")), "parquet image column is not embedded", errors)
|
| 161 |
-
except Exception as exc:
|
| 162 |
-
errors.append(f"parquet inspection failed: {exc}")
|
| 163 |
-
try:
|
| 164 |
-
from datasets import load_dataset
|
| 165 |
-
|
| 166 |
-
dataset = load_dataset(str(root), split="train")
|
| 167 |
-
fail(dataset.num_rows != expected_rows, f"dataset rows: {dataset.num_rows}", errors)
|
| 168 |
-
fail("image" not in dataset.features, "dataset is missing the image feature", errors)
|
| 169 |
-
_ = dataset[0]["image"]
|
| 170 |
-
except Exception as exc:
|
| 171 |
-
errors.append(f"dataset load failed: {exc}")
|
| 172 |
-
try:
|
| 173 |
-
import yaml
|
| 174 |
-
|
| 175 |
-
citation = yaml.safe_load((root / "CITATION.cff").read_text(encoding="utf-8"))
|
| 176 |
fail(citation.get("cff-version") != "1.2.0" or citation.get("type") != "dataset", "CITATION.cff metadata is invalid", errors)
|
| 177 |
except Exception as exc:
|
| 178 |
errors.append(f"CITATION.cff parse failed: {exc}")
|
|
|
|
| 8 |
import re
|
| 9 |
from collections import Counter
|
| 10 |
from pathlib import Path
|
| 11 |
+
from urllib.parse import unquote
|
| 12 |
+
|
| 13 |
+
import yaml
|
| 14 |
|
| 15 |
|
| 16 |
+
FORMATS = ("bf16", "fp8_scaled", "int8_convrot", "mxfp8", "nvfp4", "int4_convrot", "gguf_q8_0", "gguf_q4_k_m")
|
| 17 |
+
IMAGEFOLDER_GLOB = "data/train/**"
|
| 18 |
+
LOCAL_REPAIR_DIRS = {".viewer_fix_venv", "viewer_fix_output", "__pycache__"}
|
| 19 |
+
LOCAL_REPAIR_FILES = {
|
| 20 |
+
"imagefolder_viewer_diagnostics.json",
|
| 21 |
+
"imagefolder_viewer_fix.log",
|
| 22 |
+
"viewer_server_diagnostics.json",
|
| 23 |
+
}
|
| 24 |
|
| 25 |
|
| 26 |
def strict_json_loads(payload: str) -> object:
|
|
|
|
| 45 |
return value.hexdigest()
|
| 46 |
|
| 47 |
|
| 48 |
+
def fail(condition: bool, message: str, errors: list[str]) -> None:
|
| 49 |
+
if condition:
|
| 50 |
+
errors.append(message)
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
def validate_dataset_card(root: Path, errors: list[str]) -> None:
|
| 54 |
+
readme = (root / "README.md").read_text(encoding="utf-8")
|
| 55 |
+
match = re.match(r"\A---\s*\n(.*?)\n---\s*\n", readme, re.DOTALL)
|
| 56 |
+
if not match:
|
| 57 |
+
errors.append("README.md has no valid YAML front matter")
|
| 58 |
+
return
|
| 59 |
+
|
| 60 |
+
try:
|
| 61 |
+
metadata = yaml.safe_load(match.group(1)) or {}
|
| 62 |
+
except yaml.YAMLError as exc:
|
| 63 |
+
errors.append(f"README.md YAML is invalid: {exc}")
|
| 64 |
+
return
|
| 65 |
+
|
| 66 |
+
configs = metadata.get("configs")
|
| 67 |
+
if not isinstance(configs, list):
|
| 68 |
+
errors.append("README.md must define a configs list")
|
| 69 |
+
return
|
| 70 |
+
|
| 71 |
+
defaults = [
|
| 72 |
+
config
|
| 73 |
+
for config in configs
|
| 74 |
+
if isinstance(config, dict) and config.get("config_name") == "default"
|
| 75 |
+
]
|
| 76 |
+
if len(defaults) != 1:
|
| 77 |
+
errors.append("README.md must define exactly one default config")
|
| 78 |
+
return
|
| 79 |
+
|
| 80 |
+
config = defaults[0]
|
| 81 |
+
fail(config.get("default") is not True, "default config is not marked default", errors)
|
| 82 |
+
fail(config.get("drop_labels") is not True, "default config must set drop_labels: true", errors)
|
| 83 |
+
fail("data_dir" in config, "default config must not use data_dir", errors)
|
| 84 |
+
|
| 85 |
+
data_files = config.get("data_files")
|
| 86 |
+
expected = [{"split": "train", "path": IMAGEFOLDER_GLOB}]
|
| 87 |
+
fail(
|
| 88 |
+
data_files != expected,
|
| 89 |
+
f"default config data_files must equal {expected!r}, found {data_files!r}",
|
| 90 |
+
errors,
|
| 91 |
+
)
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
def is_local_repair_artifact(root: Path, path: Path) -> bool:
|
| 95 |
+
relative = path.relative_to(root)
|
| 96 |
+
return (
|
| 97 |
+
any(part in LOCAL_REPAIR_DIRS for part in relative.parts)
|
| 98 |
+
or path.name in LOCAL_REPAIR_FILES
|
| 99 |
+
or (path.name.startswith("viewer_fix_") and path.suffix == ".log")
|
| 100 |
+
)
|
| 101 |
|
| 102 |
|
| 103 |
def main() -> int:
|
|
|
|
| 105 |
parser.add_argument("--root", type=Path, default=Path(__file__).resolve().parents[1])
|
| 106 |
parser.add_argument("--full", action="store_true", help="Decode all images, inspect all arrays, verify all SHA-256 values, and load ImageFolder")
|
| 107 |
args = parser.parse_args()
|
| 108 |
+
root = args.root.resolve()
|
| 109 |
+
errors: list[str] = []
|
| 110 |
+
validate_dataset_card(root, errors)
|
| 111 |
metadata_path = root / "data" / "train" / "metadata.jsonl"
|
| 112 |
rows = []
|
| 113 |
for line_number, line in enumerate(metadata_path.read_text(encoding="utf-8").splitlines(), start=1):
|
|
|
|
| 137 |
required_paths.append(path)
|
| 138 |
fail(not path.is_file(), f"missing {key}: {path}", errors)
|
| 139 |
fail(len(list((root / "data" / "train" / "images").rglob("*.png"))) != expected_rows, f"expected {expected_rows} PNG images", errors)
|
| 140 |
+
parquet_path = root / "data" / "train-00000-of-00001.parquet"
|
| 141 |
+
fail(parquet_path.exists(), f"obsolete Viewer parquet is present: {parquet_path}", errors)
|
| 142 |
+
fail((root / "viewer_data").exists(), "obsolete viewer_data directory is present", errors)
|
| 143 |
fail(len(list((root / "raw").rglob("*.npy"))) != expected_rows * 2, f"expected {expected_rows * 2} NPY files", errors)
|
| 144 |
fail(len(list((root / "raw").rglob("*.npz"))) != expected_rows, f"expected {expected_rows} NPZ files", errors)
|
| 145 |
fail(len(list((root / "comparison_sheets").rglob("*.*"))) != 93, "expected 93 comparison artifacts", errors)
|
|
|
|
| 158 |
fail(len(metric_rows) != expected, f"{filename}: expected {expected} rows, found {len(metric_rows)}", errors)
|
| 159 |
if filename in {"image_core.csv", "image_advanced.csv", "latency_components.csv", "performance_runs.csv"}:
|
| 160 |
fail(len({row["run_id"] for row in metric_rows}) != expected_rows, f"{filename}: run_id values are not unique", errors)
|
| 161 |
+
forbidden_names = {".vendor", "advanced_metric_cache", "logs", "comfy_output", "__pycache__", ".cache", "cache"}
|
| 162 |
+
for path in root.rglob("*"):
|
| 163 |
+
if is_local_repair_artifact(root, path):
|
| 164 |
+
continue
|
| 165 |
+
fail(any(part in forbidden_names for part in path.parts), f"forbidden path: {path}", errors)
|
| 166 |
if path.is_file():
|
| 167 |
fail(path.suffix.lower() in {".safetensors", ".ckpt", ".gguf", ".pyc"}, f"forbidden file: {path}", errors)
|
| 168 |
text_suffixes = {".md", ".json", ".jsonl", ".csv", ".yaml", ".yml", ".txt", ".cff", ".py", ".ps1", ".sh"}
|
| 169 |
+
path_pattern = re.compile(r"E:\\\\Benchmark Krea 2 Turbo Formats|C:\\\\Users\\\\|GPU-[0-9a-fA-F-]{8,}|[0-9A-Fa-f]{8}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}\\.[0-7]|mihai", re.IGNORECASE)
|
| 170 |
+
for path in root.rglob("*"):
|
| 171 |
+
if is_local_repair_artifact(root, path):
|
| 172 |
+
continue
|
| 173 |
+
if path.is_file() and (path.suffix.lower() in text_suffixes or path.name in {"README.md", ".gitignore", ".gitattributes"}):
|
| 174 |
if path.relative_to(root).as_posix() in {"scripts/prepare_release.py", "scripts/validate_release.py"}:
|
| 175 |
continue
|
| 176 |
text = path.read_text(encoding="utf-8", errors="replace")
|
| 177 |
fail(bool(path_pattern.search(text)), f"private machine identifier in {path.relative_to(root)}", errors)
|
| 178 |
+
link_pattern = re.compile(r"\[[^\]]*\]\(([^)]+)\)")
|
| 179 |
+
for markdown in root.rglob("*.md"):
|
| 180 |
+
if is_local_repair_artifact(root, markdown):
|
| 181 |
+
continue
|
| 182 |
for target in link_pattern.findall(markdown.read_text(encoding="utf-8")):
|
| 183 |
target = target.strip().strip("<>")
|
| 184 |
if target.startswith(("http://", "https://", "mailto:", "#")):
|
|
|
|
| 218 |
fail(not path.is_file(), f"checksum target missing: {relative}", errors)
|
| 219 |
if path.is_file():
|
| 220 |
fail(checksum(path) != expected, f"checksum mismatch: {relative}", errors)
|
| 221 |
+
try:
|
| 222 |
+
from datasets import load_dataset
|
| 223 |
+
|
| 224 |
+
configured_splits = load_dataset(
|
| 225 |
+
"imagefolder",
|
| 226 |
+
data_files={"train": str(root / IMAGEFOLDER_GLOB)},
|
| 227 |
+
drop_labels=True,
|
| 228 |
+
)
|
| 229 |
+
fail(
|
| 230 |
+
list(configured_splits) != ["train"],
|
| 231 |
+
f"configured ImageFolder splits must be ['train'], found {list(configured_splits)!r}",
|
| 232 |
+
errors,
|
| 233 |
+
)
|
| 234 |
+
configured_dataset = configured_splits["train"]
|
| 235 |
+
fail(
|
| 236 |
+
configured_dataset.num_rows != expected_rows,
|
| 237 |
+
f"configured ImageFolder rows: {configured_dataset.num_rows}",
|
| 238 |
+
errors,
|
| 239 |
+
)
|
| 240 |
+
fail(
|
| 241 |
+
"image" not in configured_dataset.features,
|
| 242 |
+
"configured ImageFolder is missing the image feature",
|
| 243 |
+
errors,
|
| 244 |
+
)
|
| 245 |
+
|
| 246 |
+
first_image = configured_dataset[0]["image"]
|
| 247 |
+
fail(first_image.size != (1024, 1024), f"first dataset image has size {first_image.size}", errors)
|
| 248 |
+
fail(first_image.mode != "RGB", f"first dataset image has mode {first_image.mode}", errors)
|
| 249 |
+
except Exception as exc:
|
| 250 |
+
errors.append(f"dataset load failed: {exc}")
|
| 251 |
try:
|
| 252 |
+
citation = yaml.safe_load((root / "CITATION.cff").read_text(encoding="utf-8"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 253 |
fail(citation.get("cff-version") != "1.2.0" or citation.get("type") != "dataset", "CITATION.cff metadata is invalid", errors)
|
| 254 |
except Exception as exc:
|
| 255 |
errors.append(f"CITATION.cff parse failed: {exc}")
|