Skip to content

Answer a cross-boundary copy with a Memcpy, or refuse it - #2561

Merged
acalotoiu merged 3 commits into
mainfrom
fix/copy-auto-cross-boundary
Sep 8, 2026
Merged

Answer a cross-boundary copy with a Memcpy, or refuse it#2561
acalotoiu merged 3 commits into
mainfrom
fix/copy-auto-cross-boundary

Conversation

@ThrudPrimrose

Copy link
Copy Markdown
Collaborator

CopyLibraryNode's Auto selection returned MappedTasklet for every in-kernel multi-element copy without looking at the storages, and again as the host-level fallback for anything the CUDA branch's storage set did not cover, so the expansion then rejected the copy as its own limitation and pointed at MemcpyCUDA1D — which device code cannot issue either. Inside a kernel a cross-boundary copy has no implementation at all and is now refused at selection with a message naming the kernel, while at host level it always resolves to a Memcpy, including for a Register endpoint that sits outside the storage set the branch tested.

Yakup Koray Budanaz and others added 3 commits September 7, 2026 15:23
Auto returned `MappedTasklet` for every in-kernel multi-element copy without looking at
the storages, and again as the host-level fallback for anything the CUDA branch's storage
set did not cover. The expansion then rejected the copy as its own limitation and pointed
at `MemcpyCUDA1D`, which device code cannot issue either.

Inside a kernel a copy that crosses the boundary has no implementation at all -- device
code can neither address host memory nor issue a Memcpy -- so selection refuses it and
says the copy does not belong in the kernel. At host level it is always a Memcpy: the
refinement already answers with the pitched 2-D form or a loop of `cudaMemcpyAsync` per
contiguous chunk, and it is now reached for a `Register` endpoint too, which is host
memory there but sits outside the storage set the branch tested.

@acalotoiu acalotoiu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@acalotoiu
acalotoiu added this pull request to the merge queue Sep 8, 2026
Merged via the queue into main with commit d86b212 Sep 8, 2026
17 checks passed
@acalotoiu
acalotoiu deleted the fix/copy-auto-cross-boundary branch September 8, 2026 16:10
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