Closed Bug 1924499 Opened 1 year ago Closed 1 year ago

Add an API to check if we can run inference

Categories

(Core :: Machine Learning: General, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
133 Branch
Tracking Status
firefox133 --- fixed

People

(Reporter: tarek, Assigned: tarek)

References

(Blocks 1 open bug)

Details

(Whiteboard: [genai])

Attachments

(1 file)

Two elements:

  • a C++ helper to get the info
  • a JS function to loop on that info and block if there's not enough memory

GlobalMemoryStatusEx already provides it and is used in nsAvailableMemoryWatcher::IsCommitSpaceLow()

Summary: Add an API to get total+used physical memory → Add an API to check if we can run inference
Whiteboard: [genai]

It's too hard to find a formula,

I tried based on config.json, on the onnx file sizes, but there are too many factors and unknowns (ion, etc).
we want instead to run in the CI some benchmarks to collect some data depending on the number of threads, the model etc

for now we'll keep a hardcoded list of models with a value

That list can be in RS

Attachment #9430776 - Attachment description: WIP: Bug 1924499 - Add an API to check if we can run inference → Bug 1924499 - Add an API to check if we can run inference r?padenot,gregtatum

Landing this now -- the memory checker is preffed off. I will continue in follow up bugs

Pushed by tziade@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5f9b82e165a2 Add an API to check if we can run inference r=padenot,gregtatum,frontend-codestyle-reviewers,Standard8
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 133 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: