Skip to content

Studio: contain native ROCm APU telemetry crashes - #8853

Closed
oobabooga wants to merge 2 commits into
unslothai:mainfrom
oobabooga:fix/windows-rocm-system-probe-crash
Closed

oobabooga wants to merge 2 commits into
unslothai:mainfrom
oobabooga:fix/windows-rocm-system-probe-crash

Conversation

@oobabooga

Copy link
Copy Markdown
Member

Summary

Reported on Reddit.

  • run the ROCm APU memory-total query in a cached child process so a native HIP abort cannot kill Studio
  • fall back to the device-property total when the probe crashes, hangs, or returns invalid data
  • keep Windows ROCm system telemetry out of the parent-process occupancy path

Testing

  • python -m pytest -q studio/backend/tests/test_torch_device_probe.py studio/backend/tests/test_system_poll_no_cuda_context.py studio/backend/tests/test_rocm_windows_vram_7072.py
  • python -m pytest -q studio/backend/tests/test_gpu_selection.py tests/studio/install/test_rocm_support.py
  • ruff check on the changed Python files

@LeoBorcherding

LeoBorcherding commented Aug 14, 2026 •

Copy link
Copy Markdown
Collaborator

@oobabooga extending torch_device_probe rather than adding a second mechanism is the right shape, and catching that _torch_get_device_inventory reaches mem_get_info on exactly the APUs where _rocm_props_total_is_carve_out is true is a good find. Caching failure as well as success matters here too.

My one concern: I don't think the hardened call sites are reachable on the reporting user's config. His log has amd-smi disabled on Windows (no HIP SDK detected), so _run_amd_smi returns None (amd.py:113) → available: False (amd.py:432) → _smi_query returns None (hardware.py:1368). Both reconcile functions sit inside if result is not None, so neither runs, and the only _torch_get_device_inventory call in get_visible_gpu_utilization is Linux-gated (hardware.py:2491).

What runs instead is _rocm_windows_per_device_vram, which reads get_device_properties only. When it returns [], control falls to _torch_get_per_device_info (hardware.py:2138, 2520) — still calling mem_get_info in the parent after this PR. Any interest in extending containment there, or is there a path I've missed?

Non-blocking: device_can_allocate is called from one rare user-initiated path (RAG embeddings) where the 120 s budget is fine; rocm_memory_totals is on the telemetry poll path, so the first call pays a cold torch import in a child — 48 s in-process on that user's machine. Cached after, but worth confirming the caller isn't on the event loop.

Separately: neither of us has the stack yet. The backend already aims faulthandler at ~/.unsloth/studio/logs/server/ (run.py:1850), but the diagnostics report never collects that directory, which is why his report showed exit code: 3 and nothing else. #8877 adds those tails to the report — complementary to this, not competing, and it's what would confirm or rule out mem_get_info as the aborting call. Worth asking him for the newest server-*.log either way.

@oobabooga

Copy link
Copy Markdown
Member Author

I'm closing this as speculative and unconfirmed. We should focus on #8877 and reproducibility before proposing any specific fix to an undiagnosed crash.

@oobabooga oobabooga closed this Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants