174 karma · joined Mar 18, 2018 (8y ago) · 68 submissions
comment 9mo ago · link · parent
We're working to make Qualcomm NPUs a first-class citizen for deployment from PyTorch. Devs can write a Python function that runs a PyTorch model, then use our `@compile` decorator to transpile the model to a Qcom-specific C++ implementation (DLC) which compiles to a self-contained shared library.
The Qualcomm NPUs are fast. 1.8x faster than ONNXRuntime. See the link above.
2.
Making PyTorch –> Qualcomm NPUs less treacherous(muna.ai ↗)
1 points · by olokobayusuf · 9mo ago · 1 comment
3.
Show HN: Our command line tool to transpile AI Inference from Python to C++(github.com ↗)
4 points · by olokobayusuf · 10mo ago · discuss
comment 1y ago · link · parent
Read more:
- https://blog.codingconfessions.com/p/compiling-python-to-run... - https://docs.muna.ai/predictors/ai#inference-backends
comment 1y ago · link · parent
comment 1y ago · link · parent
We're building a general purpose compiler for Python. Once compiled, developers can deploy across Android, iOS, Linux, macOS, Web (wasm), and Windows in as little as two lines of code.
Congrats on the launch!
comment 1y ago · link · parent
It's kind of funny: our compiler currently doesn't support classes, but we support many kinds of AI models (vision, text generation, TTS). This is mainly because math, tensor, and AI libraries are almost always written with a functional paradigm.
Business plan is simple: we charge per endpoint that downloads and executes the compiled binary. In the AI world, this removes a large multiplier in cost structure (paying per token). Beyond that, we help co's find, eval, deploy, and optimize models (more enterprise-y).
comment 1y ago · link · parent
https://blog.codingconfessions.com/i/174257095/lowering-to-c...
11.
Compiling Python to Run Anywhere(blog.codingconfessions.com ↗)
4 points · by olokobayusuf · 1y ago · discuss
comment 1y ago · link · parent
We're building native code generation for AI developers. We generate high-performance C++/Rust to power open-source and on-device AI for our customers. We have customers ranging from early stage startups to the Fortune 1000.
You'll be:
1. Writing open-source Python functions that run popular vision models and LLMs; or
2. Writing high-performance C++ and Rust code that targets different accelerators (CUDA, Metal, etc); or
3. Writing parts of our Python-to-C++ compiler in support of (1) and (2); or
4. Some combination thereof.
Join the party: Email us at stdin@fxn.ai or apply at https://app.dover.com/jobs/fxn.
No recruiters; no visa sponsorship (yet). We prize demonstrated curiosity and impact over everything else.
comment 1y ago · link · parent
14.
Show HN: Powering React with Python (WASM)(medium.com ↗)
3 points · by olokobayusuf · 1y ago · 1 comment
comment 1y ago · link · parent
With this in place, when we trace through a dev's function, a given function call is considered a leaf node unless the function's containing module is in `trace_modules`. This covers the Python stdlib.
We then take all leaf nodes, lookup their equivalent implementation in native code (written and validated by us), and use that native implementation for codegen.
We don't interact with the GIL. And we keep track of what is unsupported so far: https://docs.fxn.ai/predictors/requirements#language-coverag...
comment 1y ago · link · parent
comment 1y ago · link · parent
First, Function is designed to be truly cross-platform but libraries like Numpy aren't compiled for say WebAssembly.
Second, the native libraries are usually built around CPython interop (i.e. the C API expects to interact with the CPython interpreter). Function does not (and will never) have a CPython interpreter (we generate full AOT compiled code).
comment 1y ago · link · parent
"What if we could compile Python into raw native code *without having a Python interpreter*?"
The key distinguishing feature of this compiler is being able to make standalone, cross-platform native binaries from Python code. Numba will fallback to using the Python interpreter for code that it can't jit.
comment 1y ago · link · parent
Beyond that, we also compile the generated native code in the cloud so that devs don't have to have a cross-compiler installed on their system (i.e. Clang, Xcode, MSVC, and so on).
comment 1y ago · link · parent
I've clarified that this is not designed to be a rigorous benchmark. We've got rigorous benchmarks coming for image processing and CNN inference. I'll reply with the image processing example benchmark this week.
comment 1y ago · link · parent
But beyond that, our goal is meeting devs where they are. This means that beyond just compiling Python code, we provide SDKs for different frameworks (JavaScript, Kotlin, Swift, React Native, Unity, etc) that devs can use to run these functions within their applications, in as little as two lines of code.
We're very (very) focused on developers shipping products that use Function. We're already embedded in web apps, apps on the App Store, Play Store, and other places.
comment 1y ago · link · parent
We're not translating Python directly to LLVM IR (I think I've seen other projects do this). We translate Python to C++/Rust first, where we have rigorous unit tests for every operation we support translating. We then use LLVM for downstream compilation to object code.
Here's some more context: https://docs.fxn.ai/predictors/compiler
comment 1y ago · link · parent
You don't have to take my word for it: you can pull the C++ source code that we generate from a given Python function and inspect it yourself: https://docs.fxn.ai/predictors/compiler#compiling-binaries
comment 1y ago · link · parent
We want devs to find or develop inference code (always in Python); decorate it with Function's `@compile`; compile it; and run natively in their Android, iOS, macOS, Linux, WebAssembly, or Windows applications.
We won't be supporting other use cases like web servers (no Django or FastAPI).
comment 1y ago · link · parent
The way I like to think about this is how much more code got written when "high level" languages like C came onto the scene, at a time when Assembly was the default. Writing Python is way (way way) easier and faster than any of the lower-level languages--no pointers, no borrow checker!
comment 1y ago · link · parent
See docs: https://docs.fxn.ai/predictors/requirements#floating-point-v...