{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/25558","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/25558/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/25558/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/25558/events","html_url":"https://github.com/JuliaLang/julia/pull/25558","id":288431396,"node_id":"MDExOlB1bGxSZXF1ZXN0MTYyODM4NjY3","number":25558,"title":"Rewrite mul! to dispatch based on memory layout, not matrix type","user":{"login":"dlfivefifty","id":1229737,"node_id":"MDQ6VXNlcjEyMjk3Mzc=","avatar_url":"https://avatars3.githubusercontent.com/u/1229737?v=4","gravatar_id":"","url":"https://api.github.com/users/dlfivefifty","html_url":"https://github.com/dlfivefifty","followers_url":"https://api.github.com/users/dlfivefifty/followers","following_url":"https://api.github.com/users/dlfivefifty/following{/other_user}","gists_url":"https://api.github.com/users/dlfivefifty/gists{/gist_id}","starred_url":"https://api.github.com/users/dlfivefifty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlfivefifty/subscriptions","organizations_url":"https://api.github.com/users/dlfivefifty/orgs","repos_url":"https://api.github.com/users/dlfivefifty/repos","events_url":"https://api.github.com/users/dlfivefifty/events{/privacy}","received_events_url":"https://api.github.com/users/dlfivefifty/received_events","type":"User","site_admin":false},"labels":[{"id":61807486,"node_id":"MDU6TGFiZWw2MTgwNzQ4Ng==","url":"https://api.github.com/repos/JuliaLang/julia/labels/linear%20algebra","name":"linear algebra","color":"f2b3db","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/JuliaLang/julia/milestones/25","html_url":"https://github.com/JuliaLang/julia/milestone/25","labels_url":"https://api.github.com/repos/JuliaLang/julia/milestones/25/labels","id":2127605,"node_id":"MDk6TWlsZXN0b25lMjEyNzYwNQ==","number":25,"title":"1.x","description":"Non-breaking changes and features that can be added after 1.0.","creator":{"login":"JeffBezanson","id":744556,"node_id":"MDQ6VXNlcjc0NDU1Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/744556?v=4","gravatar_id":"","url":"https://api.github.com/users/JeffBezanson","html_url":"https://github.com/JeffBezanson","followers_url":"https://api.github.com/users/JeffBezanson/followers","following_url":"https://api.github.com/users/JeffBezanson/following{/other_user}","gists_url":"https://api.github.com/users/JeffBezanson/gists{/gist_id}","starred_url":"https://api.github.com/users/JeffBezanson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeffBezanson/subscriptions","organizations_url":"https://api.github.com/users/JeffBezanson/orgs","repos_url":"https://api.github.com/users/JeffBezanson/repos","events_url":"https://api.github.com/users/JeffBezanson/events{/privacy}","received_events_url":"https://api.github.com/users/JeffBezanson/received_events","type":"User","site_admin":false},"open_issues":88,"closed_issues":21,"state":"open","created_at":"2016-11-10T17:16:07Z","updated_at":"2018-06-07T20:57:21Z","due_on":null,"closed_at":null},"comments":75,"created_at":"2018-01-14T19:11:34Z","updated_at":"2018-06-07T20:57:21Z","closed_at":"2018-06-07T20:57:21Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/25558","html_url":"https://github.com/JuliaLang/julia/pull/25558","diff_url":"https://github.com/JuliaLang/julia/pull/25558.diff","patch_url":"https://github.com/JuliaLang/julia/pull/25558.patch"},"body":"This is in part to address https://github.com/JuliaLang/julia/issues/10385 and based on discussions there, and is the second stage of https://github.com/JuliaLang/julia/pull/25321.\r\n\r\nThe aim of this pull request is to use memory layout to decide when to dispatch to BLAS/LAPack routines, instead of array type. This will lead to a simplified dispatch of linear algebra, without so many special cases for `Adjoint`, `Transpose`, etc. It also facilitates other array types outside of Base (e.g. `BandedMatrix`) use BLAS linear algebra routines.\r\n\r\nI've only adapted `mul!` so far (with `ldiv!`, etc. yet to be adapted), but I wanted to get comments before finishing the changes. I'll finish completing implementing this pull request if it's decided to be a good solution to the problem. \r\n\r\nNote I use the name `CTransposeStridedLayout` instead of `AdjointStridedLayout` as it is referring to memory layout, not mathematical structure. Alternatively, it could be `RowMajorStridedLayout` and `ConjRowMajorStridedLayout`.\r\n\r\n@timholy @stevengj Any thoughts would be appreciated. "},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/395562426","html_url":"https://github.com/JuliaLang/julia/pull/25558#issuecomment-395562426","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/25558","id":395562426,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTU2MjQyNg==","user":{"login":"dlfivefifty","id":1229737,"node_id":"MDQ6VXNlcjEyMjk3Mzc=","avatar_url":"https://avatars3.githubusercontent.com/u/1229737?v=4","gravatar_id":"","url":"https://api.github.com/users/dlfivefifty","html_url":"https://github.com/dlfivefifty","followers_url":"https://api.github.com/users/dlfivefifty/followers","following_url":"https://api.github.com/users/dlfivefifty/following{/other_user}","gists_url":"https://api.github.com/users/dlfivefifty/gists{/gist_id}","starred_url":"https://api.github.com/users/dlfivefifty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlfivefifty/subscriptions","organizations_url":"https://api.github.com/users/dlfivefifty/orgs","repos_url":"https://api.github.com/users/dlfivefifty/repos","events_url":"https://api.github.com/users/dlfivefifty/events{/privacy}","received_events_url":"https://api.github.com/users/dlfivefifty/received_events","type":"User","site_admin":false},"created_at":"2018-06-07T20:57:21Z","updated_at":"2018-06-07T20:57:21Z","author_association":"CONTRIBUTOR","body":"I've done a mock up of the lazy `Mul` approach\r\n\r\nhttps://github.com/dlfivefifty/LazyLinearAlgebra.jl\r\n\r\n and it works surprisingly well with the new broadcast, to give nice versions of BLAS routines:\r\n```julia\r\nA = randn(5,5); b = randn(5); c = similar(b);\r\n\r\nc .= Mul(A,b)\r\n@test all(c .=== BLAS.gemv!('N', 1.0, A, b, 0.0, similar(c)))\r\n\r\nc .= 2.0 .* Mul(A,b)\r\n@test all(c .=== BLAS.gemv!('N', 2.0, A, b, 0.0, similar(c)))\r\n\r\nc = copy(b)\r\nc .= Mul(A,b) .+ c\r\n@test all(c .=== BLAS.gemv!('N', 1.0, A, b, 1.0, copy(b)))\r\n\r\nc = copy(b)\r\nc .= Mul(A,b) .+ 2.0 .* c\r\n@test all(c .=== BLAS.gemv!('N', 1.0, A, b, 2.0, copy(b)))\r\n\r\nc = copy(b)\r\nc .= 3.0 .* Mul(A,b) .+ 2.0 .* c\r\n@test all(c .=== BLAS.gemv!('N', 3.0, A, b, 2.0, copy(b)))\r\n\r\nd = similar(c)\r\nc = copy(b)\r\nd .= 3.0 .* Mul(A,b) .+ 2.0 .* c\r\n@test all(d .=== BLAS.gemv!('N', 3.0, A, b, 2.0, copy(b)))\r\n```\r\n\r\nI think I'm going to focus on developing that approach as a package, instead of working on it as a PR, as it can exist outside of StdLib. Then the various linear algebra packages (BlockArrays.jl, BandedMatrices.jl, etc.) can use `Mul` directly instead of LinearAlgebra's `mul!` and avoid the ambiguity issues with `mul!`.  We can think of merging it into Base in the future.\r\n"}}
{"actor":{"display_login":"dlfivefifty"}}