Skip to content

Add modular FlashDreams application runner - #453

Draft
gtong-nv wants to merge 10 commits into
mainfrom
dev/gtong/flashdreams-runner
Draft

Add modular FlashDreams application runner#453
gtong-nv wants to merge 10 commits into
mainfrom
dev/gtong/flashdreams-runner

Conversation

@gtong-nv

@gtong-nv gtong-nv commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Architecture

application module              flashdreams-runner                 I/O mode
+------------------+       +--------------------------+       +---------------+
| create_runtime() | ----> | initialize Runtime       | ----> | Replay / MP4  |
|                  |       | create Session           |       | WebRTC        |
| Runtime          |       |                          |       | None          |
|  model weights   |       | loop:                    |       +-------+-------+
|  global state    |       |   input = mode.read()    |               |
|                  |       |   output = Session.      |<--------------+
| RunnerInference  |<------|       step(input)        |
| Session          |       |                          |
|  prompt/cache    |       |   mode.write(output)     |-------------->+
|  game state      |       | destroy Session/Runtime  |
+------------------+       +--------------------------+

Signed-off-by: Gangzheng Tong <gtong@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Signed-off-by: Gangzheng Tong <gtong@nvidia.com>
Signed-off-by: Gangzheng Tong <gtong@nvidia.com>
Signed-off-by: Gangzheng Tong <gtong@nvidia.com>
Signed-off-by: Gangzheng Tong <gtong@nvidia.com>
Signed-off-by: Gangzheng Tong <gtong@nvidia.com>
@@ -0,0 +1,26 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like flashdreams_app shouldn't be called app, it is the runner that can run other apps. and it shouldn't be located in a place parallel to t2v_app. The runner is the "host", "t2v" is the thing that gets run by the host.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, once the basic logic is implemented, this is easy to change.

spec=spec,
device=environment.device,
)
if args.mode == "webrtc":

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so the main loop is sort of duplicated and implemented differently in the webrtc path and mp4 path. This is fine for now but could be cleaned up by abstracting native window/web rtc into objects, so you make the main loop implemented just once.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the current runtime API, looks like we have to separate it into branches


@dataclass(frozen=True, kw_only=True, slots=True)
class PipelineAppSpec:
"""Declarative application definition consumed by the generic host runtime."""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you can possibly express all forms of applications in a declarative way. An application should be defined by an object that provides init() and generate(), not a metadata/manifest.

Signed-off-by: Gangzheng Tong <gtong@nvidia.com>
Signed-off-by: Gangzheng Tong <gtong@nvidia.com>
Signed-off-by: Gangzheng Tong <gtong@nvidia.com>
Use the shared inference session spelling directly to remove the duplicate generate adapter and keep runner and WebRTC execution aligned.

Signed-off-by: Gangzheng Tong <gtong@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants