Skip to content

rm UnsafeArrays, use previous way#20

Merged
ericphanson merged 1 commit intomainfrom
eph/partial-revert
Mar 19, 2025
Merged

rm UnsafeArrays, use previous way#20
ericphanson merged 1 commit intomainfrom
eph/partial-revert

Conversation

@ericphanson
Copy link
Owner

this reverts the UnsafeArray related changes in #18 since they introduce memory safety issues. They are also not needed! I get equally good results with this PR for r3tex/ObjectDetector.jl#101:

forward pass: 0.907787 seconds (4.30 k allocations: 6.263 GiB, 5.95% gc time)
yolomod(batch, detectThresh = 0.5, overlapThresh = 0.8): 0.961214 seconds (47.01 k allocations: 6.298 GiB, 5.62% gc time, 2.79% compilation time)
forward pass: 1.293893 seconds (4.30 k allocations: 6.263 GiB, 21.28% gc time)
yolomod(batch, detectThresh = 0.5, overlapThresh = 0.8): 1.320383 seconds (6.89 k allocations: 6.295 GiB, 20.86% gc time)
forward pass: 0.924500 seconds (4.30 k allocations: 6.263 GiB, 4.77% gc time)
yolomod(batch, detectThresh = 0.5, overlapThresh = 0.8): 0.949379 seconds (6.89 k allocations: 6.295 GiB, 4.64% gc time)

forward pass: 1.132717 seconds (6.62 k allocations: 12.082 MiB)
bumper_yolomod(b, batch_aa; detectThresh = 0.5, overlapThresh = 0.8): 1.181193 seconds (26.75 k allocations: 13.084 MiB, 1.14% compilation time)
forward pass: 1.130855 seconds (6.62 k allocations: 12.082 MiB)
bumper_yolomod(b, batch_aa; detectThresh = 0.5, overlapThresh = 0.8): 1.167223 seconds (9.09 k allocations: 12.159 MiB)
forward pass: 0.787238 seconds (6.62 k allocations: 12.082 MiB)
bumper_yolomod(b, batch_aa; detectThresh = 0.5, overlapThresh = 0.8): 0.822033 seconds (9.09 k allocations: 12.159 MiB)

I think the vectorization thing was a red herring. Maybe the important bit is the no-op constructors to prevent nesting, which are retained here.

@ericphanson
Copy link
Owner Author

I wish I hadn't registered #18 but I did, so I guess I will make this another breaking release

@ericphanson ericphanson merged commit f00de68 into main Mar 19, 2025
6 of 8 checks passed
@ericphanson ericphanson deleted the eph/partial-revert branch March 19, 2025 01:04
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