[ci]: address performance review nits

This commit is contained in:
Mac Lee
2026-07-15 13:34:46 -07:00
committed by SolitaryThinker
parent 0b50a7c0be
commit 9d5ed005ac
4 changed files with 25 additions and 8 deletions
@@ -279,7 +279,7 @@ records = load_records_for_model(
For v2 exact-identity targets:
```python
from hf_store import load_records_for_identity
from fastvideo.performance.hf_store import load_records_for_identity
records = load_records_for_identity(
"/tmp/perf-tracking",
+4 -5
View File
@@ -259,13 +259,12 @@ def load_records(
if baseline_eligible_only and not is_baseline_eligible_record(data):
continue
if cutoff is not None:
ts = _parse_record_timestamp(data)
if ts is not None and ts < cutoff:
continue
ts = _parse_record_timestamp(data)
if cutoff is not None and ts is not None and ts < cutoff:
continue
records.append((
_parse_record_timestamp(data) or datetime.min.replace(tzinfo=timezone.utc),
ts or datetime.min.replace(tzinfo=timezone.utc),
path,
data,
))
@@ -348,7 +348,8 @@ def _build_identity_fields(cfg, init_kwargs, prompt, runtime_identity):
resolved_model_revision=runtime_identity.get("resolved_model_revision"),
measured_prompts=[prompt],
)
num_gpus = init_kwargs.get("num_gpus", cfg.get("run_config", {}).get("required_gpus", 1))
run_config = cfg.get("run_config") or {}
num_gpus = init_kwargs.get("num_gpus", run_config.get("required_gpus", 1))
hw_profile = hardware_profile(num_gpus=num_gpus)
sw_profile = software_profile()
env_metadata = environment_metadata(
@@ -466,7 +467,7 @@ def _build_result_record(
# -- Test -------------------------------------------------------------------
def _run_benchmark(cfg):
run_config = cfg.get("run_config", {})
run_config = cfg.get("run_config") or {}
required_gpus = run_config.get("required_gpus", 1)
available = torch.cuda.device_count()
if available < required_gpus:
@@ -95,6 +95,23 @@ def test_performance_producer_emits_v2_identity_from_raw_result_shape(monkeypatc
assert "output_path" not in record["recipe"]["generation_kwargs"]
def test_v2_identity_tolerates_null_run_config(monkeypatch):
monkeypatch.setenv("FASTVIDEO_ATTENTION_BACKEND", "FLASH_ATTN")
cfg = _benchmark_config()
cfg["run_config"] = None
init_kwargs = dict(cfg["init_kwargs"])
identity_fields = perf._build_v2_identity_fields(
cfg,
init_kwargs,
dict(cfg["generation_kwargs"]),
"A cinematic video.",
"NVIDIA L40S PCIe",
)
assert identity_fields["hardware_profile"]["gpu_count"] == 2
def test_software_profile_tracks_exact_runtime_attention_kernel_and_container_versions(monkeypatch):
package_versions = {
"triton": "3.2.1",