Skip to content

Fix unaligned vld2q_s8 loads in MVE s4 kernels - #257

Open
veblush wants to merge 1 commit into
ARM-software:mainfrom
veblush:fix/mve-s4-vld2q-alignment-and-tails
Open

veblush wants to merge 1 commit into
ARM-software:mainfrom
veblush:fix/mve-s4-vld2q-alignment-and-tails

Conversation

@veblush

@veblush veblush commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

MVE VLD20.8/VLD21.8 (vld2q_s8) require 4-byte alignment and raise an alignment UsageFault otherwise, even when CCR.UNALIGN_TRP == 0. In arm_nn_vec_mat_mult_t_s4, arm_nn_mat_mult_nt_t_s4, and arm_convolve_even_s4, row pointers after row 0 are only byte-aligned when the row stride is not a multiple of 4.

Add an arm_nn_vld2q_s8 helper that falls back to byte gather loads when the pointer is not 4-byte aligned, with the alignment check hoisted outside each inner loop.

@veblush
veblush force-pushed the fix/mve-s4-vld2q-alignment-and-tails branch from 4752123 to ded12dd Compare October 29, 2026 20:48
@mansnils

mansnils commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Thanks for this. Can you make datasets reproducible through existing generators and TFL/TFLM reference kernels following unit test conventions (Tests/UnitTest/README.md:147)?

@veblush
veblush force-pushed the fix/mve-s4-vld2q-alignment-and-tails branch from ded12dd to 33b0512 Compare November 3, 2026 00:27
@veblush

veblush commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for this. Can you make datasets reproducible through existing generators and TFL/TFLM reference kernels following unit test conventions (Tests/UnitTest/README.md:147)?

Done. Rebased on main and switched the s4 conv and FC tests over to datasets generated from test_plan.json.

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.

2 participants