Skip to content

fix: keep the device and memory type in MemoryInfo::to_owned - #621

Merged
decahedron1 merged 1 commit into
pykeio:mainfrom
onuralpszr:fix-from-raw-memory-info
Sep 22, 2026
Merged

decahedron1 merged 1 commit into
pykeio:mainfrom
onuralpszr:fix-from-raw-memory-info

Conversation

@onuralpszr

@onuralpszr onuralpszr commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

MemoryInfo::to_owned always returned a CPU MemoryInfo since e12fb02 (v2.0.0-rc.13), so TensorRefMut::from_raw and Allocator::new treated CUDA memory as host memory and ONNX Runtime copied device inputs as if they were host buffers. It now keeps the device, device id, allocator type and memory type,Clone reuses it, and test_memory_info_eq passed.

@decahedron1

Copy link
Copy Markdown
Member

Wow, I don't know how I didn't catch that. Guess I copied the Default impl and... forgot to change it? Embarrassing. Thanks!

@decahedron1
decahedron1 merged commit df4d618 into pykeio:main Sep 22, 2026
17 of 18 checks passed
@onuralpszr
onuralpszr deleted the fix-from-raw-memory-info branch September 22, 2026 08:23
@onuralpszr

Copy link
Copy Markdown
Contributor Author

Wow, I don't know how I didn't catch that. Guess I copied the Default impl and... forgot to change it? Embarrassing. Thanks!

You are welcome :)

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