Skip to content

Unsloth Studio (AMD/Windows): show an iGPU's own memory on Settings > About, not the system RAM it can borrow - #14317

Merged
danielhanchen merged 7 commits into
unslothai:mainfrom
LeoBorcherding:fix/about-igpu-shared-memory
Oct 20, 2026
Merged

danielhanchen merged 7 commits into
unslothai:mainfrom
LeoBorcherding:fix/about-igpu-shared-memory

Conversation

@LeoBorcherding

@LeoBorcherding LeoBorcherding commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

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/hardware now passes shared_memory, unified_memory and shared_memory_host_backed_gb on each gpus row.
  • About shows the iGPU's own memory and marks it: AMD Radeon(TM) Graphics · 2 GiB (integrated). The split uses the same deviceSharedMemorySplitGb as Settings > System.
  • An integrated GPU with no separate VRAM (NVIDIA GB10 / Jetson, where the whole total is host memory) keeps its total, e.g. 120 GiB (integrated).
  • Discrete cards and responses from older backends are unchanged.
  • New settings.about.gpuIntegrated string, translated in all 14 locales.
  • Bundle budget raised by this change: 474 B raw / 97 B transfer against e326020.

Tests (measured at c36c64e, Windows 11, Node 24.15.0)

  • New about-igpu-shared-memory.test.ts uses 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.
  • Related suites pass 22/22, backend test_export_capability and test_system_vulkan_gpu_info pass 32, and tsc -b is 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 4b8447f vs head), both fed the same /api/system/hardware GPU rows from the 2x R9700 + Ryzen 9 9950X iGPU host above. The iGPU row goes from 36 GiB to 2 GiB (integrated); the discrete R9700 rows are unchanged.

Settings > About GPU rows, before vs after

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 GiB at the merge base and 0.3 GiB (integrated) at the head.

@danielhanchen

Copy link
Copy Markdown
Member

Frontend unit tests (Windows) fails on this PR, not on main:

not ok 12803 - VRAM and RAM totals are labelled GiB, not GB
  location: studio/frontend/tests/vram-total-gib-suffix.test.ts:34
  features/settings/tabs/about-tab.tsx: no labelled total found

That test requires each listed renderer, about-tab.tsx included, to print its total as a template literal of memoryTotalGb / vramTotalGb / systemRamTotalGb followed by GiB (#9551: the values are binary, and a 48 GB card printing "45 GB" was reported as broken detection). This PR's About tab change no longer renders the total that way, so the test finds nothing in the file. If the iGPU value now comes from a differently named field, keep the GiB suffix and add that field to the SUFFIXED pattern; if the label moved into a helper, point the test at the file that renders it.

danielhanchen added a commit that referenced this pull request Oct 20, 2026
… 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.
@danielhanchen danielhanchen self-assigned this Oct 20, 2026
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T15:52:12.168239Z 099caca Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: cfa8331659

ℹ️ 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".

danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 20, 2026
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 099caca9f8

ℹ️ 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".

@danielhanchen
danielhanchen merged commit f7b147d into unslothai:main Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants