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

[WIP/DNM]make similar produce the right chunktype #175

Open
wants to merge 38 commits into
base: master
Choose a base branch
from

Conversation

vchuravy
Copy link
Member

Defaulting to Array breaks a mat * vec of DArray{CuArray}

@raminammour
Copy link
Contributor

Could you please fix similar to give the right distribution while you are at it :)

This doesn't work:


julia> dd=drand((10,10),workers(),[2,1]);

julia> ds=similar(dd);

julia> ds.indices
1x2 Array{Tuple{UnitRange{Int64},UnitRange{Int64}},2}:
 (1:10, 1:5)  (1:10, 6:10)

julia> dd.indices
2x1 Array{Tuple{UnitRange{Int64},UnitRange{Int64}},2}:
 (1:5, 1:10)
 (6:10, 1:10)

Which breaks copy, and may other constructs.

Thank you!

@vchuravy vchuravy added this to the v0.6 milestone Oct 1, 2018
src/darray.jl Outdated
@@ -240,17 +240,24 @@ end
# new DArray similar to an existing one
DArray(init, d::DArray) = DArray(next_did(), init, size(d), procs(d), d.indices, d.cuts)

Base.size(d::DArray) = d.dims
chunktype(d::DArray{<:Any,<:Any,A}) where A = A
arraykind(::Type{<:Array}) = Array
Copy link
Member Author

Choose a reason for hiding this comment

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

@r-barnes if we add arraykind(::Type{T}) where T >: Array = Array the promote_type idea in #180 (comment) might just work. I won't have time until mid-October to look at that in earnest though so please go ahead and experiment.

@vchuravy vchuravy changed the title make similar produce the right chunktype [WIP/DNM]make similar produce the right chunktype Oct 6, 2018
@vchuravy
Copy link
Member Author

This has become a pile of various changes I needed for a project, I will separate them out as well as cleaning them up.

@vchuravy vchuravy modified the milestones: v0.6, v0.7 Jan 1, 2019
@vchuravy vchuravy mentioned this pull request Aug 3, 2019
@ViralBShah
Copy link
Member

Closing because its old.

@ViralBShah ViralBShah closed this May 19, 2020
@vchuravy vchuravy reopened this May 20, 2020
@vchuravy
Copy link
Member Author

Not that old :) and I would keep it open as a reminder to myself that this work needs to get cleaned up and finished or migrated over to Dagger.

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