Comments (9)
Actually I always write extensions with multiple backends. You can also find them in my profile, usually with cython and cffi, one for extreme performance, and another for pypy. Now maybe a third one with ctypes.
from libonnx.
Maybe cython is better, it's much faster than ctypes, and I'll have a try when I'm free.
from libonnx.
Maybe cython is better, it's much faster than ctypes
I think the speed of transition between Python and lib code doesn't matter enough. The most of processing still has to be done in the lib itself. But ctypes allow packages be pure python requiring no compilation and be portable across implementations. So I prefer ones that are ctypes-based over cext-based. I don't like unneeded compilation, especially if it is not always possible (i.e. on Windows machines there is usually no compilers, and the same with Android in chroot)
from libonnx.
Github action can do that well, a simple script will allow uploading pre-compiled wheels to pypi.
from libonnx.
- One cannot precompile wheels for every platform possible, every OS possible, every Python version possible, and every lib version possible.
- Running wheels compiled by a third party is a trust and security issue;
- But a pure Python solution requires no compilation at all, the same wheel can be used everywhere. And if needed, the wheel can be generated locally from source code. Installation can be done from git cheaply enough.
from libonnx.
One cannot precompile wheels for every platform possible, every OS possible, every Python version possible, and every lib version possible.
With CI build wheels and github action's matrix, you can do that, for example, watchfiles
Running wheels compiled by a third party is a trust and security issue
If you are using ctypes for wrapping, without a compiler, you will have to install the underlying lib first, which is also compiled by a third party. But if you have a compiler, why not install from source?
But a pure Python solution requires no compilation at all, the same wheel can be used everywhere. And if needed, the wheel can be generated locally from source code. Installation can be done from git cheaply enough.
Extensions won't disable the ability to install from a git repo, thanks to setuptools.
from libonnx.
With CI build wheels and github action's matrix, you can do that, for example, watchfiles
Not for every.
you will have to install the underlying lib first, which is also compiled by a third party
That lib can be a shared one from a trusted party, for example from distro packages.
But if you have a compiler, why not install from source?
- compilation can be slow, or memory consuming.
- I prefer to avoid compilation.
And pure python ones don't require compilation.
Extensions won't disable the ability to install from a git repo, thanks to setuptools.
cexts require compilation, which can be infeasible. I prefer to stay away of compilation. Pure python packages in the most of cases require no compilation.
from libonnx.
Okey... So, maybe a multi-backend package which both use cython and ctypes and choose to use one of them when installed should be fine?
from libonnx.
multi-backend packages
are always welcome ❤️
If you are also a fan of multi-backend packages, you can find quite some in the orgs within my profile.
from libonnx.
Related Issues (20)
- 可以参考下ONNC怎么做的
- Tensorflow model with opset 12 seems to crash when loaded HOT 5
- Question: Does libonnx support dynamic shape/CUDA ? HOT 4
- Which header files are necessary? HOT 2
- Why does every test in the model, node and simple folders fail? HOT 2
- How to convert a `onnx_context` to a `unsigned char array` as in the hello world example? HOT 3
- Failed to load 'yolov5n.onnx'. HOT 2
- Maxpool + dilation
- Inference on GPU HOT 4
- Support GRU? HOT 1
- Valgrind output for Yolo v2 model HOT 1
- Unsupported opset => Gather-11 (ai.onnx) HOT 2
- Support ORT (flatbuffers) models
- Should Conv nodes be optimized using FFT?
- Implement Fourier transform nodes
- Evaluate if it makes sense to utilize NNPack
- 请问在哪里看opset_version和对应版本所支持的算子列表?
- compile failed , report the error which macro undefined HOT 1
- Fail to compile on macOs
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 libonnx.