Repository navigation
Unsloth Studio (AMD/Windows): show an iGPU's own memory on Settings > About, not the system RAM it can borrow - #14317
Conversation
…ed on Settings > About
|
That test requires each listed renderer, |
… tables by any spelling (#14318) ## Problem `(Python 3.13, a-k)` fails on every PR since #14310 merged (for example #14316 and #14317, both on base fb372c1): ``` studio/backend/tests/test_diffusion_segment_quant.py: in test_skeleton_buffers_match_from_pretrained assert dense.keys() == built.keys() and any("rope" in name for name in dense) ``` #14310 showed the same failure on its own run before merging. Reproduced locally with transformers 5.18 (CI resolves 5.17.0); the 4.57 floor has no `Sam3Model`, so the test skips there. There are two layers: 1. With transformers 5.x the RoPE buffers are named `rotary_emb.inv_freq`, `rotary_emb.original_inv_freq` and `position_ids`; none contains `rope`. 2. Behind that check, the dtype comparison fails as well: `from_pretrained(dtype = bfloat16)` casts the ViT's `position_ids` to bf16 on 5.18, while `_build_skeleton` builds them in float32 on purpose. They are not just a different dtype: layer 1 (global attention) has different values in bf16, and swapping the skeleton's buffers into the dense model changes the vision encoder output. That is exactly the 0.04 shift the test's docstring describes, so the skeleton is right and a bf16 load is not a valid reference. ## Fix Test only: - The reference is `from_pretrained(dtype = float32)`, the exact tables the skeleton is meant to reproduce on every transformers version. - The RoPE presence check matches `rope`, `rotary` or `position_ids`. ## Testing - `test_diffusion_segment_quant.py` with transformers 5.18: 37 passed, 3 skipped. On main the skeleton test fails as in CI. - Building the skeleton without `_default_dtype(torch.float32)` (the regression the test exists for) makes it fail on `position_ids`. - `test_diffusion_segment.py` with `test_diffusion_segment_quant.py`: 109 passed, 3 skipped. ## Not covered here The dense bf16 path (`Sam3Model.from_pretrained(..., dtype = dtype)` in `diffusion_segment.py`) gets the rounded `position_ids` on 5.18, so on that release its masks differ from the pre-quantized path's. That is a product question for the segmenter, separate from this CI fix.
|
@codex review |
1 similar comment
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Bravo. 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 |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! 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". |
Settings > About listed a Windows ROCm iGPU as
AMD Radeon(TM) Graphics · 36 GiB. Only about 2 GiB of that is the iGPU's own memory. The rest is system RAM it can borrow, and every GPU can borrow system RAM, so listing it on that row makes the iGPU read like a 36 GiB card next to the 32 GiB R9700s.Fix
/api/system/hardwarenow passesshared_memory,unified_memoryandshared_memory_host_backed_gbon eachgpusrow.AMD Radeon(TM) Graphics · 2 GiB (integrated). The split uses the samedeviceSharedMemorySplitGbas Settings > System.120 GiB (integrated).settings.about.gpuIntegratedstring, translated in all 14 locales.e326020.Tests (measured at
c36c64e, Windows 11, Node 24.15.0)about-igpu-shared-memory.test.tsuses the real rows from a 2x R9700 + Ryzen 9 9950X iGPU host (iGPU: 36.23 GiB total, 34.26 GiB host-backed). It checks the 2 GiB iGPU row, the discrete cards, the no-carve-out total, the older-row fallback, and that the route forwards the fields. It fails on main.test_export_capabilityandtest_system_vulkan_gpu_infopass 32, andtsc -bis clean.I haven't taken a screenshot of the tab, and I haven't seen an Intel iGPU row. The backend has no shared-memory flag for XPU, so an Intel iGPU still shows its plain total.
Related: #14039 (iGPU left out of the Train page total), #14040 (Live monitor VRAM), #13421.
Before / after
Settings > About on two isolated Studio installs (merge base
4b8447fvs head), both fed the same/api/system/hardwareGPU rows from the 2x R9700 + Ryzen 9 9950X iGPU host above. The iGPU row goes from36 GiBto2 GiB (integrated); the discrete R9700 rows are unchanged.On a real Strix Halo (Radeon 8060S, Windows 11, gfx1151) the backend reports 76.79 GiB total with 76.46 GiB host-backed: About reads
77 GiBat the merge base and0.3 GiB (integrated)at the head.