Skip to content

[Feature Request] Add Prepared Quantized Matmul Context APIs (Prepare/Execute/Release) #51

Description

@k8ika0s

Proposed PR branch: qe/issue-12-prepared-quantized-matmul-context

Category: Feature Request (performance for repeated-shape workloads)

Problem

  • Repeated quantized matmul calls with stable descriptors redo setup each time.
  • A prepared context reduces per-call overhead for static-shape workloads.

Justification / why this is needed

  • Inference workloads often reuse stable tensor descriptors (weights fixed,
    shapes repeated). Paying setup costs per call is avoidable overhead.
  • Prepared contexts let frameworks precompute/validate once and reuse safely.

Proposed change

  • Add:
    • zdnn_prepare_quantized_matmul_context(...)
    • zdnn_quantized_matmul_op_prepared(...)
    • zdnn_release_quantized_matmul_context(...)
  • Keep prepared-context work-area management self-contained (internal aligned
    buffer management in the context lifecycle).
  • Add tests.
  • (Optional follow-up) Add README guidance for the prepared-context lifecycle.

Acceptance criteria

  • Prepared path matches non-prepared behavior (status + results).
  • Context lifetime rules are enforced (no leaks, safe reuse).
  • Tests cover prepare/execute/release + invalid lifecycle sequences.

Test plan

  • make test (expects tests/testDriver_quantized_matmul_prepared_context.c to pass).

References

  • Key files: zdnn/prepared_quantized_matmul.c, zdnn/zdnn.h, zdnn/zdnn.map,
    tests/testDriver_quantized_matmul_prepared_context.c.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions