Comments (3)
That's not good! Can reproduce the crash. I think it's reading out of bounds, but am not yet sure why. It seems to be inferring the correct ranges, but the result clearly doesn't come from arr
:
julia> using Tullio
julia> @tullio verbose=true
julia> function f(arr)
@tullio res1 = arr[i, k] - arr[i - 1, k]
@tullio res2 = arr[i, k] - arr[i, k + 1]
return res1 + res2
end
julia> arr = [1 2; 3 4]
julia> f(arr)
[ Info: left index ranges
┌ Info: reduction index ranges
│ i = 2:2
└ k = Base.OneTo(2)
[ Info: left index ranges
┌ Info: reduction index ranges
│ i = Base.OneTo(2)
└ k = 1:1
-5679683831
I think it's a scope problem, that one of the functions defined by the first macro is escaping and being called by the second, now with the wrong ranges. (I thought I had tests for this, but clearly not sensitive enough ones.) Probably just needs one more let block:
julia> function h(arr)
res1 = let
@tullio res1 = arr[i, k] - arr[i - 1, k]
end
res2 = let
@tullio res2 = arr[i, k] - arr[i, k + 1]
end
return res1 + res2
end
h (generic function with 1 method)
julia> h(arr)
2
julia> print(Zygote.gradient(h, arr))
([0 -2; 2 0],)
from tullio.jl.
I will fix it for sure, but it might not be today.
from tullio.jl.
I can confirm that the let blocks work 🥰
You still want to fix it or keep it like that?
At least for me the workaround is good for the moment.
from tullio.jl.
Related Issues (20)
- HybridArrays HOT 9
- Runtime dispatch when reducing to scalar
- Alternative to Tullio for Chained Multiplication HOT 4
- @views macro causes module compilation failure HOT 3
- Reporting a bug when Tullio being included with LoopVectorization HOT 1
- [Question] Is it possible to create a vector of SVectors from a Matrix using Tullio? HOT 2
- [Question] How to change summation order? HOT 5
- Use package extensions HOT 1
- How finalizers `|>` work HOT 5
- Method error when broadcast and sum of matrices HOT 1
- GPU Kernel Compilation Failed with Interpolations HOT 2
- Upgrade to CUDA.CUDAKernels HOT 9
- Bug when using Tullio + LoopVectorization HOT 5
- Add Finch.jl backend HOT 4
- CUDA v4 support HOT 2
- Using threads, vs setting threads=false gives different result HOT 3
- Issue with vectorized functions on GPU HOT 3
- Error when specifying the range of an index with a UnitRange HOT 4
- Scalar indexing with CUDA HOT 10
- Please update dep of FillArrays to v1.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tullio.jl.