-
Notifications
You must be signed in to change notification settings - Fork 23
Fix wan2.2 VBench accuracy pipeline: drain timeouts, .mp4 staging, torch>=2.6, wget preflight #401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -90,6 +90,12 @@ class PhaseConfig: | |||||||||||||||||||||||||||||||||
| dataset: Dataset | ||||||||||||||||||||||||||||||||||
| phase_type: PhaseType = PhaseType.PERFORMANCE | ||||||||||||||||||||||||||||||||||
| drain_after: bool = True | ||||||||||||||||||||||||||||||||||
| drain_timeout_s: float | None = 240.0 | ||||||||||||||||||||||||||||||||||
| """Max seconds to wait for in-flight responses after issuing ends. | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| ``None`` waits indefinitely. Configured per phase type via | ||||||||||||||||||||||||||||||||||
| ``settings.drain`` (see ``config.schema.DrainConfig``). | ||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||
| strategy: LoadStrategy | None = field(default=None, compare=False) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
@@ -417,7 +423,7 @@ async def _run_phase(self, phase: PhaseConfig) -> PhaseResult | None: | |||||||||||||||||||||||||||||||||
| self._strategy_task = None | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| if phase.drain_after: | ||||||||||||||||||||||||||||||||||
| await self._drain_inflight(phase_issuer) | ||||||||||||||||||||||||||||||||||
| await self._drain_inflight(phase_issuer, phase.drain_timeout_s) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| if phase.phase_type == PhaseType.PERFORMANCE: | ||||||||||||||||||||||||||||||||||
| self._publish_session_event(SessionEventType.STOP_PERFORMANCE_TRACKING) | ||||||||||||||||||||||||||||||||||
|
|
@@ -442,21 +448,29 @@ async def _run_phase(self, phase: PhaseConfig) -> PhaseResult | None: | |||||||||||||||||||||||||||||||||
| end_time_ns=phase_end, | ||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| async def _drain_inflight(self, phase_issuer: PhaseIssuer) -> None: | ||||||||||||||||||||||||||||||||||
| async def _drain_inflight( | ||||||||||||||||||||||||||||||||||
| self, phase_issuer: PhaseIssuer, timeout_s: float | None = 240.0 | ||||||||||||||||||||||||||||||||||
| ) -> None: | ||||||||||||||||||||||||||||||||||
| """Wait for all in-flight responses from this phase to complete. | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Hard-bounded at 240 s; logs an error and returns if exceeded so the | ||||||||||||||||||||||||||||||||||
| next phase starts regardless of stuck requests.""" | ||||||||||||||||||||||||||||||||||
| Bounded by ``timeout_s`` (``None`` = wait indefinitely); on timeout, | ||||||||||||||||||||||||||||||||||
| logs an error and returns so the next phase starts regardless of | ||||||||||||||||||||||||||||||||||
| stuck requests.""" | ||||||||||||||||||||||||||||||||||
| if phase_issuer.inflight <= 0 or self._stop_requested: | ||||||||||||||||||||||||||||||||||
| return | ||||||||||||||||||||||||||||||||||
| logger.info("Draining %d in-flight responses...", phase_issuer.inflight) | ||||||||||||||||||||||||||||||||||
| logger.info( | ||||||||||||||||||||||||||||||||||
| "Draining %d in-flight responses (timeout: %s)...", | ||||||||||||||||||||||||||||||||||
| phase_issuer.inflight, | ||||||||||||||||||||||||||||||||||
| f"{timeout_s:.0f} s" if timeout_s is not None else "none", | ||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||
| self._drain_event.clear() | ||||||||||||||||||||||||||||||||||
| try: | ||||||||||||||||||||||||||||||||||
| await asyncio.wait_for(self._drain_event.wait(), timeout=240.0) | ||||||||||||||||||||||||||||||||||
| await asyncio.wait_for(self._drain_event.wait(), timeout=timeout_s) | ||||||||||||||||||||||||||||||||||
| except TimeoutError: | ||||||||||||||||||||||||||||||||||
| logger.error( | ||||||||||||||||||||||||||||||||||
| "Drain timed out after 240 s with %d responses still in flight; " | ||||||||||||||||||||||||||||||||||
| "Drain timed out after %.0f s with %d responses still in flight; " | ||||||||||||||||||||||||||||||||||
| "proceeding to next phase.", | ||||||||||||||||||||||||||||||||||
| timeout_s, | ||||||||||||||||||||||||||||||||||
| phase_issuer.inflight, | ||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||
|
Comment on lines
469
to
475
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If To prevent the exception handler from crashing and masking the original error, we should format
Suggested change
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the VBench cache directory (typically
~/.cache/vbench) is already pre-populated with the required model weights,wgetandunzipare not needed. However, this preflight check unconditionally fails and blocks execution if either tool is missing, even if the cache is fully populated.To support offline or air-gapped environments where the cache is pre-populated but these tools are not installed, we should check if the cache is already populated before failing.