Wish lisp have these like jupyter integration. And my first computer lecture many decades ago is really about how he hated fortran and why FORTRAN is still not dead (Mainly negative view due to haveGOTO that time). And it is still not dead.
LFortran: Modern interactive LLVM-based Fortran compiler
21–30 of 73 posts
Re: LFortran: Modern interactive LLVM-based Fortran compiler
#22Earlier quoted context omitted.
I think Eigen's template strategy is probably hard to beat from the perspective of combining operations. How well Fortran does is probably mostly up to the compiler implementation. In some of my benchmarks, gfortran sometimes seems to fuse the operations and end up much slower than if it has performed them separately in succession, but I wouldn't be surprised if compiling with `-fexternal-blas` (and linking MKL) woul…
These benchmarks are very interesting! From my experience gfortran’s MATMUL is very good for small matrices, but OpenBLAS gets better from ~10x10 elements. Not quite sure that’s the same as your benchmark; its colour code is a bit confusing. Would you mind making the data available? Certainly, gfortran’s default implementation works well as a quick and easy solution for small vectors and matrices outside of hot paths…
I'm on gfortran 10.1.1, so I'd only be missing out on very recent improvements (i.e., to trunk).
Note that these benchmarks were dynamically sized. If you write a fortran program like
real(kind=8), dimension(10,10) :: A, B, C
! fill A and B somehow
C = matmul(A, B)
the compiler will take advantage of the known dimensions and inline the call, making it much faster.> I would love an option to align arrays in gfortran. It’s very important to take advantage of automatic vectorisation but I haven’t found a reliable way to do it.
I wish more compilers could also use masks to vectorize without padding. If multiplying 7x7 matrices with AVX512, the obvious solution is to just mask the loads/stores of columns, without the need for padding. Of course, padding would also ensure all your loads/stores are aligned, which can be nice.
Re: LFortran: Modern interactive LLVM-based Fortran compiler
#23I use C++ Eigen extensively. I wonder if it feasible to write a C++ programs that hands off blocks of linear algebra code to Fortran subroutines. Eigen does a wonderful job of late binding and lazy evaluation so that something like the following is fairly efficient: (L.transpose() * P).diagonal().array().square().mean(); which computes the squared average of column by column dot products between matrices L and P. I a…
Re: LFortran: Modern interactive LLVM-based Fortran compiler
#24Earlier quoted context omitted.
These benchmarks are very interesting! From my experience gfortran’s MATMUL is very good for small matrices, but OpenBLAS gets better from ~10x10 elements. Not quite sure that’s the same as your benchmark; its colour code is a bit confusing. Would you mind making the data available? Certainly, gfortran’s default implementation works well as a quick and easy solution for small vectors and matrices outside of hot paths…
My color coding is bad (and there's an open issue about it), but I haven't come up with a great solution. One idea I should add was to make everything relative to LoopVectorization, but that wouldn't help for those interested in other comparisons like Eigen vs gfortran. I'm on gfortran 10.1.1, so I'd only be missing out on very recent improvements (i.e., to trunk). Note that these benchmarks were dynamically sized. I…
Re: LFortran: Modern interactive LLVM-based Fortran compiler
#25Re: LFortran: Modern interactive LLVM-based Fortran compiler
#26Not much of a Fortran yet without arrays, complex numbers, or strings.
Re: LFortran: Modern interactive LLVM-based Fortran compiler
#27Re: LFortran: Modern interactive LLVM-based Fortran compiler
#28Is this related to flang? https://github.com/llvm/llvm-project/tree/master/flang/
LFortran's main advantage is that it is interactive, so the parser and semantics has to be a little different. And also we designed it so that it will be quite approachable for people to write tools on top.
Re: LFortran: Modern interactive LLVM-based Fortran compiler
#29Nice, I want to play with this, but I see on the Development page there is no/limited support for arrays?
Re: LFortran: Modern interactive LLVM-based Fortran compiler
#30If curious see also 2019 https://news.ycombinator.com/item?id=19795262 https://news.ycombinator.com/item?id=19788526