Skip to content

Add Xtensa HiFi-optimized SLICE kernel - #4013

Open
rameshkunasi wants to merge 1 commit into
tensorflow:mainfrom
rameshkunasi:xtensa-slice
Open

rameshkunasi wants to merge 1 commit into
tensorflow:mainfrom
rameshkunasi:xtensa-slice

Conversation

@rameshkunasi

Copy link
Copy Markdown
Contributor

Adds an Xtensa NNLib-optimized SLICE kernel implementation (split out and modernized from #3701):

  • Xtensa optimization (tensorflow/lite/micro/kernels/xtensa/slice.cc):
    • Optimizes int8, int16, and int32 evaluation on HIFI3, HIFI4, HIFI5, and HIFI_IQ using xa_nn_strided_slice_int8, xa_nn_strided_slice_int16, and xa_nn_strided_slice_int32 for <= 4D non-empty slices, falling back cleanly to SliceEvalReference for 5D or empty slices.
  • Shared kernel refactoring (slice.h, slice_common.cc, slice.cc, BUILD, sources.inc):
    • Add inline constexpr int tensor index constants (kSliceInputTensor, kSliceBeginTensor, kSliceSizeTensor, kSliceOutputTensor).
    • Export shared SlicePrepareReference (replacing TFLITE_DCHECK with TF_LITE_ENSURE* checks), PopulateSliceParams, and SliceEvalReference.
  • Unit tests (slice_test.cc):
    • Add 4D inner-axis and 5D int8/int16 slice tests (Slice4DInnerAxisInt8, Slice4DInnerAxisInt16, In5DInt8, In5DInt16).

BUG=n/a

@rameshkunasi
rameshkunasi requested a review from a team as a code owner November 18, 2026 03:16
@rameshkunasi rameshkunasi self-assigned this Nov 18, 2026
@rameshkunasi rameshkunasi added the ci:full Triggers the comprehensive cross-platform test suite. label Nov 18, 2026
@rameshkunasi
rameshkunasi deployed to integration-test November 18, 2026 03:20 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
integration-test — 172a436e Deployed Nov 18, 2026 by rameshkunasi via approval-gate #1402
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:full Triggers the comprehensive cross-platform test suite.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant