ericphanson / allocarrays.jl Goto Github PK
View Code? Open in Web Editor NEWArrays that use a dynamically-scoped allocator
Home Page: https://ericphanson.github.io/AllocArrays.jl/
License: MIT License
Arrays that use a dynamically-scoped allocator
Home Page: https://ericphanson.github.io/AllocArrays.jl/
License: MIT License
We could include a mutable field in each AllocArray tracking whether it is active, and a vector in the bumper allocator object collecting all of the allocated arrays. Then when we reset the bump, we loop through and mark each array as inactive (which would cause eg getindex to error if called on it), and empty the list.
I think this would prevent “use after free” errors pretty comprehensively (in the serial case), possibly at the cost of some performance. It could be done as secondary types though, allowing debugging/testing with the safe version, then switching to the unchecked one for speed.
For concurrency safety, maybe some mechanism could be used for the resetting function to get exclusive access to each of the arrays in order to flip their activity bits. Eg if each array holds a lock? Or something where operations on the array don’t contest each other, but do contest with the resetter. Then we could empty the buffer once every array has been toggled inactive.
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
Hi,
It's an intriguing approach. I see you take over similar, basically "malloc" for Julia... and you reduce allocations, but the timing is still worse. Is that maybe not in general, since that's the whole point?
I like Bumper, since there are no allocations, basically, so I'm confused why you have any at all? Probably for the output array.
Taking over similar seems clever, should it ideally be done too for zeros, ones (and fill?) or does it in fact happen implicitly? I'm thinking though, should it happen in all cases, and what you do is I think so-called type-piracy, so it's all or nothing?
I suppose this does not work for GPUs despite me seeing something Flux related. And neither Bumper.jl... but do you think it would be plausible?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.