[GH-ISSUE #34] What are the requirements for the CPU instruction set? #20

Closed
opened 2026-11-04 01:39:05 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @qwased on GitHub (Sep 28, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/34

Among AVX2, AVX512, and AVX-VNNI, which of these would be helpful? My CPU is a 13600KF.
Thanks!

Originally created by @qwased on GitHub (Sep 28, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/34 Among AVX2, AVX512, and AVX-VNNI, which of these would be helpful? My CPU is a 13600KF. Thanks!
Author
Owner

@pipeob0 commented on GitHub (Sep 28, 2026):

Measured answer, on a CPU with AVX2 and no AVX-512 (Ryzen 7 5700X3D, 8 cores, DDR4-2666) running a
native pack — so the AVX2 case is the interesting one here:

  • AVX2 is enough to run it, and AVX-512 is not required for a native pack (iq_avx512.cpp is chosen at
    run time when present; the canonical Q2_0 pack does need it).
  • but until now the i-quant gate/up rows had no AVX2 kernel, so they fell back to ggml's
    ggml_vec_dot_iq*_q8_K, which decodes a row once per token. With --spec 4 a verify window is 3-4
    tokens over the same rows, so an AVX2 machine was decoding the same weights 3-4 times for nothing.
  • #43 adds the AVX2 multi-token row kernels. On this box: gate/up phase 15.16 → 13.84 ms/round, rows
    throughput 22.7 → 23.8 GB/s, whole round 50.89 → 48.52 ms/round (-4.7%), parity against ggml's own
    vec_dot at rel 3.1e-08. Two other things that mattered on AVX2-only: the expert arena never actually got
    large pages (#42), and pcie_frac assumed a x16 link while AM4/AM5 boards give a 16 GB card x8 (#44).
  • AVX-VNNI: not used by Strata's own kernels, so it changes nothing today.

Rough ranking on a native pack, from what we measured: AVX2 (works, and works well with #43) → AVX-512
(better, the existing iq_avx512 path) → AVX-VNNI (unused). The instruction set is not the whole story: on
this machine the CPU expert pool now sits close to what dual-channel DDR4-2666 can stream, so after #43 the
next bottleneck is memory bandwidth rather than the decoder.

<!-- gh-comment-id:5865791751 --> @pipeob0 commented on GitHub (Sep 28, 2026): Measured answer, on a CPU with **AVX2 and no AVX-512** (Ryzen 7 5700X3D, 8 cores, DDR4-2666) running a native pack — so the AVX2 case is the interesting one here: - **AVX2 is enough to run it**, and AVX-512 is not required for a native pack (`iq_avx512.cpp` is chosen at run time when present; the canonical Q2_0 pack does need it). - **but** until now the i-quant gate/up rows had no AVX2 kernel, so they fell back to ggml's `ggml_vec_dot_iq*_q8_K`, which decodes a row *once per token*. With `--spec 4` a verify window is 3-4 tokens over the same rows, so an AVX2 machine was decoding the same weights 3-4 times for nothing. - #43 adds the AVX2 multi-token row kernels. On this box: gate/up phase **15.16 → 13.84 ms/round**, rows throughput **22.7 → 23.8 GB/s**, whole round **50.89 → 48.52 ms/round (-4.7%)**, parity against ggml's own `vec_dot` at rel 3.1e-08. Two other things that mattered on AVX2-only: the expert arena never actually got large pages (#42), and `pcie_frac` assumed a x16 link while AM4/AM5 boards give a 16 GB card x8 (#44). - **AVX-VNNI**: not used by Strata's own kernels, so it changes nothing today. Rough ranking on a native pack, from what we measured: AVX2 (works, and works well with #43) → AVX-512 (better, the existing `iq_avx512` path) → AVX-VNNI (unused). The instruction set is not the whole story: on this machine the CPU expert pool now sits close to what dual-channel DDR4-2666 can stream, so after #43 the next bottleneck is memory bandwidth rather than the decoder.
Author
Owner

@Niko1221 commented on GitHub (Sep 28, 2026):

Thanks @pipeob0 for the measurements - that corrects my first answer. For the packs setup installs (native packs, including Q2_0):

  • AVX2 is enough to run everything (the old canonical Q2_0 pack needs AVX-512, but setup does not use it).
  • With AVX2 only, 0.1.14 adds multi-token i-quant kernels (#43): a verify window's 3-4 tokens share one decode of each row instead of one per token (about -5% round time on a Ryzen 5700X3D).
  • AVX-512 (Zen 4/5, Xeon) has its own i-quant kernels and stays the fastest.
  • AVX-VNNI (12th-14th gen Intel) is not used by Strata's kernels.
  • Beyond that, memory bandwidth decides: dual-channel DDR5 at a high speed matters more than the instruction set.
<!-- gh-comment-id:5867756630 --> @Niko1221 commented on GitHub (Sep 28, 2026): Thanks @pipeob0 for the measurements - that corrects my first answer. For the packs setup installs (native packs, including Q2_0): - **AVX2 is enough** to run everything (the old canonical Q2_0 pack needs AVX-512, but setup does not use it). - **With AVX2 only**, 0.1.14 adds multi-token i-quant kernels (#43): a verify window's 3-4 tokens share one decode of each row instead of one per token (about -5% round time on a Ryzen 5700X3D). - **AVX-512** (Zen 4/5, Xeon) has its own i-quant kernels and stays the fastest. - **AVX-VNNI** (12th-14th gen Intel) is not used by Strata's kernels. - Beyond that, memory bandwidth decides: dual-channel DDR5 at a high speed matters more than the instruction set.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#20
No description provided.