-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
struct ggml_tensor -> add a struct meta pointer into it (can replace padding) #1093
Comments
Yes, good idea. I think it's better to just extend |
Is the padding still relevant ? Can I just extend it without causing problems ? Maybe a couple structs (non pointers) in that case, separating the tensorstruct into a few logical groups like performance, debug, scheduler would make it a bit more accessible while still keeping all together in one parent. I am a bit confused on padding in general because in 32 bit pointer size is 4 bytes, so I am not sure if the static 8 byte padding is right for all hardware. Currently I got that one in use. The name is set by an optional function call:
|
Padding is just to make sure these asserts hold:
I think we want extra members without wrapping them in extra structures. Just streamline it as much as possible. |
The |
Decided to add |
Given that the tensor struct uses padding it's not nice to add any more information into it.
It currently has a static 8 byte padding at the end, that's perfect to be replaced by a pointer to a struct to store additional information.
For example a optional human readable tensor name (to be used in graph print) or a couple u_int8 to switch on or off features by tensor.
For example: use_cublas=0
This would allow to fine-control the usage of such a library instead of hard-coding it on through a define flag.
For example: performance_type=HIGH/LOW/MID
For example: threads_override=2
use_cublas could be initialized depending on the define as 1/0.
I'd also move the task scheduling n_task out and the performance stuff
The overhead to access a compact external struct should be zero.
I suppose all that stuff could also be added directly into the tensor struct but if we have to keep it aligned that's not nice.
Especially given 64/32 bit environments with different pointer sizes etc.
Just as an example, giving tensors a name can look like that in the debug output:
Without names it's unreadable, the image version looks ok but in text form it's just too many operations to keep track.
The text was updated successfully, but these errors were encountered: