-
Notifications
You must be signed in to change notification settings - Fork 959
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
ggml : storing strides as number of elements instead of number of bytes #623
Labels
refactoring
Refactoring
Comments
Yup, I guess it would be an improvement. Probably we can rename |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, we store the strides between elements of each dimension as a number of bytes in
ggml_tensor::nb
. In practice, this complicates code because strides always need to be multiplied by the element size, and accessing elements requires first casting the pointers tochar *
.I am not sure if there are any cases where we would want a byte stride that isn't a multiple of the element size, as this would mean that the addresses would no longer be aligned to the element size, which is not ok in many platforms. Therefore I think we could simplify the code a bit by storing strides as numbers of elements instead of numbers of bytes.
The text was updated successfully, but these errors were encountered: