Skip to content

hip: upload large tensors in windows so the blit can pin them - #2584

Merged
ashhart merged 2 commits into
ashhart:mainfrom
ElderOrb:hip-upload-windows
Nov 9, 2026
Merged

ashhart merged 2 commits into
ashhart:mainfrom
ElderOrb:hip-upload-windows

Conversation

@ElderOrb

@ElderOrb ElderOrb commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

A synchronous hipMemcpyHtoD pins the host source for the lifetime of the blit. A single multi-gigabyte source fails to pin, so a large checkpoint cannot be uploaded at all. Copy in 64 MiB windows instead: the pin stays bounded, and a copy no larger than a window still takes one call.

Split out of #2490 at review request: this is the one change there that is not ModelOpt-specific.

Ran: HIP on Windows, gfx1151, a 27B ModelOpt checkpoint (a single 20+ GiB upload) loads and serves.
Not run: any Linux HIP target, any other gfx target.

@ashhart

ashhart commented Nov 8, 2026

Copy link
Copy Markdown
Owner

@ElderOrb thanks for splitting this out. The windows stay inside the range span already checks, the last partial window is exact, and a small upload is still one call, so it's the same bytes as before. One thing: please add a CHANGELOG line under Unreleased, e.g. "HIP: a large host upload copies in 64 MiB windows, so a multi-gigabyte tensor no longer fails to pin (#2584). Thanks to @ElderOrb."

@ashhart
ashhart force-pushed the hip-upload-windows branch from eae27ed to ee891d2 Compare November 9, 2026 00:22
@ashhart

ashhart commented Nov 9, 2026

Copy link
Copy Markdown
Owner

@ElderOrb, a small housekeeping change so this can land: the commit carried a personal email address as its author, and we keep those out of the public history. I re-authored it to your GitHub noreply address (23638+ElderOrb@users.noreply.github.com, the one your earlier commits here use), with your name and the same tree, and pushed it to your branch as ee891d25ad. Nothing else changed. If you set that address in git (git config user.email) for this repository, future commits won't need it.

@ashhart
ashhart force-pushed the hip-upload-windows branch from ee891d2 to 58b245e Compare November 9, 2026 01:14
@ashhart
ashhart merged commit 7c2c66a into ashhart:main Nov 9, 2026
19 of 20 checks passed
@ashhart

ashhart commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Thank you @ElderOrb. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes.

@ashhart

ashhart commented Nov 10, 2026

Copy link
Copy Markdown
Owner

Thanks @ElderOrb! This is in TensorFold 1.2.6, out now: https://github.com/ashhart/TensorFold/releases/tag/v1.2.6

  • Synthena (Ash's Agent)

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