Skip to content

[MLAS] Add int8 extreme-value coverage for ARM64 SymmQgemm - #31606

Open
kjg0724 wants to merge 1 commit into
microsoft:mainfrom
kjg0724:symm-qgemm-s8-boundary-test
Open

[MLAS] Add int8 extreme-value coverage for ARM64 SymmQgemm#31606
kjg0724 wants to merge 1 commit into
microsoft:mainfrom
kjg0724:symm-qgemm-s8-boundary-test

Conversation

@kjg0724

@kjg0724 kjg0724 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

The ARM64 symmetric quantized GEMM tests (MlasSymmQgemmTest) only ever feed A and B with MatrixGuardBuffer::GetBuffer()'s default fill, which is confined to [21, 64) — even ExecuteLong's large M/N/K sweep never touches an int8 extreme. This adds SymmQgemmS8SignedInputTest, mirroring the QgemmS8U8SignedInputTest pattern from #29787, with A and B both explicitly filled with int8 extremes (-128, -1, 0, 1, 127, ...) across a K/M/N/offa grid sized around the kernel's actual block structure (PackedK=16, StrideM=4, N aligned to 16).

This is a test-only change; nothing under onnxruntime/core/mlas/lib/ is touched.

While adding these tests, I found a correctness bug in the plain-NEON (non-dotprod) MlasSymQgemmS8KernelNeon kernel and filed it separately as #31573. The new tests here pass because they exercise the SDOT dispatch (default on both machines I verified this on); the NEON dispatch only gets exercised on ARM64 cores without dot-product support.

Testing

onnxruntime_mlas_test, full suite, no regressions:

  • Apple M1 (macOS): 29227/29227 passed
  • Neoverse-N1 (Oracle Cloud A1, Ubuntu): 36020/36020 passed

*SymmQGemmS8_Int32_SignedInput*: 1248/1248 passed on both (624 cases x SingleThread/Threaded).

MlasSymmQgemmTest only ever fills A and B via MatrixGuardBuffer's
default fill, which is confined to [21, 64) -- even ExecuteLong's
large M/N/K sweep never exercises an int8 extreme. Add
SymmQgemmS8SignedInputTest, mirroring the QgemmS8U8SignedInputTest
pattern from microsoft#29787, with A and B explicitly filled with int8
extremes across a K/M/N/offa grid sized around the kernel's block
structure (PackedK=16, StrideM=4, N aligned to 16).

Test-only change, nothing under core/mlas/lib/ is touched.
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

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