Repository navigation
Conversation
2 of 29 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #946
On AMD (ROCm) the daemon's
GET /engine/metricsalways reportedvramBytes: 0:daemon/metrics.pyaskspynvml, thennvidia-smi, and returned 0 when neither exists.When both give nothing,
vram_bytes_for_pidsnow reads the kernel's DRM fdinfo (/proc/<pid>/fdinfo/*) for the serve tree's pids and sumsdrm-resident-vram(drm-memory-vramon older kernels), counting each(drm-pdev, drm-client-id)once so forked workers and dup'ed fds are not double counted. Stdlib only, no subprocess. The NVIDIA path is unchanged: the fallback runs only where the old code returned 0.Testing
Hardware: Radeon RX 7800 XT (gfx1101, 16 GB), Ubuntu 26.04.1, kernel 7.0.0-44, in-tree amdgpu.
Software:
mainat 4237991 plus this change,torch 2.14.1+rocm7.14, Python 3.12.Checkpoint: Qwen2.5-Coder-3B-Instruct, Q4_K_M GGUF (the Ollama
qwen2.5-coder:3bblob).engine_footprintreportedvramBytes15,395,758,080 across the 4 serve pids;amd-smi processshowed 15,034,640 KiB (15,395,471,360 bytes) for the same process.pytest tests/daemon -q: 39 passed.Not tested: an NVIDIA machine (that path is not touched), and the value as rendered by the Desktop app.
Test added
tests/daemon/test_daemon_metrics.py. Every probe in this module answers 0 on failure, so a regression in the fdinfo path would raise nothing and an AMD engine would just show as using no VRAM. The test feeds a fake/procand checks the per-client dedup, the pid filter, the older key spelling, and the unit handling.