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

bipass all Diffractor machinery if there are no partials #173

Merged
merged 1 commit into from
Jun 28, 2023

Conversation

oxinabox
Copy link
Member

@oxinabox oxinabox commented Jun 28, 2023

🎵 I mean, what have you got to lose?
You know, you come from nothing
You're going back to nothing
What have you lost? Nothing
Nothing will come from nothing, ya know what they say 🎵

Related to the recent work by @Keno and @staticfloat.

By the linearity of the derivative operation if the inputs are all zero so is the output.
A case can be made that we actually should be still invoking the frules for this path.
But I am not sure that's a good argument.
Here the derivative isn't just iszero it has been put into the types it is zero and can't ever not be zero.
(This would not for example be the case if it were being mutated)

@codecov
Copy link

codecov bot commented Jun 28, 2023

Codecov Report

Patch coverage: 50.00% and project coverage change: -0.04 ⚠️

Comparison is base (da2c0bb) 22.99% compared to head (ea2744d) 22.96%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #173      +/-   ##
==========================================
- Coverage   22.99%   22.96%   -0.04%     
==========================================
  Files          27       27              
  Lines        2666     2674       +8     
==========================================
+ Hits          613      614       +1     
- Misses       2053     2060       +7     
Impacted Files Coverage Δ
src/stage1/forward.jl 62.42% <50.00%> (-0.64%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Comment on lines +146 to +150
function (::∂☆internal{1})(f::AbstractZeroBundle{1}, args::AbstractZeroBundle{1}...)
f_v = primal(f)
args_v = map(primal, args)
return ZeroBundle{1}(f_v(args_v...))
end
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do you have a special case for order 1?

Copy link
Member Author

Choose a reason for hiding this comment

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

Break method ambiguity

@staticfloat
Copy link
Collaborator

I think this makes sense, so I'm just going to merge it.

@staticfloat staticfloat merged commit 096f918 into main Jun 28, 2023
@oscardssmith oscardssmith deleted the ox/nothing_will_come_from_nothing branch June 28, 2023 20:28
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.

3 participants