Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tensorflow): Choose NumPy API in forward pass #265

Closed
wants to merge 1 commit into from
Closed

Conversation

Kolarovszki
Copy link
Collaborator

tf.function requires Piquasso to use Tensorflow's NumPy API in the forward pass. By default, we use regular NumPy for performance reasons, but this patch enables users to run Piquasso inside tf.function, which might be faster with JIT compilation enabled.

Unfortunately, the JIT compilation is still very slow, and we may need to reduce the number of Python control flows during the calculation.

@Kolarovszki Kolarovszki force-pushed the kz-wip branch 2 times, most recently from 15e667f to c50b540 Compare February 14, 2024 12:39
Copy link

codecov bot commented Feb 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (055a7fe) 95.53% compared to head (7345a26) 95.43%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #265      +/-   ##
==========================================
- Coverage   95.53%   95.43%   -0.11%     
==========================================
  Files          59       59              
  Lines        3246     3283      +37     
==========================================
+ Hits         3101     3133      +32     
- Misses        145      150       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

`tf.function` requires Piquasso to use Tensorflow's NumPy API in the forward
pass. By default, we use regular NumPy for performance reasons, but this patch
enables users to run Piquasso inside `tf.function`, which might be faster with
JIT compilation enabled.

Unfortunately, the JIT compilation is still very slow, and we may need to
reduce the number of Python control flows during the calculation.
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