Skip to content

Low performance for Hermitian-times-adjoint matrix multiply #1393

@mikmoore

Description

@mikmoore

From this Discourse thread:

julia> using BenchmarkTools

julia> X = randn(100,100); Y = randn(100,100);

julia> @btime *($X, $Y);
  17.094 μs (3 allocations: 78.21 KiB)

julia> @btime *($X, $Y');
  17.559 μs (3 allocations: 78.21 KiB)

julia> @btime *(Hermitian($X), $Y);
  14.791 μs (3 allocations: 78.21 KiB)

julia> @btime *(Hermitian($X), $Y'); # <-------- oof
  406.171 μs (3 allocations: 78.21 KiB)

julia> @btime *(Matrix(Hermitian($X)), $Y'); # if nothing else we should at least do this?
  22.360 μs (6 allocations: 156.42 KiB)

The hermitian-times-adjoint multiply is 25x slower than hermitian-times-matrix at this size and the gap appears to grow when larger. My guess is a BLAS method was missed and so it hits a fallback. There might be other similar methods that are mis-routed as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions