[GPU] create tensor from file - #37153
Open
michal-miotk wants to merge 87 commits into
Open
Conversation
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| 0, | ||
| 0, | ||
| ov::intel_gpu::SharedBufferHandle{}, | ||
| VirtualAddressMemory{mapped_memory->data(), static_cast<int64_t>(*byte_size)}, |
t-jankowski
requested changes
Aug 10, 2026
Comment on lines
+272
to
+275
| ASSERT_NE(mm, nullptr); | ||
| ASSERT_EQ(mm->size(), k_size); | ||
| ASSERT_THAT(std::vector<uint8_t>(m_content.begin() + k_offset, m_content.begin() + k_offset + k_size), | ||
| ElementsAreArray(reinterpret_cast<const uint8_t*>(mm->data()), mm->size())); |
Contributor
There was a problem hiding this comment.
Whether load_mmap_object does its job is tested elsewhere. This test precondition is that before and after values differ.
Contributor
|
@michal-miotk , could you please fill out the PR description? |
t-jankowski
reviewed
Aug 12, 2026
|
|
||
| /** @brief Legacy single-call MapViewOfFile path (no partial-release support). */ | ||
| void legacy_setup(size_t aligned_offset, size_t head_pad, size_t size); | ||
| void legacy_setup(size_t aligned_offset, size_t head_pad, size_t size, MmapMode mode = MmapMode::READ); |
Contributor
There was a problem hiding this comment.
It needn't be defaulted - legacy_setup is private and called only once.
Suggested change
| void legacy_setup(size_t aligned_offset, size_t head_pad, size_t size, MmapMode mode = MmapMode::READ); | |
| void legacy_setup(size_t aligned_offset, size_t head_pad, size_t size, MmapMode mode); |
|
|
||
| /** @brief Core setup shared by set() and set_from_handle(). */ | ||
| void setup(HANDLE file_handle, size_t offset, size_t size, bool no_placeholder); | ||
| void setup(HANDLE file_handle, size_t offset, size_t size, bool no_placeholder, MmapMode mode = MmapMode::READ); |
Contributor
There was a problem hiding this comment.
I'd avoid default parameter and explicitly set mode when called.
michal-miotk
commented
Aug 13, 2026
| * so the file must not be modified until the returned tensor is destroyed. | ||
| * @ingroup ov_runtime_ocl_gpu_cpp_api | ||
| */ | ||
| struct FileDescriptor { // need to be merged with ov::intel_npu::FileDescriptor in future |
Contributor
Author
There was a problem hiding this comment.
very similar to
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Details:
Tickets:
AI Assistance: