Skip to content

Lots of specialization happing in annotation #3036

@kshyatt

Description

@kshyatt

I'm running some tests in QuantumKitHub/TensorKit.jl#380 where the Enzyme tests take hours (!!!) and it's 99% compilation. Looking at the output of --trace-compile --trace-compile-timing it seems a LOT of time is spent in https://github.com/EnzymeAD/Enzyme.jl/blob/main/lib/EnzymeCore/src/rules.jl#L351 , where the parent function has a @nospecialize annotation but the interior composed function + map doesn't. This can seemingly be a big problem if your package has a lot of custom types running around (as TensorKit does). Is there any chance someone a bit more familiar with the logic here could help prevent so many custom specializations? @vchuravy suggested making tt a vector or for loop.

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