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.
Proposed PR branch:
qe/issue-12-prepared-quantized-matmul-contextCategory:
Feature Request(performance for repeated-shape workloads)Problem
Justification / why this is needed
shapes repeated). Paying setup costs per call is avoidable overhead.
Proposed change
zdnn_prepare_quantized_matmul_context(...)zdnn_quantized_matmul_op_prepared(...)zdnn_release_quantized_matmul_context(...)buffer management in the context lifecycle).
Acceptance criteria
Test plan
make test(expectstests/testDriver_quantized_matmul_prepared_context.cto pass).References
zdnn/prepared_quantized_matmul.c,zdnn/zdnn.h,zdnn/zdnn.map,tests/testDriver_quantized_matmul_prepared_context.c.