Skip to content

Conversation

ExpandingMan
Copy link
Contributor

This adds the missing mul! methods that break the initial (minimal) example in #55. The * method now falls back to this instead of having a separate definition with mutating NNlib.scatter.

It is undoubtedly inefficient to make a separate call to fill! before executing the NNlib kernel, but I have verified that NNlib already does this, so this shouldn't be any different than using scatter.

PR Checklist

  • Tests are added
  • Documentation, if applicable

Copy link
Member

@mcabbott mcabbott left a comment

Choose a reason for hiding this comment

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

Thanks!

I think some tests on GPU are in order, as the ones here pass before the PR. (Which is still good, to check that it doesn't break things which worked.)

Also tests for various ways to provide the wrong-sized arrays to this method. (IIRC NNlib.scatter! might be @inbounds.)

Copy link

codecov bot commented May 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.18%. Comparing base (0ea288d) to head (f22da3d).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #56      +/-   ##
==========================================
- Coverage   96.26%   95.18%   -1.09%     
==========================================
  Files           3        3              
  Lines         134      166      +32     
==========================================
+ Hits          129      158      +29     
- Misses          5        8       +3     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@mcabbott mcabbott left a comment

Choose a reason for hiding this comment

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

Let's do it.

@mcabbott mcabbott merged commit f563f48 into FluxML:main May 6, 2025
9 of 13 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.

2 participants