-
Notifications
You must be signed in to change notification settings - Fork 13.6k
ggml-hexagon: graceful fallback for older socs where rpcmem_alloc2 and FASTRPC_GET_URI is unsupported #16987
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
Conversation
|
@l3utterfly @chraac Let's move that weak symbol define into htp-utils.h. There are already some other weak syms defined in there. I was hoping to avoid having to deal with Regarding the multi-session support. It'd be better to not create multiple GGML devices on the systems that do not support multi-session. We can add some simple logic to |
Sounds like we could create an dev caps array that store if multi session was supported, and then use |
Probably overkill. ie will need to keep adding versions as they come out. |
Removed weak declaration for rpcmem_alloc2.
Force ndev to 1 for SoCs architectures lower than v75.
|
@max-krasnyansky updated PR according to your suggestions! |
Older SoCs like the Gen2 does not seem to support obtaining session URIs via
FASTRPC_GET_URI. Additionally, they do not support the newrpcmem_alloc2, and should userpcmem_allocinstead.This PR adds graceful fallback for older SoCs:
rpcmem_alloc2instead of statically loading, fall back torpcmem_allocif unable to findalloc2FASTRPC_GET_URI, falls back to single session uriPreviously,
ggml-hexagonquits when running on an SD8 Gen2, which does not supportalloc2nor allow creating multiple sessions.This PR is tested to work on both consumer S23 Ultra (SD8 Gen2), and S25+ Ultra (SD8 Gen4).
@max-krasnyansky I would appreciate your direction on if this PR is the way to go forward providing graceful fallback for older SoCs?
libcdsprpc.solibrary name is hard-coded, is this a problem?ggml-hexagonstill thinks multiple session are open, should this be the end-users responsibility to not open multiple sessions on devices that do not support it?function pointer type torpcmem_allow[2]is hardcoded, and declared as static,dlopenanddlclosehappens inggml_hexagon_registry, from my understanding, it seems it's guaranteed to only initialise oncedlopenanddlclosepart to use.dllinsteadEDIT: thanks to @chraac in here: #16911 (comment), updated PR to use weak symbols instead of dynamically loading
libcdsprpc.so, which is a much more elegant solution