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

_copy_temp() to replace Base.copy() usage. #529

Open
wants to merge 46 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
499064f
_copy_temp() to replace Base.copy()
AstitvaAggarwal Mar 21, 2025
b197109
function declaration after _BuiltinArrays const.
AstitvaAggarwal Mar 21, 2025
24d4ffe
additional tests, more method dispatches
AstitvaAggarwal Mar 21, 2025
2eafc8f
Faster, better, stronger
AstitvaAggarwal Mar 22, 2025
70afdbc
tests
AstitvaAggarwal Mar 22, 2025
1378553
minor fix
AstitvaAggarwal Mar 22, 2025
8d7ee73
Arrays case
AstitvaAggarwal Mar 22, 2025
57228de
closer performance to Base.copy()
AstitvaAggarwal Mar 22, 2025
89cb6ec
mutable composite types
AstitvaAggarwal Mar 23, 2025
d9fbde2
mutable composite types
AstitvaAggarwal Mar 23, 2025
b42d3d5
reduced allocations to copy call, improved testing
AstitvaAggarwal Mar 23, 2025
622c394
format
AstitvaAggarwal Mar 23, 2025
078c9d7
tests.
AstitvaAggarwal Mar 23, 2025
c4abc6f
why does CI fail?
AstitvaAggarwal Mar 23, 2025
97137cf
use ccall with _BuiltinArrays copy logic
AstitvaAggarwal Mar 23, 2025
ddc9461
using Base.deepcopy() handling of structs
AstitvaAggarwal Mar 23, 2025
3638492
format
AstitvaAggarwal Mar 23, 2025
1d59810
modify tests
AstitvaAggarwal Mar 23, 2025
f0bc196
modify testing
AstitvaAggarwal Mar 23, 2025
144d2f4
nfields zero case
AstitvaAggarwal Mar 23, 2025
a940fb9
see why CI is failing
AstitvaAggarwal Mar 23, 2025
711fb47
test why CI fails
AstitvaAggarwal Mar 23, 2025
444aa8c
.
AstitvaAggarwal Mar 23, 2025
eca35a0
testing over closures
AstitvaAggarwal Mar 23, 2025
134691c
NaN handling
AstitvaAggarwal Mar 23, 2025
502ea8d
NaN Handling
AstitvaAggarwal Mar 23, 2025
c4487ed
See why CI fails
AstitvaAggarwal Mar 24, 2025
2a968ec
Unitialized mutable structs...
AstitvaAggarwal Mar 24, 2025
02a5809
fix tests
AstitvaAggarwal Mar 24, 2025
724d841
nospecialize
AstitvaAggarwal Mar 24, 2025
3b70634
type dispatch over uninitialized Float64, Int64
AstitvaAggarwal Mar 24, 2025
8dfe0e6
Update interface.jl
AstitvaAggarwal Mar 24, 2025
c5809ff
Update interface.jl
AstitvaAggarwal Mar 24, 2025
6cae723
Update interface.jl
AstitvaAggarwal Mar 25, 2025
b796192
check CI failures
AstitvaAggarwal Mar 25, 2025
ee58a00
.
AstitvaAggarwal Mar 25, 2025
0321bda
.
AstitvaAggarwal Mar 25, 2025
1c863c9
Attention to detail!
AstitvaAggarwal Mar 25, 2025
c950e03
Prediciton : it passes all tests.
AstitvaAggarwal Mar 25, 2025
0a3fd0e
remove call from value_and_pullback!!
AstitvaAggarwal Mar 25, 2025
e2d1789
remove usage completely for once
AstitvaAggarwal Mar 25, 2025
ffddc96
Merge branch 'main' into develop
AstitvaAggarwal Mar 25, 2025
307509f
_copy_temp for value_and_pullback!! & prepare_pullback_cache
AstitvaAggarwal Mar 26, 2025
c4ce5c0
Merge branch 'develop' of https://github.com/AstitvaAggarwal/Mooncake…
AstitvaAggarwal Mar 26, 2025
0eb390d
Merge branch 'main' into develop
AstitvaAggarwal Mar 28, 2025
d6e9f94
Merge branch 'main' into develop
yebai Mar 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove call from value_and_pullback!!
AstitvaAggarwal committed Mar 25, 2025
commit 0a3fd0ea8db1af9b0a2dd20adbd17135652a3f80
2 changes: 1 addition & 1 deletion src/interface.jl
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ function __value_and_pullback!!(
out, pb!! = rule(fx_fwds...)
@assert _typeof(tangent(out)) == fdata_type(T)
increment!!(tangent(out), fdata(ȳ))
v = y_cache === nothing ? _copy_temp(primal(out)) : _copy!!(y_cache, primal(out))
v = y_cache === nothing ? copy(primal(out)) : _copy!!(y_cache, primal(out))
return v, tuple_map((f, r) -> tangent(fdata(tangent(f)), r), fx, pb!!(rdata(ȳ)))
end