Pinned tinygrad fails disk-to-USB AMD copies (fixed upstream)

Open Beginner friendly
#39,175 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
linux, python

Research direction

Find the tinygrad pin in the repository and inspect its dependency update process. Read upstream tinygrad PR #18824 for the USB GPU guard, then update the pin or backport that condition in is_disk_read. Reproduce with the supplied disk-to-USB AMD script; done when it exits successfully, as it does on the stated upstream revision.

Written by the indexing model from the issue text.

Description

PC

Model compilation on Chestnut fails while loading ONNX with openpilot's pinned tinygrad 02e698160eed1751738212144a7ea2cfb160b3f1.

Minimal repro from tinygrad_repo/, on Linux with io_uring available and a USB AMD GPU:

DEV=USB+AMD:LLVM python - <<'PY'
from tinygrad import Tensor
t = Tensor([1], device="CPU").to("DISK:/tmp/tinygrad-usb-repro").realize()
assert t.to("AMD").item() == 1
PY

Expected: exits successfully. Actual: GPU faults / RuntimeError: Device hang detected during the disk-to-GPU copy.

Upstream already excludes USB GPUs from this direct disk-DMA path in tinygrad #18824, merged October 15. The same repro passes on upstream d39227beebd0c3a340dc42b2cdc1e3db1c36aed9.

Please update the tinygrad pin or backport the not getattr(Device[dev], "is_usb", False) guard in is_disk_read. Backporting that condition also passes a full master-model compile and modeld shared-buffer validation.

Tested with openpilot 8ba9f4baee799aa3f488079c498429bc3b30bb1f, Ubuntu 24.04.1 / Linux 6.8, Python 3.12, and Chestnut (gfx1200).

Dominant language
Python
Stars
64k
Forks
11.4k
Avg merge
14h 3m
Merged PRs (30d)
92

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from commaai/openpilot

All issues in commaai/openpilot

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.