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

[FEATURE] Static Inference Support for RawC and GGML #228

Open
emrecakmakyurdu opened this issue Mar 9, 2025 · 0 comments · May be fixed by #229
Open

[FEATURE] Static Inference Support for RawC and GGML #228

emrecakmakyurdu opened this issue Mar 9, 2025 · 0 comments · May be fixed by #229

Comments

@emrecakmakyurdu
Copy link

emrecakmakyurdu commented Mar 9, 2025

Feature Request

Describe the Feature

Static inference in RawC and GGML backends is not supported. Currently, these backends rely on dynamic execution even when constant inputs are provided. Static inference will allow for pre-computation of operations at compile time, thereby optimizing performance.

Motivation

This feature will eliminate the need for dynamic execution, improve efficiency and reduce runtime overhead when constant inputs are supplied.

Proposed Solution

1. RawC Backend

  • Develop Python wrapper functions to execute supported operations directly on the RawC backend when static inputs are supplied.

2. GGML Backend

  • Utilize RawC backend operations as the basis for computations.
  • Convert GGML arrays to C arrays before passing them to functions, and convert the results back to GGML arrays.
  • In GGML code generation, bypass tensor creation and graph marking for statically inferred keys by directly assigning these keys to the output.

Alternatives Considered

An alternative approach for the GGML backend would involve creating a separate dynamic library to manage the GGML flow for tensor operations. However, this method would require context and memory buffer allocation for each static inference, potentially offsetting the performance benefits.

Additional Context

@emrecakmakyurdu emrecakmakyurdu changed the title [FEATURE] Add Static Inference Support for RawC and GGML [FEATURE] Static Inference Support for RawC and GGML Mar 9, 2025
@emrecakmakyurdu emrecakmakyurdu linked a pull request Mar 9, 2025 that will close this issue
4 tasks
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

Successfully merging a pull request may close this issue.

1 participant