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

Removing deprecated method call in GPU_BACKEND_ORDER. #2314

Merged
merged 1 commit into from
Aug 20, 2023

Conversation

codetalker7
Copy link
Contributor

Closes #2312.

Copy link
Member

@ToucheSir ToucheSir left a comment

Choose a reason for hiding this comment

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

Nice, this is cleaner than my ideas!

@ToucheSir ToucheSir merged commit 656175d into FluxML:master Aug 20, 2023
5 of 7 checks passed
@prbzrg
Copy link
Contributor

prbzrg commented Aug 26, 2023

This isn't same as before, it should be OrderedDict from OrderedCollections.

julia> const GPU_BACKENDS = ["CUDA", "AMD", "Metal", "CPU"]
4-element Vector{String}:
 "CUDA"
 "AMD"
 "Metal"
 "CPU"

julia> const GPU_BACKEND_ORDER = Dict(collect(zip(GPU_BACKENDS, 1:length(GPU_BACKENDS))))
Dict{String, Int64} with 4 entries:
  "CUDA"  => 1
  "AMD"   => 2
  "CPU"   => 4
  "Metal" => 3

julia> const GPU_BACKEND_ORDER2 = OrderedDict(collect(zip(GPU_BACKENDS, 1:length(GPU_BACKENDS))))
OrderedDict{String, Int64} with 4 entries:
  "CUDA"  => 1
  "AMD"   => 2
  "Metal" => 3
  "CPU"   => 4

@prbzrg
Copy link
Contributor

prbzrg commented Aug 26, 2023

on [email protected]:

julia> Flux.GPU_BACKEND_ORDER
OrderedDict{String, Int64} with 4 entries:
  "CUDA"  => 1
  "AMD"   => 2
  "Metal" => 3
  "CPU"   => 4

@ToucheSir
Copy link
Member

GPU_BACKEND_ORDER isn't a part of the public API, nor is its iteration order defined. We're not going to add a package dependency just for this.

@prbzrg
Copy link
Contributor

prbzrg commented Aug 26, 2023

Oh, I was under the impression that the order of it matters because there was a sort that caused the deprecation warning.

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.

Warning: sort(d::Dict; args...) is deprecated, use sort!(OrderedDict(d); args...) instead.
3 participants