Skip to content

Add Xtensa HiFi-optimized BATCH_TO_SPACE_ND, SPACE_TO_BATCH_ND, and DEPTH_TO_SPACE kernels - #4014

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

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

Conversation

@rameshkunasi

Copy link
Copy Markdown
Contributor

Adds Xtensa NNLib-optimized BATCH_TO_SPACE_ND, SPACE_TO_BATCH_ND, and DEPTH_TO_SPACE kernel implementations (split out and modernized from #3701):

  • Xtensa optimizations (tensorflow/lite/micro/kernels/xtensa/{batch_to_space_nd,space_to_batch_nd,depth_to_space}.cc):
    • Optimizes int8 evaluation on HIFI3, HIFI4, HIFI5, and HIFI_IQ using xa_nn_batch_to_space_nd_8_8, xa_nn_space_to_batch_nd_8_8, and xa_nn_depth_to_space_8_8, falling back to *EvalReference otherwise.
    • Extends 3D NHC output shapes ([B, H, C] -> [B, H, 1, C]) when invoking xa_nn_batch_to_space_nd_8_8.
  • Shared kernel refactoring ({batch_to_space_nd,space_to_batch_nd,depth_to_space}.{h,cc}, *_common.cc, BUILD, sources.inc):
    • Add op-prefixed inline constexpr int tensor index and rank constants.
    • Export shared *InitReference (with nullptr check before placement new in SpaceToBatchNDInitReference), *PrepareReference, and *EvalReference.
  • Unit tests ({batch_to_space_nd,space_to_batch_nd,depth_to_space}_test.cc):
    • Add 3D NHC int8 crop/padding tests (BatchToSpace3DCropsInt8, SpaceToBatch3DPaddingInt8) and multi-batch int8 DEPTH_TO_SPACE coverage (DepthToSpaceMultiBatchInt8).

BUG=n/a

@rameshkunasi
rameshkunasi requested a review from a team as a code owner November 18, 2026 03:18
@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 — 388b1416 Deployed Nov 18, 2026 by rameshkunasi via approval-gate #1403
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