Skip to content

feat: compile TFLite LSTM in float32 with its states - #132

Merged
asteinh merged 1 commit into
developfrom
feat/lstm
Oct 5, 2026
Merged

asteinh merged 1 commit into
developfrom
feat/lstm

Conversation

@asteinh

@asteinh asteinh commented Oct 5, 2026

Copy link
Copy Markdown
Member
  • The TFLite frontend converts UNIDIRECTIONAL_SEQUENCE_LSTM in float32. Its hidden and cell variable tensors become two state ports, zero before the first run. The node runs in TFLite's axis order, so the compiler holds its tensors in model order.
  • Refused by name: a missing gate; peepholes, projection or layer normalization, which TFLite Micro does not run; a cell activation other than tanh. int8 LSTM is refused for now.
  • A state below rank 3 leaves in the layout it entered in.
  • Corpus: batch-major and time-major LSTMs, one with a cell clip that engages, match TFLite Micro byte for byte over four consecutive runs, untiled and at the 256-byte budget. TFLite's float reference kernels compute in a different order, so these goldens are recorded from TFLite Micro.
  • A float LOGISTIC case with inputs in [-24, 24] covers TFLite's cutoffs; the runtime before this change mismatched 11 of 64 outputs.
  • Contract case: float LSTM against ONNX's own LSTM operator in ONNX Runtime.

Needs the runtime branch of the same name.

@asteinh
asteinh merged commit c4f824e into develop Oct 5, 2026
15 checks passed
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