Skip to content

Conversation

@chaya2350
Copy link

This PR fixes Issue #27224 where LSTM cell state (Ct) was not being clipped before applying the h() activation function, which violates the ONNX specification.

Changes

  1. Modified the LSTM forward pass to clip Ct before applying the h() activation function
  2. Fixed SEGFAULT caused by using clip_with_bias_ptr_ with nullptr bias by switching to clip_ignore_bias for Ct clipping

Testing

  • All 10 test suites pass (100%)
  • Specifically verified DynamicQuantLSTMTest.SmallSize which was failing with SEGFAULT before the fix

Related Issue

Fixes #27224

- Add clipping of Ct before applying h activation function
- Complies with ONNX spec requirement for clipping input of activations
- Equation: Ht = ot (.) h(clip(Ct)) instead of Ht = ot (.) h(Ct)
@chaya2350
Copy link
Author

@bac-cab Could you please review this PR? It fixes the issue you reported. Thanks! 🙂

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.

No clipping before activation in LSTM

1 participant