Skip to content
This repository has been archived by the owner on Sep 27, 2021. It is now read-only.

Assertion error for broadcasts #5

Closed
ChrisRackauckas opened this issue Oct 17, 2017 · 1 comment · Fixed by JuliaGPU/GPUArrays.jl#81
Closed

Assertion error for broadcasts #5

ChrisRackauckas opened this issue Oct 17, 2017 · 1 comment · Fixed by JuliaGPU/GPUArrays.jl#81

Comments

@ChrisRackauckas
Copy link
Member

ChrisRackauckas commented Oct 17, 2017

N = 10
A = zeros(N,N); gA = CLArray(A)
utilde = copy(gA)
k1 = copy(gA); k2 = copy(gA); k3 = copy(gA); k4 = copy(gA)
const dt = 1.0
const btilde1 = 1.0
const btilde2 = 1.0
const btilde3 = 1.0
const btilde4 = 1.0
@. utilde = dt*(btilde1*k1 + btilde2*k2 + btilde3*k3 + btilde4*k4)

throws out:

___________________________________________________________________
Error in Expr rewrite! AssertionError("Found non concrete return type: Any")

Expression resulting in the error: 
(GPUArrays.apply_broadcast)(ilin::UInt32, state::CLArrays.KernelState, func::##69#70, shape::Tuple{UInt32,UInt32}, len::UInt32, descriptor::Tuple{GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Array,2},GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Array,2},GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Array,2},GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Array,2}}, A_1::Float64, A_2::Float64, A_3::CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}}, A_4::Float64, A_5::CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}}, A_6::Float64, A_7::CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}}, A_8::Float64, A_9::CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}})::ANY
happening in function tree:
Sugar stack trace:
  [1] GPUArrays.broadcast_kernel!(CLArrays.KernelState, ##69#70, CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}}, Tuple{UInt32,UInt32}, UInt32, Tuple{GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Array,2},GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Array,2},GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Array,2},GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Array,2}}, Float64, Float64, CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}}, Float64, CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}}, Float64, CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}}, Float64, CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}})


Code of the context this error occured in: 
begin 
      ilin::UInt32 = (GPUArrays.linear_index)(state::CLArrays.KernelState)::UInt32
      if (ilin::UInt32 <= len::UInt32)::Bool
          $(Expr(:inbounds, true))
          SSAValue(0) = (GPUArrays.apply_broadcast)(ilin::UInt32, state::CLArrays.KernelState, func::##69#70, shape::Tuple{UInt32,UInt32}, len::UInt32, descriptor::Tuple{GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Array,2},GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Array,2},GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Array,2},GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Array,2}}, A_1::Float64, A_2::Float64, A_3::CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}}, A_4::Float64, A_5::CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}}, A_6::Float64, A_7::CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}}, A_8::Float64, A_9::CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}})::ANY
          (GPUArrays.setindex!)(B::CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}}, SSAValue(0), ilin::UInt32)::Void
          $(Expr(:inbounds, :pop))
      end::ANY
      $(Expr(:return))
  end::ANY
___________________________________________________________________
Error in Expr rewrite! AssertionError("Found non concrete return type: Any")

Expression resulting in the error: 
SSAValue(0) = (GPUArrays.apply_broadcast)(ilin::UInt32, state::CLArrays.KernelState, func::##69#70, shape::Tuple{UInt32,UInt32}, len::UInt32, descriptor::Tuple{GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Array,2},GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Array,2},GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Array,2},GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Array,2}}, A_1::Float64, A_2::Float64, A_3::CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}}, A_4::Float64, A_5::CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}}, A_6::Float64, A_7::CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}}, A_8::Float64, A_9::CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}})::ANY
happening in function tree:
Sugar stack trace:
  [1] GPUArrays.broadcast_kernel!(CLArrays.KernelState, ##69#70, CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}}, Tuple{UInt32,UInt32}, UInt32, Tuple{GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Array,2},GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Array,2},GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Array,2},GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Array,2}}, Float64, Float64, CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}}, Float64, CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}}, Float64, CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}}, Float64, CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}})


Code of the context this error occured in: 
begin 
      ilin::UInt32 = (GPUArrays.linear_index)(state::CLArrays.KernelState)::UInt32
      if (ilin::UInt32 <= len::UInt32)::Bool
          $(Expr(:inbounds, true))
          SSAValue(0) = (GPUArrays.apply_broadcast)(ilin::UInt32, state::CLArrays.KernelState, func::##69#70, shape::Tuple{UInt32,UInt32}, len::UInt32, descriptor::Tuple{GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Array,2},GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Array,2},GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Array,2},GPUArrays.BroadcastDescriptorN{Any,0},GPUArrays.BroadcastDescriptorN{Array,2}}, A_1::Float64, A_2::Float64, A_3::CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}}, A_4::Float64, A_5::CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}}, A_6::Float64, A_7::CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}}, A_8::Float64, A_9::CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}})::ANY
          (GPUArrays.setindex!)(B::CLArrays.DeviceArray{Float64,2,Transpiler.CLIntrinsics.GlobalPointer{Float64}}, SSAValue(0), ilin::UInt32)::Void
          $(Expr(:inbounds, :pop))
      end::ANY
      $(Expr(:return))
  end::ANY
AssertionError: Found non concrete return type: Any

If any term in the broadcast is removed this is fixed. Is this some weird case of JuliaLang/julia#22255 ?

@SimonDanisch
Copy link
Member

Yes looks like it. Let me see if I can finally fix this by putting the arguments into a tuple!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants