Skip to content

Support for workloads with response time requirements (realtime) #898

Open

Description

@handellm

Consider an RTC-style web app concurrently running a collection of ML workloads of various response requirements. Assume that there aren't capacity issues (the system as a whole has enough HP to execute the workload on average).

Workload Period/response requirement Job completion delay
Audio capture processing (denoising etc) 50 Hz 25%
Video capture processing (eg background blur) 30 Hz 10-30%
WebSpeech 500ms? (continuous)
LLM Bursty Bursty

Without proper WebNN consideration of these requirements there are concerns that the UA will make poor scheduling decisions, causing the system to miss deadlines. The effects:

  • robo-sound
  • audio glitches
  • dropped video frames
  • janky video
  • increased end-to-end delay (since receiver jitterbuffers need to bump target delay to account for the problems).

The ideal state is that the system manages to understand the requirements. With the right scheduling decisions, LLM queries will be belated a little and possibly the latency of WebSpeech will go up, but as a whole it manages to meet the expectations in a good way.

Assuming the backend frameworks are capable of supporting workload prioritization, I see some options to help this case

  1. Equip the WebNN API with hints on the workload passed.
  2. Auto-detect the type of processing. For example, when audio or video capture wakes a worker it could transport a token containing periodicity info and let that influence scheduling decisions in the WebNN backend.

My guess is both need spec updates? Or maybe just the first option?

See also crbug.com/456006123 for repros of related issues with other tech than WebNN. Also note this issue is not asking for ways to understand total system capacity as this is impossible to compute without trying workloads out.

Activity

  1. handellm commented on Oct 30, 2025

    @handellm
    Author
  2. mwyrzykowski commented on Nov 10, 2025

    @mwyrzykowski

    Seems like we could use the hints proposed in http://github.com/webmachinelearning/webnn/issues/902 to achieve this? Or would we need further granularity?

  3. handellm commented on Nov 12, 2025

    @handellm
    Author

    Yes, I beleive #902 could be used provided AV capture/render cases are present in the list of hints.

  4. anssiko commented on Nov 27, 2025

    @anssiko
    Member

    @handellm, do you think we could merge this issue into #902?

    The QoS hint is proposed in #902 (comment) Please check all relevant perspectives from this issue are captured in #902 before closing this issue.

    For you reference, here are the minutes from our F2F discussion: https://www.w3.org/2025/11/09-webmachinelearning-minutes.html#43b5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions