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

Improve performance of Encoder's na_forward method #364

Merged
merged 3 commits into from
Feb 27, 2024
Merged

Conversation

DamianSzwichtenberg
Copy link
Member

This PR introduces small improvements that resulted in an average 1.5x speedup in na_forward execution time.
get_na_mask is a heavy operation, whose result may be cached at the pre-condition checking step.
Additionally, when we deal with 2D feat, we can use torch.where to efficiently fill NaNs across all columns.

Copy link

codecov bot commented Feb 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.59%. Comparing base (2d166c6) to head (769e0f9).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #364   +/-   ##
=======================================
  Coverage   93.59%   93.59%           
=======================================
  Files         119      119           
  Lines        6275     6280    +5     
=======================================
+ Hits         5873     5878    +5     
  Misses        402      402           

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

Copy link
Contributor

@weihua916 weihua916 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

torch_frame/nn/encoder/stype_encoder.py Show resolved Hide resolved
@weihua916 weihua916 merged commit d3d09ea into master Feb 27, 2024
14 checks passed
@weihua916 weihua916 deleted the na-fwd-impr branch February 27, 2024 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants