Skip to content

Conversation

@Ray0907
Copy link

@Ray0907 Ray0907 commented Jan 13, 2026


Summary

  • Fix thread safety issue in fast_tanh toggle by using std::atomic instead of modifying shared state
  • Remove mutable global _activations map modification that could cause data races

Test plan

  • Verify fast_tanh enable/disable works correctly in single-threaded context
  • Test concurrent access from multiple threads toggling fast_tanh
  • Confirm no performance regression with atomic load in hot path

  Use atomic<bool> and runtime check instead of modifying shared map.
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