Skip to content

Reduce native inference time on i7-7700T with per-model optimizations - #21

Merged
danielr55 merged 5 commits into
ceva-ip:optimized-inferencefrom
varyagnord:perf/i7-7700t-evaluation
Nov 6, 2026
Merged

danielr55 merged 5 commits into
ceva-ip:optimized-inferencefrom
varyagnord:perf/i7-7700t-evaluation

Conversation

@varyagnord

@varyagnord varyagnord commented Oct 27, 2026 •

Copy link
Copy Markdown

Reduce neural-call processing time at a 10 ms cadence on an Intel Core i7-7700T, with independently selected implementations for each model. Target ceva-ip/DPDFNet:optimized-inference (baseline afa8292), which contains the native runtime.

Replace stride-3 depthwise gathers with bounded loads/permutations and enable AVX2/FMA graph code generation. Model 8 additionally reuses the existing fused AVX2 batch kernel, writes recurrent state directly, and aligns branches. Retain the AVX2/FMA baseline, optional AVX-VNNI dispatch, unchanged weights/ABI and libc/libm-only runtime dependencies. Fix static PGO-generation linkage. Remove unused production experiment switches.

Independent held-out confirmation under performance governor/EPP, original frequency bounds, 36 mirrored randomized blocks per model, two fresh processes per variant/block, 120 warmup and 500 timed hops/process:

Model Baseline mean, ms Final mean, ms Time reduction Multiplicity-adjusted interval
2 0.9536 0.9086 4.723% [4.065%, 5.377%]
8 2.0015 1.8978 5.177% [4.799%, 5.554%]

Both CPU 2 and its HT sibling CPU 6 were reserved; workers ran only on CPU 2 and ordinary processes were excluded from both. All observations and identical-binary controls are retained. Each retained factor has a separately confirmed conditional contribution; V groups graph targeting with -fno-math-errno; B groups AVX2 batch fusion with quantize64. Their internal edits were not separately isolated. p99 improved and no timed calls or completions exceeded the 10 ms deadline. These are neural-call measurements, not an end-to-end latency or cross-CPU speedup claim.

The separate 36-block original-power follow-up confirms model 2 (+5.142%, interval [2.556%, 7.658%]); model 8 remains inconclusive (+1.508%, interval [-1.240%, 4.181%]). The evidence retains the original short guard and the post-plan follow-up, including the permutation-resolution limitation and unchanged family-40 correction.

Validation:

  • Every spectrum and complete state match baseline bitwise over 65 independent EARS/stress streams per model (147,711 hops/model), including aliases and reset replay. The historical corpus was unavailable; no new perceptual scores are claimed.
  • GCC 14.2 PGO release: 28 passed/6 skipped; ASan/UBSan: 28/6; static PGO: 27/6; AVX2-only: 28 passed/no skips. Additional fresh GCC 12.4 PGO release: 28/6. Performance claims use GCC 14.2 only.
  • CPU-mask checks, installed shared/static consumers, seven exports and libc/libm-only dependencies pass. All VNNI objects in the measured build are byte-identical to baseline; native and QEMU direct VNNI execution is unavailable on the local test machine, so those six tests explicitly skip locally. On capable GitHub Actions hosts, all six direct VNNI contracts executed and passed, including both PGO phases for shared/static builds; this verifies correctness, not VNNI performance.
  • Fresh builds after the build-link fix and configuration cleanup reproduce the exact measured shared-library SHA-256. All isolation/power settings restored; patch chain verified against the final source tree.

Portable results and per-factor intervals: optimized_inference/validation/i7_7700t_final.json. All 57 contrasts, including the initial failed control, are published as paired block observations in optimized_inference/validation/i7_7700t_blocks.json (orders, log ratios, analysis seeds and source hashes); their t intervals were independently reconstructed before publication. Methods and scope: optimized_inference/docs/PERFORMANCE.md. Full per-hop samples, infrastructure journals and the HTML report are retained in the local evidence archive.

CI coverage in this PR:

  • Five configurations: shared PGO, static PGO, plain static, AVX2-only and ASan/UBSan.
  • Both PGO jobs first build every executable and run all contracts in GENERATE mode, including linking the optional kernel benchmarks. This directly exercises profiling-runtime linkage for model-8 direct-object tests and static consumers.
  • Final PGO releases use separate build directories and fresh training profiles. The generation-contract profiles are not reused for release optimization.
  • Configuration and CTest logs are retained as workflow artifacts. The shared/static GENERATE checks also passed locally with GCC 12.4 (28/6 and 27/6 passed/skipped respectively).
    Verified CI results for published head 30899a72736bff5bf0616886b58f54f89c24acbb:

All five jobs passed in the upstream PR workflow, and all five passed independently in the fork push workflow. Both workflows used GCC 11.4.0 on Ubuntu 22.04. Every job log was inspected; neither PGO phase produced a linker failure.

Configuration Upstream results Fork results
Shared PGO GENERATE 34 passed; release 34 passed GENERATE 34 passed; release 34 passed
Static PGO GENERATE 33 passed; release 33 passed GENERATE 33 passed; release 33 passed
Plain static 27 passed, 6 skipped 27 passed, 6 skipped
AVX2-only 28 passed 28 passed
ASan/UBSan 28 passed, 6 skipped 34 passed

Skips are the six direct VNNI contracts on hosts without the required instruction. Both shared/static PGO configurations executed those contracts successfully in GENERATE and release builds, and the fork sanitizer job executed them too. There were no test failures. Each workflow retained five configuration/CTest log artifacts for 14 days. The PR check rollup is successful for this exact head.

Add guarded depthwise, concurrency, CPU-mask and every-hop stream checks. Preserve raw timing evidence and provide paired statistical/profiling tools. Propagate GCC profiling linkage to static consumers during PGO generation.
Replace stride-three gathers with bounded loads/permutations and enable the accepted AVX2/FMA graph code generation with no-math-errno.
Reuse fused AVX2 batch calculations, write recurrent state directly and align only model 8 branches. Preserve the accepted VNNI object code and runtime dispatch; remove unused production experiment switches.
Record independent per-model and factor confirmation, power-policy follow-up, exact correctness checks and compiler coverage. Publish all paired block observations and retain explicit VNNI/historical-corpus limitations.
Build and run every contract in GENERATE mode, including linking kernel benchmark executables, before training fresh separate shared/static PGO releases. Add the static PGO matrix entry and retain CMake/CTest logs as workflow artifacts.
@danielr55
danielr55 merged commit 98df765 into ceva-ip:optimized-inference Nov 6, 2026
5 checks passed
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.

2 participants