Closed Bug 2058478 Opened 3 months ago Closed 21 days ago

Device discovery and placement API for the llama.cpp engine

Categories

(Core :: Machine Learning: On Device, task, P2)

task

Tracking

()

RESOLVED FIXED
161 Branch
Tracking Status
firefox161 --- fixed

People

(Reporter: vpollet, Assigned: vpollet)

References

(Blocks 1 open bug)

Details

(Whiteboard: [aiplatform])

Attachments

(5 external files)

Features consuming llama.cpp should have access to an API to query capabilities of the HWInference process, and a way to specify hardware accelerators when configuring an engine.

Blocks: llama-cpp-gpu
No longer blocks: llama-cpp-process
Blocks: llama-cpp-accelerate
No longer blocks: llama-cpp-gpu

Devices that fail a real initialisation are not listed.

Assignee: nobody → vpollet
Status: NEW → ASSIGNED

nGpuLayers, offloadKqv and opOffload are removed from LlamaRunner. The KV
cache and host-side ops follow the loaded device. An empty placement loads on
the CPU.

The option is an HWInferencePlacement, forwarded unchanged to
TextGenerator.create().

The device_kind extra is cpu, gpu or npu. The device id stays out of
telemetry. The extra is null on backends that do not place models.

MOZ_ML_EXPECT_ACCELERATOR makes a missing accelerator a test failure. It also
adds a SmolLM2 chat run placed on a GPU, with no CPU fallback.

Pushed by vpollet@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/38008a3cb395 https://hg.mozilla.org/integration/autoland/rev/43ed38f581e6 Part 1: List the inference devices of the HWInference process. r=ai-platform-reviewers,nordzilla https://github.com/mozilla-firefox/firefox/commit/c10690d069b6 https://hg.mozilla.org/integration/autoland/rev/42d62613be3a Part 2: Let a TextGenerator choose its device through a placement. r=ai-platform-reviewers,webidl,smaug,nordzilla https://github.com/mozilla-firefox/firefox/commit/9dd6d555b276 https://hg.mozilla.org/integration/autoland/rev/0006690f4e11 Part 3: Let the device pipeline option place a text generation. r=ai-platform-reviewers,nordzilla https://github.com/mozilla-firefox/firefox/commit/f97cf9a84896 https://hg.mozilla.org/integration/autoland/rev/a674077e952b Part 4: Record the kind of device that loaded a text generation model. r=ai-platform-reviewers,nordzilla https://github.com/mozilla-firefox/firefox/commit/4e2e01bc5cd3 https://hg.mozilla.org/integration/autoland/rev/bec672284e1f Part 5: Test llama.cpp on the Metal GPU of the macOS CI machines. r=ai-platform-reviewers,taskgraph-reviewers,jcristau,nordzilla
Pushed by vpollet@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/53a1e1440621 https://hg.mozilla.org/integration/autoland/rev/4d5ba6f025ba Part 1: List the inference devices of the HWInference process. r=ai-platform-reviewers,nordzilla https://github.com/mozilla-firefox/firefox/commit/56f99db5c5cc https://hg.mozilla.org/integration/autoland/rev/4745a899a566 Part 2: Let a TextGenerator choose its device through a placement. r=ai-platform-reviewers,webidl,smaug,nordzilla https://github.com/mozilla-firefox/firefox/commit/e3997055527c https://hg.mozilla.org/integration/autoland/rev/e3e5be019415 Part 3: Let the device pipeline option place a text generation. r=ai-platform-reviewers,nordzilla https://github.com/mozilla-firefox/firefox/commit/45be2a43455d https://hg.mozilla.org/integration/autoland/rev/9ab313e073c7 Part 4: Record the kind of device that loaded a text generation model. r=ai-platform-reviewers,nordzilla https://github.com/mozilla-firefox/firefox/commit/d5ce10e284c2 https://hg.mozilla.org/integration/autoland/rev/b19d4e9b6c9a Part 5: Test llama.cpp on the Metal GPU of the macOS CI machines. r=ai-platform-reviewers,taskgraph-reviewers,jcristau,nordzilla

Authored by https://github.com/vlntnplt
https://github.com/mozilla/enterprise-firefox/commit/53a1e1440621c88c19f892ea248b84cdfc60f4a5
[enterprise-main] Bug 2058478 - Part 1: List the inference devices of the HWInference process. r=ai-platform-reviewers,nordzilla

Authored by https://github.com/vlntnplt
https://github.com/mozilla/enterprise-firefox/commit/56f99db5c5cc168196e63dc4ebbf60b210a8a250
[enterprise-main] Bug 2058478 - Part 2: Let a TextGenerator choose its device through a placement. r=ai-platform-reviewers,webidl,smaug,nordzilla

Authored by https://github.com/vlntnplt
https://github.com/mozilla/enterprise-firefox/commit/e3997055527cf6234d43b26a468626a6872db5ee
[enterprise-main] Bug 2058478 - Part 3: Let the device pipeline option place a text generation. r=ai-platform-reviewers,nordzilla

Authored by https://github.com/vlntnplt
https://github.com/mozilla/enterprise-firefox/commit/45be2a43455d957913408c2cf2ecb7395db96504
[enterprise-main] Bug 2058478 - Part 4: Record the kind of device that loaded a text generation model. r=ai-platform-reviewers,nordzilla

Authored by https://github.com/vlntnplt
https://github.com/mozilla/enterprise-firefox/commit/d5ce10e284c29ccab91ab1e5451df99dfd3267ca
[enterprise-main] Bug 2058478 - Part 5: Test llama.cpp on the Metal GPU of the macOS CI machines. r=ai-platform-reviewers,taskgraph-reviewers,jcristau,nordzilla

(via GitHub webhook, authenticated as shared-secret)

QA Whiteboard: [qa-triage-done-c162/b161]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: