Skip to content

Commit a1b4127

Browse files
Merge upstream/main into report-signal-terminated-workers
Resolves the one conflict, in spark_performance.md. #1793 appended an H3 sequential-load bullet to the same Running safely list that this branch appends its earlyoom diagnostics bullet to. Both bullets are kept, H3 first. This branch's bullet drops its opening sentence about earlyoom preferring Python because the H3 bullet now states that.
2 parents 331c168 + a28f2ba commit a1b4127

148 files changed

Lines changed: 20855 additions & 757 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci-macos-mlx.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
- "fastvideo/mlx_runtime/**"
99
- "fastvideo/tests/mlx/**"
1010
- "fastvideo/tests/platforms/test_mps_vsa_error.py"
11+
- "fastvideo/tests/platforms/test_cpu_sdpa.py"
12+
- "fastvideo/platforms/cpu.py"
1113
- "fastvideo/platforms/mps.py"
1214
- "fastvideo/platforms/__init__.py"
1315
- "fastvideo/__init__.py"
@@ -79,6 +81,12 @@ jobs:
7981
fastvideo/tests/mlx/test_mlx_compile_parity.py \
8082
fastvideo/tests/mlx/test_mlx_checkpoint.py \
8183
fastvideo/tests/mlx/test_mlx_checkpoint_compat.py \
84+
fastvideo/tests/mlx/test_mlx_affine_dq_gemm.py \
85+
fastvideo/tests/mlx/test_mlx_minimax_h3_parity.py \
86+
fastvideo/tests/mlx/test_mlx_minimax_h3_vsa.py \
87+
fastvideo/tests/mlx/test_mlx_minimax_h3_vsa_regressions.py \
88+
fastvideo/tests/mlx/test_mlx_minimax_h3_fast_mode.py \
89+
fastvideo/tests/mlx/test_mlx_minimax_h3_fast_spatial.py \
8290
fastvideo/tests/mlx/test_mlx_fastwan_benchmark.py \
8391
fastvideo/tests/mlx/test_taehv_decode.py \
8492
fastvideo/tests/mlx/test_frame_upsample.py \
@@ -91,7 +99,8 @@ jobs:
9199
fastvideo/tests/mlx/test_mlx_rife_interpolation.py::test_rife_download_unavailable_has_specific_error \
92100
fastvideo/tests/mlx/test_mlx_rife_interpolation.py::test_rife_backend_regression_is_not_skip_eligible \
93101
fastvideo/tests/platforms/test_mps_vsa_error.py \
94-
-q
102+
fastvideo/tests/platforms/test_cpu_sdpa.py \
103+
-v -s -o faulthandler_timeout=120
95104
96105
# Same tests on MLX's CPU backend. Hosted macOS runners are scarce and
97106
# slower to schedule; this Linux job gives fast PR signal on the identical
@@ -136,6 +145,12 @@ jobs:
136145
fastvideo/tests/mlx/test_mlx_compile_parity.py \
137146
fastvideo/tests/mlx/test_mlx_checkpoint.py \
138147
fastvideo/tests/mlx/test_mlx_checkpoint_compat.py \
148+
fastvideo/tests/mlx/test_mlx_affine_dq_gemm.py \
149+
fastvideo/tests/mlx/test_mlx_minimax_h3_parity.py \
150+
fastvideo/tests/mlx/test_mlx_minimax_h3_vsa.py \
151+
fastvideo/tests/mlx/test_mlx_minimax_h3_vsa_regressions.py \
152+
fastvideo/tests/mlx/test_mlx_minimax_h3_fast_mode.py \
153+
fastvideo/tests/mlx/test_mlx_minimax_h3_fast_spatial.py \
139154
fastvideo/tests/mlx/test_mlx_fastwan_benchmark.py \
140155
fastvideo/tests/mlx/test_taehv_decode.py \
141156
fastvideo/tests/mlx/test_frame_upsample.py \
@@ -148,4 +163,5 @@ jobs:
148163
fastvideo/tests/mlx/test_mlx_rife_interpolation.py::test_rife_download_unavailable_has_specific_error \
149164
fastvideo/tests/mlx/test_mlx_rife_interpolation.py::test_rife_backend_regression_is_not_skip_eligible \
150165
fastvideo/tests/platforms/test_mps_vsa_error.py \
151-
-q
166+
fastvideo/tests/platforms/test_cpu_sdpa.py \
167+
-v -s -o faulthandler_timeout=120

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ fastvideo/tests/ssim/reference_videos/**
133133
!fastvideo/tests/ssim/reference_videos/**/*.mp4
134134
!fastvideo/tests/ssim/reference_videos/**/*.png
135135

136+
# Local H3 MLX kernel / exactness benches (JSON, logs, frames, videos)
137+
.kernel_bench/
138+
136139
# Editor logs and local Python version pins (accidentally committed)
137140
*.nvimlog
138141
.nvimlog

apps/fastvideo_studio/database.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import contextlib
1111
import logging
12+
import json
1213
import sqlite3
1314
import threading
1415
from pathlib import Path
@@ -46,8 +47,13 @@
4647

4748

4849
def _sqlite_row_get(row: sqlite3.Row, key: str, default: Any) -> Any:
49-
"""Like dict.get for sqlite3.Row (Row has no .get on Python 3.10)."""
50-
return row[key] if key in row else default # noqa: SIM401
50+
"""Like dict.get for sqlite3.Row (Row has no .get on Python 3.10).
51+
52+
NOTE: `key in row` tests Row *values*, not column names, so the membership
53+
check has to go through .keys() -- otherwise every lookup falls back to the
54+
default and jobs restored from the database lose their stored fields.
55+
"""
56+
return row[key] if key in row.keys() else default # noqa: SIM401, SIM118
5157

5258

5359
def _get_db_path(data_dir: Path) -> Path:
@@ -83,6 +89,9 @@ def _migrate_db(conn: sqlite3.Connection) -> None:
8389
_add_column_if_missing(conn, "jobs", "fps", "INTEGER", "24")
8490
_add_column_if_missing(conn, "jobs", "workload_type", "TEXT", "'t2v'")
8591
_add_column_if_missing(conn, "jobs", "image_path", "TEXT", "''")
92+
_add_column_if_missing(conn, "jobs", "name", "TEXT", "''")
93+
_add_column_if_missing(conn, "jobs", "last_image_path", "TEXT", "''")
94+
_add_column_if_missing(conn, "jobs", "references_json", "TEXT", "''")
8695
_add_column_if_missing(conn, "jobs", "job_type", "TEXT", "'inference'")
8796
_add_column_if_missing(conn, "jobs", "data_path", "TEXT", "''")
8897
_add_column_if_missing(conn, "jobs", "max_train_steps", "INTEGER", "1000")
@@ -242,7 +251,8 @@ def insert_job(self, job: dict[str, Any]) -> None:
242251
self._execute(
243252
"""
244253
INSERT INTO jobs (
245-
id, model_id, prompt, workload_type, image_path, job_type, status,
254+
id, model_id, name, prompt, workload_type, image_path,
255+
last_image_path, references_json, job_type, status,
246256
created_at, started_at, finished_at, error, output_path, log_file_path,
247257
num_inference_steps, num_frames, height, width, guidance_scale,
248258
guidance_rescale, fps, seed, num_gpus, dit_cpu_offload,
@@ -254,14 +264,17 @@ def insert_job(self, job: dict[str, Any]) -> None:
254264
dmd_use_vsa, dmd_vsa_sparsity, dmd_denoising_steps,
255265
real_score_guidance_scale,
256266
generator_update_interval, real_score_model_path, fake_score_model_path
257-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
267+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
258268
""",
259269
(
260270
job["id"],
261271
job["model_id"],
272+
job.get("name", ""),
262273
job["prompt"],
263274
job.get("workload_type", "t2v"),
264275
job.get("image_path", ""),
276+
job.get("last_image_path", ""),
277+
json.dumps(job.get("references") or []),
265278
job.get("job_type", "inference"),
266279
job["status"],
267280
job["created_at"],
@@ -540,9 +553,12 @@ def _row_to_job(row: sqlite3.Row) -> dict[str, Any]:
540553
result = {
541554
"id": row["id"],
542555
"model_id": row["model_id"],
556+
"name": _sqlite_row_get(row, "name", "") or "",
543557
"prompt": row["prompt"],
544558
"workload_type": _sqlite_row_get(row, "workload_type", "t2v"),
545559
"image_path": _sqlite_row_get(row, "image_path", "") or "",
560+
"last_image_path": _sqlite_row_get(row, "last_image_path", "") or "",
561+
"references": _sqlite_row_get(row, "references_json", "") or "",
546562
"job_type": _sqlite_row_get(row, "job_type", "inference"),
547563
"status": row["status"],
548564
"created_at": row["created_at"],

0 commit comments

Comments
 (0)