cloudpickle
extrainterpreters
cloudpickle | extrainterpreters | |
---|---|---|
5 | 3 | |
1,584 | 100 | |
1.6% | - | |
6.0 | 7.4 | |
about 1 month ago | 5 months ago | |
Python | Python | |
GNU General Public License v3.0 or later | GNU Lesser General Public License v3.0 only |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
cloudpickle
-
No-GIL mode coming for Python
I believe you just pass objects instead, like you would in OOP, and take the hit of pickling and unpickling them every time.
If you really want to pass lambdas, you can use a third party library to pickle them
https://github.com/cloudpipe/cloudpickle
Yes, this is not great.
-
Is it possible pickle a function with its dependencies?
That was my understanding as well but then I found this package -- cloudpickle which seems to serialize both data and functionality?
- Issue with sklearn
-
I'm learning monads by implementing IO in different languages
It used in production for several months now. We use it to train data science models. The main goal was to make multiprocessing code easier. It actually works great with multiprocessing, especially if you use a library able to serialize lambda functions such as https://github.com/cloudpipe/cloudpickle . I have yet to write a tutorial on how to use multiprocessing and cloudpickle to distribute work to all the worker processes. Thanks for letting me know about pfun. I've never heard of it. Having a look at its documentation, our goals seem to be very close. The features I wanted above all where:
extrainterpreters
- Utilities for using Python's PEP 554 subinterpreters
-
No-GIL mode coming for Python
It's basically becoming reality already, PEP 684 per-interpreter gil is the required structure for this (coming in Python 3.12), now only interface on top of that remains, see WIP like https://github.com/jsbueno/extrainterpreters the full interface to gil-free interpreter threads is coming in
-
Real Multithreading Is Coming to Python
Important to note that this is different from the nogil project ( https://github.com/colesbury/nogil ) - this is about the feature that's landing soon in Python 3.12 which will allow multiple Python sub-interpreters each with their own GIL - hence enabling Python code to run multi-threaded in the same process, albeit with a fair amount of extra work to co-ordinate between those different interpreters.
The tutorial itself is fantastic - it's not an easy feature to try out right now but I got there by following the step-by-step instructions.
Also interesting is this project, linked to from the end of the tutorial: https://github.com/jsbueno/extrainterpreters
Posted my own set of short notes on my blog: https://simonwillison.net/2023/May/15/per-interpreter-gils/
What are some alternatives?
pex - A tool for generating .pex (Python EXecutable) files, lock files and venvs.
problems - Discussions about problems with the current C Api
pants - The Pants Build System
nix - Nix, the purely functional package manager
raffiot.py - Robust And Fast Functional IO Toolkit
CPython - The Python programming language
scala-cli - Scala CLI is a command-line tool to interact with the Scala language. It lets you compile, run, test, and package your Scala code (and more!)