Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using memcpy on tensor data when the tensor is not contiguous #584

Open
audiovention opened this issue Oct 17, 2023 · 1 comment
Open

Using memcpy on tensor data when the tensor is not contiguous #584

audiovention opened this issue Oct 17, 2023 · 1 comment

Comments

@audiovention
Copy link

I see in some places in the codebase the implicit assumption that a tensor's memory is contiguous, without any checks/asserts.
For example "ggml_metal_set_tensor" (get_tensor as well) has:
memcpy((void *) ((uint8_t *) id_dst.contents + offs), t->data, ggml_nbytes(t));

I just want to confirm - this would produce wrong results if the tensor has non-identity strides right?

@ggerganov
Copy link
Owner

Yes that's correct. In some places the necessary checks / asserts are missing.

CCLDArjun pushed a commit to CCLDArjun/ggml that referenced this issue Dec 18, 2023
* CI: Re-enable AVX512 testing (Windows-MSVC)

Now with 100% less base64 encoding

* plain __cpuid is enough here
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

No branches or pull requests

2 participants