Skip to content
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
59e9a85
Add fake demo runtime vertical slice
jarcherNV Aug 9, 2026
42c7859
Fix demo session invariant cleanup
jarcherNV Aug 9, 2026
539911e
Finalize direct demo driver invariant failures
jarcherNV Aug 9, 2026
d06df9f
Add RuntimeHost worker boundary
jarcherNV Aug 9, 2026
d661edb
Apply Phase 3 test import formatting
jarcherNV Aug 9, 2026
dbf33a9
runtime: extract demo run mode session helpers
jarcherNV Aug 9, 2026
6f83fdf
runtime: finalize session edges when invariant cleanup dispatch fails
jarcherNV Aug 9, 2026
631963b
runtime: guard cleanup error recording during teardown
jarcherNV Aug 9, 2026
dbfd430
runtime: add realtime timing contracts
jarcherNV Aug 9, 2026
d1cb914
runtime: add realtime session driver
jarcherNV Aug 9, 2026
3b08bd3
runtime: clarify unavailable host cleanup
jarcherNV Aug 9, 2026
b856f48
runtime: harden batch cleanup finalization
jarcherNV Aug 9, 2026
4a3b807
runtime: split demo step requirements from input windows
jarcherNV Aug 9, 2026
19a4449
runtime: add MP4 and null demo output sinks
jarcherNV Aug 9, 2026
9d3afd9
runtime: add demo capability validation
jarcherNV Aug 9, 2026
b16920e
runtime: avoid serving dependency in demo timing
jarcherNV Aug 9, 2026
a9d3860
runtime: split demo warmup setup
jarcherNV Aug 9, 2026
c8314f9
runtime: guard run cleanup telemetry failures
jarcherNV Aug 9, 2026
7f36767
Phase 10: unify demo metrics and error policies
jarcherNV Aug 9, 2026
5abea73
Phase 11: extract legacy runner onto shared batch path
jarcherNV Aug 9, 2026
386e9b0
Phase 11.5: adopt shared replay output sinks
jarcherNV Aug 9, 2026
42eeaaf
Phase 12: decompose shared WebRTC session edges
jarcherNV Aug 9, 2026
75a2a7d
runtime: fix WebRTC service import ordering
jarcherNV Aug 9, 2026
60bef84
runtime: harden realtime WebRTC service contracts
jarcherNV Aug 9, 2026
6ca870c
runtime: route WebRTC sessions through realtime driver
jarcherNV Aug 9, 2026
b137f75
runtime: shield async invariant cleanup
jarcherNV Aug 9, 2026
f021b99
runtime: attempt provider cleanup after session timeout
jarcherNV Aug 9, 2026
eb57155
Reshape OmniDreams replay runtime toward shared contract
jarcherNV Aug 9, 2026
03de4c5
Wire OmniDreams precomputed HDMaps through provider
jarcherNV Aug 9, 2026
3affc4f
Fix provider cleanup after session close timeout
jarcherNV Aug 9, 2026
19a5727
Add OmniDreams replay null output mode
jarcherNV Aug 9, 2026
62c3b79
Shield pre-edge provider cleanup from cancellation
jarcherNV Aug 9, 2026
f988ce4
Preserve worker affinity for cleanup timeouts
jarcherNV Aug 9, 2026
c3609f7
Mark cleanup dispatch failures unhealthy
jarcherNV Aug 9, 2026
e976b44
Document worker-affine cleanup timeout tradeoff
jarcherNV Aug 9, 2026
d7b39fd
Phase 14: add OmniDreams Ludus replay provider
jarcherNV Aug 10, 2026
26735b5
Add OmniDreams Ludus keyboard trace
jarcherNV Aug 10, 2026
758eabe
Mark runtime host unhealthy on cleanup close failures
jarcherNV Aug 10, 2026
84b1a6c
Quarantine runtime host on cleanup failures
jarcherNV Aug 10, 2026
26e4510
Document runtime cleanup quarantine rationale
jarcherNV Aug 10, 2026
1acd7d5
Collapse OmniDreams WebRTC onto shared runtime session
jarcherNV Aug 10, 2026
53c1b9d
Fix OmniDreams WebRTC shared runtime warmup
jarcherNV Aug 10, 2026
8c68f20
Keep OmniDreams WebRTC encoders across warmup
jarcherNV Aug 10, 2026
a2ae69b
Cap OmniDreams WebRTC video display size
jarcherNV Aug 10, 2026
16cd15d
Load OmniDreams WebRTC video sizing stylesheet reliably
jarcherNV Aug 10, 2026
ea817a4
Close async demo provider on pre-driver cancellation
jarcherNV Aug 10, 2026
18e4d36
Route OmniDreams WebRTC through shared realtime driver
jarcherNV Aug 10, 2026
24c6e07
ci: add OmniDreams demo runtime GPU workflow
jarcherNV Aug 10, 2026
1a91935
ci: shorten OmniDreams demo runtime artifacts
jarcherNV Aug 10, 2026
441e1bb
omnidreams: clean up shared demo runtime layout
jarcherNV Aug 10, 2026
1c12ecf
docs: record validated OmniDreams demo commands
jarcherNV Aug 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions flashdreams/flashdreams/runtime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,20 @@
from flashdreams.runtime.metrics import (
InMemoryMetricsRecorder,
MetricsRecorder,
MetricsSnapshot,
NullMetricsRecorder,
RuntimeMetricSample,
)
from flashdreams.runtime.output import NullOutputTarget, OutputArtifact, OutputTarget
from flashdreams.runtime.runner import run_inference_session
from flashdreams.runtime.types import StepRequest, StepResult
from flashdreams.runtime.types import (
StepRequest,
StepRequirements,
StepResult,
step_requirements_from_request,
)
from flashdreams.runtime.video_output import Mp4VideoOutputTarget
from flashdreams.runtime.worker import ThreadAffineRuntimeWorker
from flashdreams.runtime.worker import ModelExecutionWorker, ThreadAffineRuntimeWorker

__all__ = [
"CanonicalInputs",
Expand Down Expand Up @@ -90,7 +96,9 @@
"KeyboardToDriverCommand",
"MappingCompatibility",
"MetricsRecorder",
"MetricsSnapshot",
"ModelAdapter",
"ModelExecutionWorker",
"Mp4VideoOutputTarget",
"NullMetricsRecorder",
"NullOutputTarget",
Expand All @@ -100,10 +108,12 @@
"RuntimeMetricSample",
"ScriptedModality",
"StepRequest",
"StepRequirements",
"StepResult",
"TimeWindow",
"ThreadAffineRuntimeWorker",
"run_inference_session",
"step_requirements_from_request",
"undeclared_inference_inputs",
"UserInputCapability",
"UserInputEvent",
Expand Down
8 changes: 8 additions & 0 deletions flashdreams/flashdreams/runtime/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ class InferenceConfig:
cache_policy: str | None = None
"""Optional cache policy selector; ``None`` leaves the choice to the adapter."""

seed: int | None = None
"""Optional seed used when resolving deterministic demo/runtime behavior."""

runtime_options: Mapping[str, Any] = field(default_factory=dict)
"""Adapter/backend-specific runtime options."""

Expand All @@ -70,6 +73,11 @@ class InferenceConfig:
def __post_init__(self) -> None:
if not self.model_id.strip():
raise ValueError("InferenceConfig.model_id must be non-empty.")
if self.seed is not None:
if isinstance(self.seed, bool) or not isinstance(self.seed, int):
raise TypeError("InferenceConfig.seed must be an integer.")
if self.seed < 0:
raise ValueError("InferenceConfig.seed must be >= 0.")
object.__setattr__(
self, "runtime_options", freeze_mapping(self.runtime_options)
)
Expand Down
152 changes: 150 additions & 2 deletions flashdreams/flashdreams/runtime/demo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,176 @@

"""Experimental shared demo API above the inference runtime API."""

from flashdreams.runtime.demo.outputs import build_output_target
from flashdreams.runtime.demo.replay import run_replay_demo
from flashdreams.runtime.demo.drivers import (
CLEANUP_TIMEOUT_S,
BatchSessionDriver,
DriverInvariantError,
RealtimeSessionDriver,
run_demo_session,
run_demo_session_async,
shielded_session_cleanup,
uncancel_current_task,
)
from flashdreams.runtime.demo.host import (
ModelWarmupPlan,
RuntimeHost,
WarmupSessionInputs,
)
from flashdreams.runtime.demo.outputs import (
Mp4OutputSink,
NullOutputSink,
OutputDecision,
OutputSink,
SessionInfo,
build_output_sink,
build_output_target,
)
from flashdreams.runtime.demo.pipeline import StepOutcome, StepPipeline
from flashdreams.runtime.demo.replay import OutputSinkFactory, run_replay_demo
from flashdreams.runtime.demo.run_modes import (
AsyncSessionDriver,
BenchmarkErrorPolicy,
DefaultErrorPolicy,
ErrorAction,
InMemorySessionMetricsRecorder,
MetricsSnapshot,
Mp4ErrorPolicy,
NativeWindowErrorPolicy,
NoopTransportService,
NullErrorPolicy,
RunContext,
RunMode,
RunModeCapabilities,
RunModeWarmup,
RunResult,
RunSummary,
SessionDriver,
SessionEdges,
SingleSessionAdmissionPolicy,
WebRTCErrorPolicy,
build_model_warmup_plan,
warmup_run_context,
)
from flashdreams.runtime.demo.session_inputs import (
BatchInputSource,
ControlDecision,
InputSource,
ModelInputProvider,
PreparedStep,
ProviderCapabilities,
RealtimeInputSource,
UserInputWindow,
)
from flashdreams.runtime.demo.spec import (
DemoAdapter,
DemoSpec,
ModelWarmupAdapter,
Mp4OutputSpec,
NullOutputSpec,
OutputSpec,
PreparedScenario,
WebRTCAppResources,
WebRTCOutputSpec,
)
from flashdreams.runtime.demo.timing import (
SPARSE_KEY_SEGMENTS_METADATA_KEY,
ActivationPolicy,
ActivationResult,
ActivationSignal,
AlwaysActiveActivationPolicy,
CatchUpDecision,
CatchUpPolicy,
DeterministicClock,
KeyboardRealtimeInputSource,
RealtimeClock,
RealtimeWindowResult,
ResamplerRealtimeClock,
SignalActivationPolicy,
input_frame_count_from_request,
)
from flashdreams.runtime.demo.validation import (
ResolvedRunCapabilities,
resolve_run_capabilities,
validate_resolved_run,
)

__all__ = [
"BatchInputSource",
"BatchSessionDriver",
"CLEANUP_TIMEOUT_S",
"ControlDecision",
"DefaultErrorPolicy",
"DemoAdapter",
"DemoSpec",
"DriverInvariantError",
"ErrorAction",
"AsyncSessionDriver",
"ActivationPolicy",
"ActivationResult",
"ActivationSignal",
"AlwaysActiveActivationPolicy",
"BenchmarkErrorPolicy",
"InMemorySessionMetricsRecorder",
"InputSource",
"CatchUpDecision",
"CatchUpPolicy",
"DeterministicClock",
"MetricsSnapshot",
"ModelWarmupAdapter",
"ModelWarmupPlan",
"ModelInputProvider",
"KeyboardRealtimeInputSource",
"Mp4ErrorPolicy",
"Mp4OutputSink",
"Mp4OutputSpec",
"NativeWindowErrorPolicy",
"NoopTransportService",
"NullOutputSpec",
"NullOutputSink",
"NullErrorPolicy",
"OutputDecision",
"OutputSinkFactory",
"OutputSpec",
"OutputSink",
"PreparedScenario",
"PreparedStep",
"ProviderCapabilities",
"RealtimeInputSource",
"RealtimeClock",
"RealtimeSessionDriver",
"RealtimeWindowResult",
"ResolvedRunCapabilities",
"ResamplerRealtimeClock",
"RunContext",
"RunMode",
"RunModeCapabilities",
"RunModeWarmup",
"RunResult",
"RunSummary",
"RuntimeHost",
"SessionEdges",
"SessionDriver",
"SessionInfo",
"SignalActivationPolicy",
"SingleSessionAdmissionPolicy",
"SPARSE_KEY_SEGMENTS_METADATA_KEY",
"StepOutcome",
"StepPipeline",
"UserInputWindow",
"WarmupSessionInputs",
"WebRTCAppResources",
"WebRTCErrorPolicy",
"WebRTCOutputSpec",
"build_output_sink",
"build_output_target",
"build_model_warmup_plan",
"input_frame_count_from_request",
"resolve_run_capabilities",
"run_demo_session",
"run_demo_session_async",
"run_replay_demo",
"shielded_session_cleanup",
"uncancel_current_task",
"validate_resolved_run",
"warmup_run_context",
]
11 changes: 10 additions & 1 deletion flashdreams/flashdreams/runtime/demo/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from __future__ import annotations

import argparse
import sys
from abc import ABC, abstractmethod
from typing import Any

Expand All @@ -29,10 +30,18 @@ def main(self, argv: list[str] | None = None) -> None:
configure_logging()
args = self.parse_args(argv)
if args.command == "replay":
run_replay_demo(
result = run_replay_demo(
spec=self.replay_spec(args),
adapter=self.replay_adapter(),
)
if result.status != "completed":
reason = result.reason or (
str(result.error) if result.error is not None else None
)
if reason is None:
reason = f"Replay demo ended with status {result.status!r}."
print(reason, file=sys.stderr)
raise SystemExit(1)
return
if args.command == "webrtc":
context = initialize_cuda_distributed(
Expand Down
Loading
Loading