opened 01:59PM - 10 Jan 24 UTC
closed 11:38AM - 07 May 24 UTC
LoopVectorization.jl's generated IR seems to cause segfaults on 1.11, as observe… d on PkgEval with at least 6 packages (MCPhylo,jl, LocalPoly.jl, VectorizedReduction.jl, NaNStatistics.jl, TimeSeriesClassification.jl, PlmDCA.jl). See this report for details: https://s3.amazonaws.com/julialang-reports/nanosoldier/pkgeval/by_hash/2cbecf4_vs_18b4f3f/report.html
@chriselrod I'm opening a new issue because https://github.com/JuliaSIMD/LoopVectorization.jl/issues/518 was closed, and to list all issues in case somebody wants to tackle this.
---
Some of the errors that I've encountered:
An LLVM assertion, as seen with MCPhylo.jl (requires assertions build of Julia):
```
julia: /workspace/srcdir/llvm-project/llvm/lib/IR/Instructions.cpp:2561: void llvm::InsertValueInst::init(llvm::Value*, llvm::Value*, llvm::ArrayRef<unsigned int>, const llvm::Twine&): Assertion `ExtractValueInst::getIndexedType(Agg->getType(), Idxs) == Val->getType() && "Inserted value must match indexed type!"' failed.
[177] signal 6 (-6): Aborted
in expression starting at /home/pkgeval/.julia/packages/MCPhylo/KWPlY/test/distributions/phylodist.jl:1
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x7fbeac0f040e)
__assert_fail at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
_ZN4llvm15InsertValueInst4initEPNS_5ValueES2_NS_8ArrayRefIjEERKNS_5TwineE at /opt/julia/bin/../lib/julia/libLLVM-15jl.so (unknown line)
InsertValueInst at /source/usr/include/llvm/IR/Instructions.h:2640 [inlined]
Create at /source/usr/include/llvm/IR/Instructions.h:2565 [inlined]
CreateInsertValue at /source/usr/include/llvm/IR/IRBuilder.h:2343
emit_new_struct at /source/src/cgutils.cpp:3870
emit_new_struct at /source/src/julia.h:1704
emit_expr at /source/src/codegen.cpp:5945
emit_ssaval_assign at /source/src/codegen.cpp:5367
emit_stmtpos at /source/src/codegen.cpp:5642 [inlined]
emit_function at /source/src/codegen.cpp:8810
jl_emit_code at /source/src/codegen.cpp:9144
jl_emit_codeinst at /source/src/codegen.cpp:9227
_jl_compile_codeinst at /source/src/jitlayers.cpp:220
jl_generate_fptr_impl at /source/src/jitlayers.cpp:525
jl_compile_method_internal at /source/src/gf.c:2509 [inlined]
jl_compile_method_internal at /source/src/gf.c:2397
_jl_invoke at /source/src/gf.c:2912 [inlined]
ijl_apply_generic at /source/src/gf.c:3097
logpdf at /home/pkgeval/.julia/packages/MCPhylo/KWPlY/src/distributions/Phylodist.jl:118
```
A segfault during `vload`, as seen with NaNStatistics.jl and PlmDCA.jl:
```
[60] signal 11 (2): Segmentation fault
in expression starting at /home/pkgeval/.julia/packages/NaNStatistics/oBRaH/test/testArrayStats.jl:80
macro expansion at /home/pkgeval/.julia/packages/VectorizationBase/0dXyA/src/llvm_intrin/memory_addr.jl:987 [inlined]
__vload at /home/pkgeval/.julia/packages/VectorizationBase/0dXyA/src/llvm_intrin/memory_addr.jl:987 [inlined]
_vload at /home/pkgeval/.julia/packages/VectorizationBase/0dXyA/src/strided_pointers/stridedpointers.jl:95 [inlined]
macro expansion at /home/pkgeval/.julia/packages/VectorizationBase/0dXyA/src/vecunroll/memory.jl:60 [inlined]
_vload_unroll at /home/pkgeval/.julia/packages/VectorizationBase/0dXyA/src/vecunroll/memory.jl:535 [inlined]
_vload at /home/pkgeval/.julia/packages/VectorizationBase/0dXyA/src/vecunroll/memory.jl:771 [inlined]
macro expansion at /home/pkgeval/.julia/packages/LoopVectorization/7iB2K/src/reconstruct_loopset.jl:1107 [inlined]
_turbo_! at /home/pkgeval/.julia/packages/LoopVectorization/7iB2K/src/reconstruct_loopset.jl:1107 [inlined]
_nanmean at /home/pkgeval/.julia/packages/NaNStatistics/oBRaH/src/ArrayStats/ArrayStats.jl:344
__nanmean at /home/pkgeval/.julia/packages/NaNStatistics/oBRaH/src/ArrayStats/ArrayStats.jl:308 [inlined]
#nanmean#5 at /home/pkgeval/.julia/packages/NaNStatistics/oBRaH/src/ArrayStats/ArrayStats.jl:307 [inlined]
nanmean at /home/pkgeval/.julia/packages/NaNStatistics/oBRaH/src/ArrayStats/ArrayStats.jl:307
```
A segfault during `vadd_fast` as seen with VectorizedReductions.jl:
```
[12] signal 11 (2): Segmentation fault
in expression starting at /home/pkgeval/.julia/packages/VectorizedReduction/bsnWJ/test/reduce.jl:4
macro expansion at /home/pkgeval/.julia/packages/VectorizationBase/xE5Tx/src/llvm_intrin/binary_ops.jl:31 [inlined]
vadd_fast at /home/pkgeval/.julia/packages/VectorizationBase/xE5Tx/src/llvm_intrin/binary_ops.jl:31 [inlined]
fmap at /home/pkgeval/.julia/packages/VectorizationBase/xE5Tx/src/vecunroll/fmap.jl:11 [inlined]
fmap at /home/pkgeval/.julia/packages/VectorizationBase/xE5Tx/src/vecunroll/fmap.jl:11 [inlined]
fmap at /home/pkgeval/.julia/packages/VectorizationBase/xE5Tx/src/vecunroll/fmap.jl:11 [inlined]
fmap at /home/pkgeval/.julia/packages/VectorizationBase/xE5Tx/src/vecunroll/fmap.jl:11 [inlined]
fmap at /home/pkgeval/.julia/packages/VectorizationBase/xE5Tx/src/vecunroll/fmap.jl:11 [inlined]
fmap at /home/pkgeval/.julia/packages/VectorizationBase/xE5Tx/src/vecunroll/fmap.jl:11 [inlined]
fmap at /home/pkgeval/.julia/packages/VectorizationBase/xE5Tx/src/vecunroll/fmap.jl:11 [inlined]
vadd_fast at /home/pkgeval/.julia/packages/VectorizationBase/xE5Tx/src/vecunroll/fmap.jl:111 [inlined]
add_fast at /home/pkgeval/.julia/packages/VectorizationBase/xE5Tx/src/base_defs.jl:91 [inlined]
macro expansion at /home/pkgeval/.julia/packages/LoopVectorization/7iB2K/src/reconstruct_loopset.jl:1107 [inlined]
_turbo_! at /home/pkgeval/.julia/packages/LoopVectorization/7iB2K/src/reconstruct_loopset.jl:1107 [inlined]
macro expansion at /home/pkgeval/.julia/packages/VectorizedReduction/bsnWJ/src/vmapreduce.jl:236 [inlined]
vvmapreduce at /home/pkgeval/.julia/packages/VectorizedReduction/bsnWJ/src/vmapreduce.jl:231
vvreduce at /home/pkgeval/.julia/packages/VectorizedReduction/bsnWJ/src/vmapreduce.jl:147
```
The source of bad IR hasn't been fully determined yet, but it seems to be the `Expr(:new)` that's generated to pass structs by value instead of by reference: https://github.com/JuliaLang/julia/issues/52702#issuecomment-1874492883.
---
Deprecating LoopVectorization.jl isn't possible, because:
- some packages, e.g. RecursiveFactorizations.jl, inspect LoopVectorization.jl internals: https://github.com/JuliaSIMD/LoopVectorization.jl/issues/520
- the transformation of `@turbo` changes semantics, https://github.com/JuliaSIMD/LoopVectorization.jl/pull/523#issuecomment-1884883071
So the only solution forwards seems fixing LoopVectorization.jl. I've taken a first attempt at it in https://github.com/JuliaSIMD/LoopVectorization.jl/pull/523, but just removing the `Expr(:new)` optimization isn't sufficient, and there's other issues (see above).
check_empty=true/false
didn’t change between early Julia versions and 1.10.
We could make check_empty=true
the default.
Closing this because tests pass on 1.11, while check_empty=false
should’ve also caused segfaults in older Julia versions. Test cleanup · JuliaSIMD/LoopVectorization.jl@eeaa0b2 · GitHub
But if anyone wants to contribute towards v1.12, the SciML Small Grants outlines that project and we’d be happy to up the ante. Maintenance never ends, so it’ll need v1.13 updates too!
2 Likes
I think based on unstable code in Julia 1.10 ,
The readme note about unstable code in Julia 1.10 must be removed, It makes the users distrust installing the package in 1.10.x versions.
photor
July 26, 2024, 2:35am
123
Please make 1.10 LTS, and let LV reliably run on it
1 Like
photor:
Please make 1.10 LTS
This has been announced in the Juliacon, and 1.10 will become the LTS once 1.11 is released (which isn’t too far away)
11 Likes
Hi @ChrisRackauckas ! How should donations to numfocus / SciML be tagged for the LV small grants program?
Elrod
July 31, 2024, 2:10pm
126
Feel free to make PRs to the README.
Should also perhaps add a link to the small grants program.
Note that fixing regressions, e.g. those from 1.12, is vastly easier than writing the code in the first place.
It’s mostly straightforward mechanical changes. Because it’s also a regression, you can also compare older and newer Julia versions side by side to better understand the changes.
It really isn’t hard. But it isn’t a mentorship program, so you shouldn’t expect any guidance aside from what you can get asking in open channels like discourse, slack, or zulip.
Elrod
July 31, 2024, 2:11pm
127
I hate to break it to you @tecosaur , but your emacs config might merely make you a millionaire, rather than a multi-millionaire.
3 Likes
If you leave a note that should be sufficient.
This is truly devastating news.
2 Likes
Salmon
July 31, 2024, 6:09pm
130
Maybe I am missing something obvious, but I dont see any option to leave a note. There is only space to provide name and address information after that there is only a button to pay. If I remember correctly there is also no way to add a note after paying (though I might be wrong, it was a bit ago)
Well, there is the field “Are you donating on behalf of an organization or a company?” Is that where we should drop a note?
I guess so. In the latest versions I don’t see any other spot.
1 Like
Is there any update on this? Has anyone fixed the issues on LV for 1.12? From the repo it looks not to be the case.
Eventually, I will contribute myself to the SciML small grants program (LV is too big to fail )
nsajko
January 10, 2025, 9:14am
134
An update on Julia, perhaps slightly relevant, is that the compiler is now a package, Compiler.jl. Although only for Julia v1.12 and up, which are not released yet. I guess this could make future efforts easier to maintain, assuming a public API and documentation arises. LoopVectorization.jl depends on Julia and LLVM internals, which made it time-consuming to maintain, so changes in Julia like this one could ease that burden.
5 Likes
woclass
January 10, 2025, 11:36am
135
We need to update LV.jl and all its dependencies.
In Progress : Claimed by Miguel Raz Guzman for the time period of May 10th, 2024 - June 10th 2024.
SciML Small Grants Program Current Project List
JuliaSIMD:master
← miguelraz:small-grant
opened 07:24AM - 12 May 24 UTC
This PR
* Temporarily disables Aqua and some tests to speed up test feedback. T… hese will be turn on again after the corresponding tests pass
* deletes `JULIAPOINTER = "i32"/"i64"` and instead uses `ptr` everywhere
Once the current set of tests pass I'll work on the remaining `Special Functions` and friends test sets but wanted to get some progress here first.
But this pr seems to be stalled.
My attempts:
JuliaSIMD:main
← fork4jl:float16
opened 11:52AM - 02 Jan 25 UTC
Fix #11
```jl
julia> VERSION
v"1.11.2"
julia> Float16(0) isa Base.HWReal…
false
```
JuliaSIMD:main
← fork4jl:jl-dev
opened 10:47AM - 02 Jan 25 UTC
Changes:
- Use `ptr` for opaque pointers with `llvmcall`
- Need Julia 1.11+:
… We need LLVM 15+ for pointer type `ptr` and Julia 1.11+ for opaque-pointers mode.
See: [Pointer Type - LLVM 15](https://releases.llvm.org/15.0.0/docs/LangRef.html#t-pointer);
[Bump Julia to LLVM 16 #51720](https://github.com/JuliaLang/julia/pull/51720)
- Add comment for `atomicrmw_ops`
- CI: Update build matrix:
ref: https://github.com/JuliaLang/Pkg.jl/blob/8d3cf02e5e35913c89440c3b5c6678c1a806e975/.github/workflows/test.yml#L28-L49
- CI: run with default arch with julia nightly.
Or I can copy build matrix from `ci.yml` if you want.
TODO:
- [ ] Update CI, also need #52
- [ ] Set version to `v"0.6.0"`?
Some TODO:
There is still a lot of work to be done and any contributions or PR reviews would be welcome.
5 Likes
First and foremost: thanks!
Unfortunately, I cannot help you (this is beyond my skills).
I will likely add another 100$ to the SciML grant for this. Again, LV is too important for some many piece of software to make it die. Hopefully you might become the new mantainer
4 Likes
Elrod
January 10, 2025, 4:57pm
137
If you think you can fix it, feel free to apply for the grant.
It’d have to get fairly juicy before I take a look.
FWIW, I refused the $500 for fixing it for the 1.11 release.
I repeated a few times that it was actually an easy fix, but most people were too intimidated to give it a look. Took me like 5 minutes.
The changes for 1.12 are much larger, but I don’t believe they’re difficult.
Some familiarity with things like LLVM IR would, however, be helpful.
Consider it abandoned.
1 Like
rveltz
January 10, 2025, 5:22pm
138
500$ in 5mn, what is your hour rate ??!!
2 Likes
jules
January 10, 2025, 5:58pm
139
using LoopVectorization
@turbo 500 / 5 * 60
13 Likes
Elrod
January 10, 2025, 6:30pm
140
$0/hour, because I did the work and refused the money.
22 Likes