Commit 5724f1a
fix(merge): restore device-lifecycle refcounting + fix speculative-decode compile breaks
Upstream sync (305 commits) merged cleanly at the text level in several
spots but broke semantically:
- ggml-cuda.cu: the active_count/device_mutex per-device refcounting
(used by ggml_backend_cuda_device_get_memory to safely cudaDeviceReset
an idle device instead of leaking a lazily-created CUDA context) was
silently dropped across all 7 call sites during the merge, since each
drop was a non-conflicting textual change. Restored via two forward-
declared helpers (ggml_backend_cuda_device_active_count_inc/dec) since
most call sites precede the struct's new (upstream-relocated) definition
point and can't do direct member access there.
- server-context.cpp: fixed compile errors introduced while porting our
MAD-120 paged-KV admission control onto upstream's new iterate()/
handle_last_sampled_token() API:
- continue; inside the iterate() lambda (invalid — lambdas aren't
loops) changed to return;, matching the surrounding skip-slot
convention already used there.
- stale batch.n_tokens field reference (type is now a class exposing
.size()) in a log line.
- a broken speculative-decode telemetry block referencing three
undefined variables (id, tok_idx, t_current) copy-pasted from a
different function's scope — fixed to use the correct in-scope
equivalents (ids[i], t_now) and dropped the populate_token_probs
call that had no valid index in this scope (the existing
"TODO: set result.probs" gap is left as-is, not newly introduced).
Verified: build-army (CUDA) llama-server + test-backend-ops clean,
1134/1134 MUL_MAT pass on CUDA0. build-vk (Vulkan+CUDA) test-backend-ops
clean, 956/956 MUL_MAT pass on Vulkan0. test-paged-attn-vk (SP2 dual-
backend oracle) all cases pass.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014ZRfPpL8XFzk1hep9MMg9P1 parent 9d916fe commit 5724f1a
2 files changed
Lines changed: 68 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
665 | 665 | | |
666 | 666 | | |
667 | 667 | | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
668 | 679 | | |
669 | 680 | | |
670 | 681 | | |
| |||
675 | 686 | | |
676 | 687 | | |
677 | 688 | | |
678 | | - | |
679 | | - | |
680 | | - | |
| 689 | + | |
681 | 690 | | |
682 | 691 | | |
683 | 692 | | |
| |||
849 | 858 | | |
850 | 859 | | |
851 | 860 | | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
852 | 865 | | |
853 | 866 | | |
854 | 867 | | |
| |||
1571 | 1584 | | |
1572 | 1585 | | |
1573 | 1586 | | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
1574 | 1591 | | |
1575 | 1592 | | |
1576 | 1593 | | |
| |||
1604 | 1621 | | |
1605 | 1622 | | |
1606 | 1623 | | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
1607 | 1628 | | |
1608 | 1629 | | |
1609 | 1630 | | |
| |||
3475 | 3496 | | |
3476 | 3497 | | |
3477 | 3498 | | |
| 3499 | + | |
| 3500 | + | |
| 3501 | + | |
| 3502 | + | |
3478 | 3503 | | |
3479 | 3504 | | |
3480 | 3505 | | |
| |||
5340 | 5365 | | |
5341 | 5366 | | |
5342 | 5367 | | |
| 5368 | + | |
| 5369 | + | |
| 5370 | + | |
| 5371 | + | |
5343 | 5372 | | |
5344 | 5373 | | |
| 5374 | + | |
| 5375 | + | |
| 5376 | + | |
| 5377 | + | |
| 5378 | + | |
| 5379 | + | |
| 5380 | + | |
| 5381 | + | |
| 5382 | + | |
| 5383 | + | |
| 5384 | + | |
| 5385 | + | |
| 5386 | + | |
| 5387 | + | |
5345 | 5388 | | |
5346 | 5389 | | |
5347 | 5390 | | |
| |||
5430 | 5473 | | |
5431 | 5474 | | |
5432 | 5475 | | |
| 5476 | + | |
| 5477 | + | |
| 5478 | + | |
| 5479 | + | |
| 5480 | + | |
5433 | 5481 | | |
5434 | 5482 | | |
5435 | 5483 | | |
| |||
5456 | 5504 | | |
5457 | 5505 | | |
5458 | 5506 | | |
| 5507 | + | |
| 5508 | + | |
| 5509 | + | |
| 5510 | + | |
| 5511 | + | |
| 5512 | + | |
| 5513 | + | |
5459 | 5514 | | |
5460 | 5515 | | |
5461 | 5516 | | |
| |||
6336 | 6391 | | |
6337 | 6392 | | |
6338 | 6393 | | |
| 6394 | + | |
| 6395 | + | |
| 6396 | + | |
| 6397 | + | |
6339 | 6398 | | |
6340 | 6399 | | |
6341 | 6400 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3564 | 3564 | | |
3565 | 3565 | | |
3566 | 3566 | | |
3567 | | - | |
| 3567 | + | |
3568 | 3568 | | |
3569 | 3569 | | |
3570 | | - | |
| 3570 | + | |
3571 | 3571 | | |
3572 | 3572 | | |
3573 | 3573 | | |
| |||
4081 | 4081 | | |
4082 | 4082 | | |
4083 | 4083 | | |
4084 | | - | |
| 4084 | + | |
4085 | 4085 | | |
4086 | 4086 | | |
4087 | 4087 | | |
| |||
4531 | 4531 | | |
4532 | 4532 | | |
4533 | 4533 | | |
4534 | | - | |
| 4534 | + | |
4535 | 4535 | | |
4536 | 4536 | | |
4537 | 4537 | | |
4538 | 4538 | | |
4539 | | - | |
| 4539 | + | |
4540 | 4540 | | |
4541 | 4541 | | |
4542 | 4542 | | |
| |||
4545 | 4545 | | |
4546 | 4546 | | |
4547 | 4547 | | |
4548 | | - | |
4549 | | - | |
4550 | | - | |
4551 | | - | |
4552 | | - | |
4553 | | - | |
4554 | | - | |
4555 | | - | |
4556 | | - | |
4557 | | - | |
| 4548 | + | |
4558 | 4549 | | |
4559 | 4550 | | |
4560 | 4551 | | |
| |||
0 commit comments