Repository navigation
fix(studio): distinguish dedicated vram from shared gpu memory (#9242) - #9247
Conversation
|
The VRAM split itself is right, the torch fallback in studio/backend/utils/hardware/hardware.py really does drop the shared_memory flag the Vulkan path sets. Could you narrow this to just that flag plus gpu-vram.ts and the monitor caption, and move the diffusion from_pipe, mlx_repair, native_tls and composer queue changes into their own PRs? |
…thai#9242) A Windows ROCm system with a discrete GPU plus an iGPU using shared memory showed the SUM (28 GiB: 15.92 dedicated + 12.15 shared) labeled as VRAM. The Vulkan visibility path already flags shared-memory devices, but the torch fallback — the path ROCm Windows actually takes — reported the unified pool with no marker, so the UI could only print one number. - The torch device inventory now records unified_memory (the same ROCm APU classifier the carve-out correction uses), and the visibility fallback surfaces it as the shared_memory flag the Vulkan path already sets. - gpu-vram gains dedicatedGpuMemoryTotalGb/sharedGpuMemoryTotalGb: the halves of the existing aggregate, same 2dp precision so their sum still equals it exactly. - The floating monitor keeps the aggregate as the usage denominator but renders the caption as '{vram} VRAM + {shared} shared' when a shared pool is present (new i18n key; all-dedicated systems unchanged). Four tests: the 15.92+12.15 split sums to the aggregate, a GTT pool shared by several device views counts once, all-dedicated reports zero shared, and 2dp float error does not leak into the halves.
ff29e08 to
3e550bc
Compare
|
Narrowed and rebased off main — the PR is now exactly |
|
Pushed five focused follow-up commits after reviewing the ROCm classification path and every Studio GPU-capacity display. Findings and fixes:
Verification completed before push:
The PR head is now |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2ea4aeae89
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Post-push review found and fixed two more correctness issues:
Verification on
No ROCm hardware was available, so ROCm behavior was verified with the repository's mocked hardware tests. The empty |
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f9e562646c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e37e58f1c7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7344c1742d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Closes #9242.
The mislabel
A Windows ROCm system with a discrete GPU (15.92 GiB) plus an iGPU using shared memory (12.15 GiB) showed the sum (28 GiB) labeled as VRAM. The Vulkan visibility path already flags shared-memory devices — but the torch fallback, the path ROCm Windows actually takes, reported the unified pool with no marker, so the UI could only print one number.
The fix — three small layers
unified_memoryper device (reusing the same ROCm APU classifier the carve-out correction already trusts), and the visibility fallback surfaces it as theshared_memoryflag the Vulkan path sets.gpu-vram.ts:dedicatedGpuMemoryTotalGb/sharedGpuMemoryTotalGb— the two halves of the existing aggregate, at the same 2dp precision so their sum still equals it exactly (the aggregate stays the usage-percentage denominator; only the caption changes).{vram} VRAM + {shared} sharedwhen a shared pool is present (new i18n keyvramWithShared); all-dedicated systems are byte-identical to before.This gives exactly the reporter's suggested readout shape:
16 GiB VRAM + 12 GiB shared + 32 GiB RAM.Tests
Four in
tests/gpu-vram-split.test.ts: the 15.92 + 12.15 split sums exactly to the aggregate; a GTT pool shared by several device views counts once (mirrors the aggregate's own max-not-sum rule); all-dedicated reports zero shared; 2dp float error does not leak into the halves. 4/4 green, and the existinggpu-memory-aggregatesuite still passes (9/9 together).tsc --noEmitclean; touched files lint clean.Note: I can only verify the split logic on this machine (no ROCm iGPU attached) — the classifier reuse means the flag on real APU hardware follows the same path the carve-out correction has been exercising since it shipped.