FluxML / FluxML/IRTools.jl

@nospecialize slows down first time inference

Open
#64 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
113
Forks
37
PR merge metrics
No merged PRs in 30d

Description

I notice the use of `@nospecialize` slows down the first time inference when using IRTools functions (e.g `Pipe`, `update!`) a lot, not sure why

```jl
# without nospecialize
6.351286 seconds (10.75 M allocations: 572.988 MiB, 5.41% gc time)
# with nospecialize
7.406211 seconds (14.54 M allocations: 773.888 MiB, 5.02% gc time)
```

I suspect this is also causing other things (like Zygote) to be extremely slow for the first run.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the reported first-inference timings for the IRTools functions Pipe and update!, comparing runs with and without @nospecialize. Trace the relevant inference path and allocations around those entry points. Done means the cause of the slowdown is identified and first-run performance is improved without regressing the affected functions.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
compilers, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.