Comments (6)
if we remove all the @timed
stuff it seems to work, I suggest remove all the timed stuff for production
from onnxruntime.jl.
Thanks for bringing this up. I agree we should just get rid of TimerOutputs. Would be awesome if you could make a PR!
from onnxruntime.jl.
done
from onnxruntime.jl.
julia> const model_cpu = load_inference("onnx_model_test.onnx");
julia> @time let input = Dict("dense_input" => randn(Float32, 1, 78))
for _ = 1:10^5
model_cpu(input)
end
end
1.294845 seconds (5.10 M allocations: 1.068 GiB, 10.40% gc time)
julia> @time let input = Dict("dense_input" => randn(Float32, 1, 78))
Threads.@threads for _ = 1:10^5
model_cpu(input)
end
end
1.035058 seconds (5.12 M allocations: 1.069 GiB, 14.82% gc time, 1.43% compilation time)
julia> Threads.nthreads()
10
actually, it doesn't scale anyway
from onnxruntime.jl.
but at least this trick works:
julia> const models = [load_inference("./onnx_model_test.onnx") for _=1:Threads.nthreads()]
julia> @time let input = Dict("dense_input" => randn(Float32, 1, 78))
Threads.@threads for _ = 1:10^5
models[Threads.threadid()](input)
end
end
0.367188 seconds (5.12 M allocations: 1.069 GiB, 38.03% compilation time)
somewhat
from onnxruntime.jl.
My guess is that onnxruntime does multithreading internally on CPU?
from onnxruntime.jl.
Related Issues (14)
- Contribution: JLL for support for additional platforms HOT 17
- Loading existing model test data? HOT 1
- Error: could not load library ... onnxruntime.dll ... The specified module could not be found. HOT 3
- Incorrect results for matrix multiplication HOT 7
- Mac M1 support HOT 8
- CUDA 4.0 compatibility HOT 6
- Can't load simple model (with 8bit and 16bit inputs) HOT 5
- Privacy - tracking - data collection HOT 3
- Manual release of memory HOT 1
- Incompatibility with cuDNN 1.3.1 HOT 1
- TagBot trigger issue HOT 13
- windows support HOT 1
- osx support
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 onnxruntime.jl.