Comments (4)
I used @timev
, and clearly shows the improvements 🚀 . People thought that the only improvement that we get is in the inference time.
For example, for Zygote:
Running @timev
in running the tests shows that we get:
- 10s raw improvement
- 23 MB less memory usage
- 1GiB less memory allocation.
Details
│ Precompile Deactivated Benchmark
# for using Zygote:
└ Inference time (ms): 23654.842
@timev result (This has some noise).
391.374697 seconds (628.72 M allocations: 31.522 GiB, 4.16% gc time)
elapsed time (ns): 391374697041
gc time (ns): 16295209095
bytes allocated: 33846029551
pool allocs: 628513544
non-pool GC allocs:190530
malloc() calls: 11983
realloc() calls: 85
GC pauses: 503
full collections: 9
│ Precompile Activated Benchmark
┌ Info:
└ Inference time (ms): 22565.431
@timev result (This has some noise).
382.785964 seconds (605.11 M allocations: 30.360 GiB, 3.93% gc time)
elapsed time (ns): 382785964109
gc time (ns): 15042733929
bytes allocated: 32598547445
pool allocs: 604912736
non-pool GC allocs:184276
malloc() calls: 11737
realloc() calls: 81
GC pauses: 467
full collections: 6
https://github.com/aminya/Zygote.jl/runs/646094164?check_suite_focus=true#step:6:123
from snoopcompile.jl.
@snoopi
is for discovery and for measuring just one thing, inference time. @timev
measures a whole bunch of things, including load time, LLVM time, execution time, etc. In the end it's closer to what people will want to reduce, so it's not bad to use it to decide whether the precompiles are worth it. E.g., #74.
In general I worry that too many people use SnoopCompile unthinkingly; for me, the "discovery" part is by far the most important and I generally prefer to write the precompile file by hand. But I recognize I'm probably an outlier. Recommending @timev
might help people realize that, for example, setting a higher tmin
(and thus precompiling less) might actually reduce times they care about.
from snoopcompile.jl.
If this is the case, should I just use @timev
for benchmarking isntead of @snoopi
? People seem to have better intuition for it.
julia_code_timev = """
using $package_name
@timev begin
$(string(snoop_script));
end
@info("The above is @timev result (This has some noise).")
"""
julia_cmd_timev = `julia --project=@. -e $julia_code_timev`
from snoopcompile.jl.
People are less concerned with the precompiling time, but with its effect on the performance. Using @timev
helps with this for sure. I think I can close this, as this will be solved in #71
from snoopcompile.jl.
Related Issues (20)
- SnoopPrecompile with pkgimages chokes on non-native code HOT 8
- `suggest` is producing `StackOverflowError`
- Add a `.JuliaFormatter.toml` and format?
- There are not tags for SnoopPrecompile in the repo HOT 10
- Clarify docs re: precompile and runtime dispatch HOT 2
- MethodError on `invalidation_trees` HOT 2
- Rethink how we use Preferences HOT 8
- confusing output of mt_backedges HOT 4
- A lazier approach to precompilation HOT 3
- can't SnoopPrecompile ModelingToolkit / DifferentialEquations :( HOT 5
- Loading ReverseDiff and UnicodePlots together and looking at their invalidations prints tens of thousands of lines HOT 3
- Failure to insert invalidations by invalidation_trees()
- Register new versions of SnoopCompileCore? HOT 1
- `MethodError` with `invalidation_trees` on Julia 1.8.2, works on 1.9.1
- `Illegal inttoptr` error on HPC HOT 3
- Error in showing output of `invalidation_trees`
- Why is Pkg.jl a dependency?
- Sorting on number of children seems to have regressed HOT 2
- Next breaking release HOT 10
- Support for cross-environment (de-)serialization of records and offline analysis HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snoopcompile.jl.