Skip to content

[FIX][Web] Read the time evaluator handle from the RPC return encoding - #21018

Open
dotcom07 wants to merge 1 commit into
apache:mainfrom
dotcom07:fix/web-rpc-time-evaluator
Open

dotcom07 wants to merge 1 commit into
apache:mainfrom
dotcom07:fix/web-rpc-time-evaluator

Conversation

@dotcom07

Copy link
Copy Markdown
Contributor

LocalSession::EncodeReturn passes an object return as (type_index, handle) since #17931 moved the RPC to the new FFI ABI. The wasm session's time evaluator path in web/emcc/tvmjs_support.cc still read the first value as the function, so it always got null and the browser runtime aborted with Check failed: (pf != nullptr). Any time_evaluator call over the WebSocket RPC then hung on the Python side.

Read the handle from the second value. The other async return path in the same session already forwards the EncodeReturn output unchanged.

Tested by building the web runtime with Emscripten 4.0.23, connecting the browser RPC page in Chrome with WebGPU on an Apple M4 Pro, and timing a ragged prefill kernel over RPC with time_evaluator. Before this change the browser aborted on the first call. After it, the timer returns and the kernel output matches a NumPy reference. pre-commit checks pass.

LocalSession::EncodeReturn passes an object return as (type_index,
handle) since the RPC moved to the new FFI ABI. The wasm session's
time evaluator path still read the first value as the function, so it
always got null and the browser runtime aborted on the check. Any
time_evaluator call over the WebSocket RPC hung on the Python side.

Read the handle from the second value, where EncodeReturn puts it.

This branch has not been deployed

No deployments
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