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

Move CUDA support to CUDAExt #86

Merged
merged 3 commits into from
Jul 19, 2023
Merged

Move CUDA support to CUDAExt #86

merged 3 commits into from
Jul 19, 2023

Conversation

IanButterworth
Copy link
Collaborator

@IanButterworth IanButterworth commented Jul 14, 2023

Flux v0.14 makes CUDA.jl etc. support weak

This requires work to remove the CUDA array initialization in here.

@IanButterworth IanButterworth marked this pull request as draft July 14, 2023 13:36
@IanButterworth IanButterworth changed the title Add Flux 0.14 Move CUDA support to CUDAExt Jul 17, 2023
@IanButterworth IanButterworth force-pushed the ib/flux_up branch 3 times, most recently from 10eff01 to 7e2a0fa Compare July 17, 2023 19:21
@IanButterworth
Copy link
Collaborator Author

This is introducing an error and it's not clear why

     Testing Running tests...
┌ Info: The CUDA functionality is being called but
│ `CUDA.jl` must be loaded to access it.
└ Add `using CUDA` or `import CUDA` to your code.
prepareImage() input varieties: Error During Test at /Users/ian/Documents/GitHub/ObjectDetector.jl/test/prepareImage.jl:1
  Got exception outside of a @test
  MethodError: objects of type Nothing are not callable
  Stacktrace:
    [1] macro expansion
      @ Flux ~/.julia/packages/Flux/mqBbi/src/layers/basic.jl:53 [inlined]
    [2] _applychain(layers::Tuple{Nothing, Nothing, ObjectDetector.YOLO.var"#_act#16"}, x::Nothing)
      @ Flux ~/.julia/packages/Flux/mqBbi/src/layers/basic.jl:53
    [3] (::Flux.Chain{Tuple{Nothing, Nothing, ObjectDetector.YOLO.var"#_act#16"}})(x::Nothing)
      @ Flux ~/.julia/packages/Flux/mqBbi/src/layers/basic.jl:51
    [4] macro expansion
      @ Flux ~/.julia/packages/Flux/mqBbi/src/layers/basic.jl:53 [inlined]
    [5] _applychain(layers::Tuple{Flux.Chain{Tuple{Nothing, Nothing, ObjectDetector.YOLO.var"#_act#16"}}, ObjectDetector.YOLO.var"#_maxpool#19"{Int64}, Flux.Chain{Tuple{Nothing, Nothing, ObjectDetector.YOLO.var"#_act#16"}}, ObjectDetector.YOLO.var"#_maxpool#19"{Int64}, Flux.Chain{Tuple{Nothing, Nothing, ObjectDetector.YOLO.var"#_act#16"}}, ObjectDetector.YOLO.var"#_maxpool#19"{Int64}, Flux.Chain{Tuple{Nothing, Nothing, ObjectDetector.YOLO.var"#_act#16"}}, ObjectDetector.YOLO.var"#_maxpool#19"{Int64}, Flux.Chain{Tuple{Nothing, Nothing, ObjectDetector.YOLO.var"#_act#16"}}}, x::Nothing)
      @ Flux ~/.julia/packages/Flux/mqBbi/src/layers/basic.jl:53
    [6] (::Flux.Chain{Tuple{Flux.Chain{Tuple{Nothing, Nothing, ObjectDetector.YOLO.var"#_act#16"}}, ObjectDetector.YOLO.var"#_maxpool#19"{Int64}, Flux.Chain{Tuple{Nothing, Nothing, ObjectDetector.YOLO.var"#_act#16"}}, ObjectDetector.YOLO.var"#_maxpool#19"{Int64}, Flux.Chain{Tuple{Nothing, Nothing, ObjectDetector.YOLO.var"#_act#16"}}, ObjectDetector.YOLO.var"#_maxpool#19"{Int64}, Flux.Chain{Tuple{Nothing, Nothing, ObjectDetector.YOLO.var"#_act#16"}}, ObjectDetector.YOLO.var"#_maxpool#19"{Int64}, Flux.Chain{Tuple{Nothing, Nothing, ObjectDetector.YOLO.var"#_act#16"}}}})(x::Nothing)
      @ Flux ~/.julia/packages/Flux/mqBbi/src/layers/basic.jl:51
    [7] ObjectDetector.YOLO.yolo(cfgfile::String, weightfile::String, batchsize::Int64; silent::Bool, cfgchanges::Vector{Tuple{Symbol, Int64, Symbol, Int64}}, use_gpu::Bool)
      @ ObjectDetector.YOLO ~/Documents/GitHub/ObjectDetector.jl/src/yolo/yolo.jl:341
    [8] v3_tiny_COCO(; batch::Int64, silent::Bool, w::Int64, h::Int64, cfgchanges::Vector{Tuple{Symbol, Int64, Symbol, Int64}}, kwargs::@Kwargs{})
      @ ObjectDetector.YOLO ~/Documents/GitHub/ObjectDetector.jl/src/yolo/pretrained.jl:31 [inlined]
    [9] macro expansion
      @ ~/Documents/GitHub/ObjectDetector.jl/test/prepareImage.jl:2 [inlined]
   [10] macro expansion
      @ ~/Documents/GitHub/julia/usr/share/julia/stdlib/v1.11/Test/src/Test.jl:1577 [inlined]
   [11] top-level scope
      @ ~/Documents/GitHub/ObjectDetector.jl/test/prepareImage.jl:2
   [12] include(fname::String)
      @ Base.MainInclude ./client.jl:489
   [13] top-level scope
      @ ~/Documents/GitHub/ObjectDetector.jl/test/runtests.jl:7
   [14] include(fname::String)
      @ Base.MainInclude ./client.jl:489
   [15] top-level scope
      @ none:6
   [16] eval(m::Module, e::Expr)
      @ Core ./boot.jl:383 [inlined]
   [17] exec_options(opts::Base.JLOptions)
      @ Base ./client.jl:291
   [18] _start()
      @ Base ./client.jl:552
Test Summary:                  | Error  Total  Time
prepareImage() input varieties |     1      1  1.1s
ERROR: LoadError: Some tests did not pass: 0 passed, 0 failed, 1 errored, 0 broken.
in expression starting at /Users/ian/Documents/GitHub/ObjectDetector.jl/test/prepareImage.jl:1
in expression starting at /Users/ian/Documents/GitHub/ObjectDetector.jl/test/runtests.jl:7
ERROR: Package ObjectDetector errored during testing

@IanButterworth IanButterworth marked this pull request as ready for review July 17, 2023 19:39
@IanButterworth
Copy link
Collaborator Author

This works locally with FluxML/Flux.jl#2295

@IanButterworth IanButterworth merged commit ac32125 into master Jul 19, 2023
9 checks passed
@IanButterworth IanButterworth deleted the ib/flux_up branch July 19, 2023 19:31
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.

None yet

1 participant