Skip to content

Conversation

@wsmoses
Copy link
Member

@wsmoses wsmoses commented Feb 6, 2025

Resolves #696

@wsmoses wsmoses requested a review from giordano February 6, 2025 15:07
src/Tracing.jl Outdated
end
end

@eval Base.@nospecializeinfer function traced_type_inner(
Copy link
Member

Choose a reason for hiding this comment

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

No need for @eval here, right?

src/Tracing.jl Outdated
end

@eval Base.@nospecializeinfer function traced_type_inner(
@nospecialize(PT::Type{Core.LLVMPtr{T, A}})
Copy link
Member

Choose a reason for hiding this comment

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

Also, I'm not sure this would work, I had tried doing something like this and just using T in the body of the function instead of PT.parameters[1], but it doesn't work (I supposed because this is a @nospecialize argument)

Copy link
Member Author

Choose a reason for hiding this comment

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

no the reason T in the function doesn't work is due to JuliaLang/julia#57259 sadly.

Essentially we have LLVMPtr{TypeVar, TypeVar} and julia doesn't properly match that (see the issue)

@giordano
Copy link
Member

giordano commented Feb 6, 2025

Uhm https://github.com/EnzymeAD/Reactant.jl/actions/runs/13182934372/job/36798051681?pr=698#step:9:581

Ptr{Float64}: Error During Test at /home/runner/work/Reactant.jl/Reactant.jl/test/tracing.jl:22
  Got exception outside of a @test
  type DataType has no field body
  Stacktrace:
    [1] getproperty
      @ ./Base.jl:32 [inlined]
    [2] traced_type_inner(PT::Type{Ptr{Float64}}, seen::Dict{Type, Type}, mode::Reactant.TraceMode, track_numbers::Type)
      @ Reactant ~/work/Reactant.jl/Reactant.jl/src/Tracing.jl:382
    [3] traced_type(T::Type, ::Val{Reactant.ConcreteToTraced}, track_numbers::Type)
      @ Reactant ~/work/Reactant.jl/Reactant.jl/src/Tracing.jl:642
    [4] macro expansion
      @ ~/work/Reactant.jl/Reactant.jl/test/tracing.jl:193 [inlined]
    [5] macro expansion
      @ /opt/hostedtoolcache/julia/1.10.8/x64/share/julia/stdlib/v1.10/Test/src/Test.jl:1669 [inlined]
    [6] macro expansion
      @ ~/work/Reactant.jl/Reactant.jl/test/tracing.jl:22 [inlined]
    [7] macro expansion
      @ /opt/hostedtoolcache/julia/1.10.8/x64/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
    [8] macro expansion
      @ ~/work/Reactant.jl/Reactant.jl/test/tracing.jl:22 [inlined]
    [9] macro expansion
      @ /opt/hostedtoolcache/julia/1.10.8/x64/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
   [10] macro expansion
      @ ~/work/Reactant.jl/Reactant.jl/test/tracing.jl:21 [inlined]
   [...]

Ptr{ConcreteRArray{Float64, 1}}: Error During Test at /home/runner/work/Reactant.jl/Reactant.jl/test/tracing.jl:22
  Got exception outside of a @test
  type DataType has no field body
  Stacktrace:
    [1] getproperty
      @ ./Base.jl:32 [inlined]
    [2] traced_type_inner(PT::Type{Ptr{ConcreteRArray{Float64, 1}}}, seen::Dict{Type, Type}, mode::Reactant.TraceMode, track_numbers::Type)
      @ Reactant ~/work/Reactant.jl/Reactant.jl/src/Tracing.jl:382
    [3] traced_type(T::Type, ::Val{Reactant.ConcreteToTraced}, track_numbers::Type)
      @ Reactant ~/work/Reactant.jl/Reactant.jl/src/Tracing.jl:642
    [4] macro expansion
      @ ~/work/Reactant.jl/Reactant.jl/test/tracing.jl:193 [inlined]
    [5] macro expansion
      @ /opt/hostedtoolcache/julia/1.10.8/x64/share/julia/stdlib/v1.10/Test/src/Test.jl:1669 [inlined]
    [6] macro expansion
      @ ~/work/Reactant.jl/Reactant.jl/test/tracing.jl:22 [inlined]
    [7] macro expansion
      @ /opt/hostedtoolcache/julia/1.10.8/x64/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
    [8] macro expansion
      @ ~/work/Reactant.jl/Reactant.jl/test/tracing.jl:22 [inlined]
    [9] macro expansion
      @ /opt/hostedtoolcache/julia/1.10.8/x64/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
   [10] macro expansion
      @ ~/work/Reactant.jl/Reactant.jl/test/tracing.jl:21 [inlined]
   [...]

Base.RefValue{Float64}: Error During Test at /home/runner/work/Reactant.jl/Reactant.jl/test/tracing.jl:22
  Got exception outside of a @test
  type DataType has no field body
  Stacktrace:
    [1] getproperty
      @ ./Base.jl:32 [inlined]
    [2] traced_type_inner(PT::Type{Base.RefValue{Float64}}, seen::Dict{Type, Type}, mode::Reactant.TraceMode, track_numbers::Type)
      @ Reactant ~/work/Reactant.jl/Reactant.jl/src/Tracing.jl:382
    [3] traced_type(T::Type, ::Val{Reactant.ConcreteToTraced}, track_numbers::Type)
      @ Reactant ~/work/Reactant.jl/Reactant.jl/src/Tracing.jl:642
    [4] macro expansion
      @ ~/work/Reactant.jl/Reactant.jl/test/tracing.jl:193 [inlined]
    [5] macro expansion
      @ /opt/hostedtoolcache/julia/1.10.8/x64/share/julia/stdlib/v1.10/Test/src/Test.jl:1669 [inlined]
    [6] macro expansion
      @ ~/work/Reactant.jl/Reactant.jl/test/tracing.jl:22 [inlined]
    [7] macro expansion
      @ /opt/hostedtoolcache/julia/1.10.8/x64/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
    [8] macro expansion
      @ ~/work/Reactant.jl/Reactant.jl/test/tracing.jl:22 [inlined]
    [9] macro expansion
      @ /opt/hostedtoolcache/julia/1.10.8/x64/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
   [10] macro expansion
      @ ~/work/Reactant.jl/Reactant.jl/test/tracing.jl:21 [inlined]
   [...]

Base.RefValue{ConcreteRArray{Float64, 1}}: Error During Test at /home/runner/work/Reactant.jl/Reactant.jl/test/tracing.jl:22
  Got exception outside of a @test
  type DataType has no field body
  Stacktrace:
    [1] getproperty
      @ ./Base.jl:32 [inlined]
    [2] traced_type_inner(PT::Type{Base.RefValue{ConcreteRArray{Float64, 1}}}, seen::Dict{Type, Type}, mode::Reactant.TraceMode, track_numbers::Type)
      @ Reactant ~/work/Reactant.jl/Reactant.jl/src/Tracing.jl:382
    [3] traced_type(T::Type, ::Val{Reactant.ConcreteToTraced}, track_numbers::Type)
      @ Reactant ~/work/Reactant.jl/Reactant.jl/src/Tracing.jl:642
    [4] macro expansion
      @ ~/work/Reactant.jl/Reactant.jl/test/tracing.jl:193 [inlined]
    [5] macro expansion
      @ /opt/hostedtoolcache/julia/1.10.8/x64/share/julia/stdlib/v1.10/Test/src/Test.jl:1669 [inlined]
    [6] macro expansion
      @ ~/work/Reactant.jl/Reactant.jl/test/tracing.jl:22 [inlined]
    [7] macro expansion
      @ /opt/hostedtoolcache/julia/1.10.8/x64/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
    [8] macro expansion
      @ ~/work/Reactant.jl/Reactant.jl/test/tracing.jl:22 [inlined]
    [9] macro expansion
      @ /opt/hostedtoolcache/julia/1.10.8/x64/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
   [10] macro expansion
      @ ~/work/Reactant.jl/Reactant.jl/test/tracing.jl:21 [inlined]
   [...]

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@wsmoses wsmoses merged commit af24aa8 into main Feb 6, 2025
33 of 39 checks passed
@wsmoses wsmoses deleted the rptr branch February 6, 2025 17:21
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.

Integration with SpeedyWeather.jl

2 participants