Skip to content

Runtime frame trace on the CPU (recording device, no GPU) - #108

Merged
phantoslayer21 merged 2 commits into
mainfrom
model-l/frame-trace
Nov 13, 2026
Merged

phantoslayer21 merged 2 commits into
mainfrom
model-l/frame-trace

Conversation

@phantoslayer21

@phantoslayer21 phantoslayer21 commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

The runtime's frames on the CPU, without a GPU and without HIP: a test program runs the runtime
(clean/runtime/runtime.cpp) on a recording device. The device keeps buffers in host memory and records code object
loads (with their tags) and launches (kernel, grid, block) instead of executing them. This is the base for the Model L runtime frame
(P13 in community/MODEL-L-SCOPE.md): Model L's frame is Model M's frame with the encoder and decoder steps replaced,
and this trace lets a CPU test check exactly that. Nothing changes in the runtime.

What is added (clean/tests/)

  • runtime_frame_trace.cpp: the recording device, runtime_create with it on a raw model, N frames of zero inputs.
    It prints the create result, the code objects loaded, every frame's launches, and the runtime's kernel summary.
    The device backends are not linked; two stubs stand in for the factory functions that runtime.cpp names.

  • test_runtime_frame_trace.py checks:

    • a synthetic Model M (synthetic_model.write_raw): create, code objects loaded, four frames of launches. The
      launches repeat every second frame because the window offsets alternate.
    • a full build's optional code objects, given by name only (placeholder files), select the default paths: the
      pack12 decoder, dec1 fused with dec0, and the wave64 post (tagged code objects);
    • the same run twice gives the same trace;
    • model=L is refused at create (for now).

    WG_* variables are removed for the runs.

  • host_cxx.py: the host C++ build used by the test (CXX, clang++, g++, or MSVC cl through vcvars64.bat; the same
    steps as test_model_pack_cpp.py), now shared so the L frame tests can use it.

Refs #89

Tested

  • python -m unittest clean.tests.test_runtime_frame_trace: 4 tests, OK (MSVC, Windows).
  • Line endings check: 0 problems.

Not tested

  • No GPU run, by design: nothing is executed on a device, so the trace shows the sequence of launches, not pixels.
  • The Linux branch of host_cxx.py (g++/clang++ with -ldl -pthread); CI runs on Windows.

…evice (no GPU, no HIP)

clean/tests/runtime_frame_trace.cpp runs the runtime on a device that records code object loads and launches instead of executing them; test_runtime_frame_trace.py checks Model M's sequence. The base for checking Model L's frame against Model M's. Nothing changes in the runtime.

Refs #89

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
… paths

The recording device loads tagged code objects (load_module_tagged), so the pack12 decoder, the fused dec1 + dec0 and the wave64 post paths run on it; the test selects them by placeholder files of their code object names.

Refs #89

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
@phantoslayer21
phantoslayer21 marked this pull request as ready for review November 13, 2026 23:45
@phantoslayer21
phantoslayer21 merged commit 26141b2 into main Nov 13, 2026
2 checks passed
@phantoslayer21
phantoslayer21 deleted the model-l/frame-trace branch November 13, 2026 23:47
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.

1 participant