-
Notifications
You must be signed in to change notification settings - Fork 17
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
zip
triggers lots of invalidations
#175
Comments
Ugh damn. We have a plan to fix zip in a more fundamental way but it will be a while off. Is there anything specific about our definition that is leading to invalidations? (Generators are also not great it seems) |
It kind of looks like https://github.com/meggart/DiskArrays.jl/blob/64f4de86ec3ab921759d7372c19766a463c58e61/src/zip.jl#L83 is just clashing with https://github.com/meggart/DiskArrays.jl/blob/64f4de86ec3ab921759d7372c19766a463c58e61/src/zip.jl#L70. Shouldn't you just be able to delete https://github.com/meggart/DiskArrays.jl/blob/64f4de86ec3ab921759d7372c19766a463c58e61/src/zip.jl#L83? |
It would be good to remove those, but NCDatasets.jl uses the macros to avoid inheriting We (myself and @meggart) would very much like to remove those macros from the package but @Alexander-Barth may not. |
Maybe this is a question for @Alexander-Barth, but why would a type that doesn't subtype |
DiskArrays provides a macro system to implement everything without explicit inheritance - the idea was that some packages wouldn't use the interface otherwise.
That causes a lot of issues, like this one. I'm hoping over time we can identify the reasons There is some discussion here: |
I would not be opposed to remove the zip macro, but I am not sure to what extent changes are necessary on the CommonDataModel/NCDatasets side. As we have seen Zarr and NetCDF require sometimes different trade-offs. Some dataset are also entirely in memory or "virtual" (in the sense that values are computed based on indices, such as longitude/latitude arrays based on the projection). As long as I would be able to provide more specific routines (without ambiguities) in case when an alternative implementations is more performant, then I can also subtype directly from |
You can always provide more specific methods than What is required is a DiskArrays dependency in CommonDataModel.jl and defining
Then you can delete the macros wherever they are applied. (This will mean broadcasts, reductions and other nice things that are currently broken will work for CFDiskArray) |
xref: CliMA/ClimaCore.jl#1812 |
Hi @rafaqz, I was looking back at this, and I'm wondering if we can at least alleviate the invalidations by making |
Ok yes that's no problem at all. Feel free to PR |
Ok, thanks, I'll give this a try |
We have a workload over at ClimaAtmos.jl, where we use SnoopCompile's invalidations script, and the result is:
So, DiskArrays'
zip
seems to invalidate 9741 methods.The text was updated successfully, but these errors were encountered: