Skip to content

Enable fused K64 projections for model 8 on AVX-VNNI - #25

Open
varyagnord wants to merge 1 commit into
ceva-ip:optimized-inferencefrom
varyagnord:perf/model8-vnni-fusion
Open

varyagnord wants to merge 1 commit into
ceva-ip:optimized-inferencefrom
varyagnord:perf/model8-vnni-fusion

Conversation

@varyagnord

Copy link
Copy Markdown

Summary

Enable the existing four-row fused AVX-VNNI assembly for eligible model-8 K64 batch and paired projections. The kernel combines the packed integer dot products with the existing FP32 scale and bias epilogue. Hardware selection uses the existing runtime dispatch. Model 2, the AVX2 kernel selection, exact quantization, model weights, and the seven-symbol public ABI are preserved.

This is a standalone change against the current optimized-inference branch. It applies independently of #22 and #23. Both combinations were checked for merge conflicts. The earlier channel-major qualification found about 0.80–1.21% lower times in six qualifying model-8 conditions. That study used a different baseline.

New measurement against current upstream

Fresh, independently trained native PGO builds of 98df765 and this change ran on one Ryzen core with its SMT sibling parked, the L3 domain reserved, and frequency verified near 2 GHz. The fixed continuous model-8 test used two inputs, 16 identical-binary A/A pairs and 16 A/B pairs of fresh processes, and 512 timed calls per process.

Metric Baseline Fused
Mean per-process runtime ± sample SD 1.50606 ± 0.00113 ms 1.48820 ± 0.00143 ms
Per-call sample SD 0.00314 ms 0.00358 ms
User cycles per call, from separate PMU runs 2.999 M 2.967 M

The paired inference-time reduction was 1.186% (95% CI 1.107–1.264%). The A/A interval was −0.047% to +0.099%. All 32,768 timed calls completed within 10 ms. Four separate PMU runs recorded 100% counter scheduling. The laboratory restoration audit passed. This benchmark covers continuous inference on this host at the fixed frequency. The earlier Boost and complete-audio results remain scoped to their measured configurations.

Correctness

  • Native PGO 35/35, static ASan/UBSan 34/34, and AVX2-only 28/28 CTests passed.
  • The model-8 VNNI assembly contract checked 7,680 guarded calls and 491,520 exact float outputs across four rounding modes and all four FTZ/DAZ combinations.
  • The two upstream-based PGO libraries matched bitwise on all 130 model/stream comparisons (295,422 hops), including recurrent state, reset replay and buffer-alias modes.
  • The generated assembly is shared with the existing model-2 implementation. The new model-8 symbol has VEX-encoded dot products and is private. The exported symbols and dynamic dependencies match the upstream build.

Reuse the validated four-row VNNI assembly for eligible batch and paired projections while preserving model 2, AVX2, and the public ABI. Extend the existing fused contract to run directly in the model-8 VNNI namespace and cover independent FTZ and DAZ combinations.

Validation: 35 native PGO, 34 static ASan/UBSan and 28 AVX2-only CTests passed.

This branch has not been deployed

No deployments
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 this pull request may close these issues.

1 participant