[HN Gopher] What's up in the Python community? - April 2023
___________________________________________________________________
What's up in the Python community? - April 2023
Author : BiteCode_dev
Score : 91 points
Date : 2023-04-28 20:54 UTC (2 hours ago)
(HTM) web link (bitecode.substack.com)
(TXT) w3m dump (bitecode.substack.com)
| skilled wrote:
| I never saw this newsletter before but I must say I am impressed.
| Fantastic approach to writing style and a great showcase of
| domain knowledge.
|
| The Web could use more of this.
| Qem wrote:
| > Python 3.12 improves the language perf by 4%
|
| A bit shy of the original target of 50% improvement per release,
| totaling 5x speedup across four releases. Hope it catches up in
| the next couple releases.
| kzrdude wrote:
| Python 3.12 also does not exist, because it has not been
| finished and released yet. So there's time.
| mathisfun123 wrote:
| "my wife is pregnant but my kid doesn't exist yet"
|
| hmmm
| slicktux wrote:
| Even with hardware like the raspberry pi Pico I still find myself
| programming them using C...
| gverrilla wrote:
| Question from a beginner: I'm deploying a python project to aws
| (beanstalk + lambda, among others), and I've noticed I can only
| use python versions 3.9 and 3.8. Why is that? Is 3.10 not
| considered stable?
| atwebb wrote:
| Lambda support was added this month:
|
| https://aws.amazon.com/about-aws/whats-new/2023/04/aws-lambd...
| roflyear wrote:
| I don't know why it is, but 3.10 and 3.11 are considered stable
| (and I would suggest you use 3.11 if you can).
| __s wrote:
| Cloud providers tend to be pretty slow to provide up to date
| software versions, I wouldn't rely on them to signal what
| versions are stable
|
| I'm personally watching https://learn.microsoft.com/en-
| us/answers/questions/1191155/... because Sidekiq 7 requires at
| least Redis 6.2, but Azure Cache decided only major version
| upgrades matter
|
| This should give you a better idea of Python version status:
| https://devguide.python.org/versions
| b33j0r wrote:
| It's that a lot of the libraries take a while to catch up.
|
| 3.10 is pretty good to use lately with PyTorch and numpy, which
| I mention because they are usually the main stragglers I have
| to track. They are both compiled with your friendly local
| architecture's stack.
|
| Pydantic and FastAPI almost fell over because of changes to
| annotation handling, but woosh. That drama was forestalled.
|
| I think the python 3.3+ series has confused a lot of people
| because major version improvements have been crammed into the
| process.
|
| Guido, if you're reading, we should have just gone to 4 when we
| changed so many things. I get why we were hesitant of
| versioning after the str/unicode upgrade broke everyone, but
| like...
|
| There are versions of 3 that we had to almost immediately
| deprecate. The javascript community is probably laughing at us.
| jokoon wrote:
| I just tried some pre-trained models to classify images, using a
| CPU, it takes about 10s to 15s per image.
|
| I did not know it was so inefficient.
| chaostheory wrote:
| Isn't the problem that you were relying more on the CPU rather
| than a decent GPU?
| codethief wrote:
| Would you share some details? This indeed sounds very slow, so
| I suppose there should be some easy ways to speed things up.
|
| Just to give you an idea of what's possible: A couple years ago
| I worked on live object recognition & classification (using
| Python and Tensorflow) and got to about ~30 FPS on an Nvidia
| Jetson Nano (i.e. using the GPU) and still ~12 FPS on an
| average laptop (using only the CPU).
| jokoon wrote:
| https://replicate.com/pharmapsychotic/clip-interrogator
|
| using:
|
| cfg.apply_low_vram_defaults()
|
| interrogate_fast()
|
| I tried lighter models like vit32/laion400 and others etc all
| are very very slow to load or use (model list:
| https://github.com/mlfoundations/open_clip)
|
| I'm desperately looking for something more modest and light.
| quickthrower2 wrote:
| I am trying to understand your point. Are you saying it could
| be more efficient on a CPU using a different language than
| Python? Or are you saying CPUs are slow, GPUs should be used?
| Or are you saying classifying images algorithms can be improved
| more?
| riotnrrd wrote:
| The neural network inference (and training) is all done in
| compiled C libraries called by Python. The inefficiencies
| you're seeing are because you're doing it on a CPU, probably in
| one thread, rather than on a GPU with tens of thousands of
| "threads."
| nologic01 wrote:
| While the hyperbole around AI might calm down a bit, the broader
| 'data science' domain is unlikely to diminish in importance and
| may generate new hypes. And in the short to medium term Python
| will certaintly play a core role in these developmemts.
|
| Yet what I am missing in the news is some hint of where Python is
| going longer term. What will 4.0 look like? Which of the know
| limitations will be addressed? Will it ever be performant on a
| standalone basis? Will it ever be native on mobile? Etc.
| qbasic_forever wrote:
| I was browsing the most popular pip packages recently and was
| also downright shocked how much AI stuff is up at the top. I will
| be very curious if much of these things are still popular or
| relevant in a year.
| mathisfun123 wrote:
| So weird - you really think AI/ML is a flash in the pan when it
| comes to Python? You realize pytorch, tensorflow, pandas,
| numpy, scikit-learn are all approaching 10 years on pypi?
| qbasic_forever wrote:
| Yeah all the stuff I was seeing seemed to be variations and
| light wrappers around openai APIs and such. We don't need a
| million versions of those things, one or two clear 'winners'
| should emerge. You can see them here, expand it to 50 per
| page and start browsing down after the usual suspects:
| https://awesomepython.org/
| mathisfun123 wrote:
| I'm sorry but I think you don't know what you're looking at
| - of the NN things in the top 50 there I see 4 such
| wrappers. The remainder are the NN frameworks and various
| perf motivated implementations.
|
| Also I don't know how this list is built but it seems to be
| literally measuring current popular things - so by
| definition no matter when i visit this list whatever is it
| at the top will probably wane in population shortly after
| I've visited.
| forrestthewoods wrote:
| Python has exploded in popularity over the past ~7 years
| because of AI. Python's ever increasingly relevance is directly
| tied to AI.
| tomrod wrote:
| And Flask, and FastAPI, and pandas, and pola.rs, and numba,
| and as glue code, and....
|
| "AI" is pretty narrow, but the python ecosystem is massive,
| which a strong incumbency in the data processing space.
| Weird, since it isn't a typed is a dynamically language,
| where sometimes placeholders like pandas `object` result in
| unexpected behavior, but it sure is simple to write something
| quick.
| Tommstein wrote:
| > "AI" is pretty narrow, but the python ecosystem is
| massive, which a strong incumbency in the data processing
| space. Weird, since it isn't a typed language . . . .
|
| Having used it for over 15 years, I assure you Python is a
| strongly typed language.
| tomrod wrote:
| Fair, I was wrong. It's a dynamically typed language.
| twic wrote:
| > "AI" is pretty narrow, but the python ecosystem is
| massive, which a strong incumbency in the data processing
| space. Weird, since it isn't a typed language
|
| Nor is Excel, and that didn't stop it.
| Spivak wrote:
| By volume of different projects probably not, but by usage
| probably. Once winners get decided and paths get treaded the
| ecosystem will probably be smaller but I bet the user count
| will be bigger.
|
| Look, even if you're the most biggest skeptic of all the AI
| stuff you can still do useful things with it that you couldn't
| before like present full-English interfaces and get embeddings
| for arbitrary text which is a _leap_ compared to word2vec for
| search. I can dm my discord bot a picture of an appointment
| confirmation text and it with OCR + LLm it just schedules the
| event in my calendar. Also by gluing a v8 isolate to the LLm I
| can give it much more complicated date calculations. My
| favorite was "If f(n) is the nth Fibonacci number schedule an
| appointment in f(5) days."
| nwiswell wrote:
| > you can still do useful things with it that you couldn't
| before like
|
| > ...
|
| > If f(n) is the nth Fibonacci number schedule an appointment
| in f(5) days
|
| hmmm
| IanCal wrote:
| That's absolutely not what they said. Let's keep hn better
| than that.
| nwiswell wrote:
| It's obviously tongue-in-cheek, but it's also not _not_
| what they said.
| IanCal wrote:
| It is not what they said. That was an example of
| complicated work with dates, which easily hits the level
| of "more complicated than you need". Before that, and
| before the cut in the quote was an obvious use case
| easily explained. I don't know why you want to go down
| this route but I won't engage further.
| axutio wrote:
| Is this a setup you've already built? Could you outline what
| you've glued together for this bot?
| LispSporks22 wrote:
| I'm bummed out about the ever expanding Python packaging scene.
| tomrod wrote:
| This is a nice summary! Subscribed.
| arunkant wrote:
| Python packaging is coming along quite good
| pphysch wrote:
| Very bullish on Python. PyScript is coming along nicely as well,
| with the core devs having some clear ideas about how to tackle
| load times.
| ineedasername wrote:
| _> Most new Python projects are still about AI_
|
| Are there any that allow a user to run an LLM with GPT-3-ish
| capabilities on a single pc w/ <= 4GB GPU Ram in a reasonable
| amount of time?
|
| Where "reasonable" is something like no more than a few minutes
| to get the output. A little longer wouldn't be too bad either
| since you could script something that submits prompts
| automatically and let things run in the background or something.
|
| Trying to search for such a thing-- if it exists-- is nearly
| impossible right now with so much being done & talked about. Some
| content talks about running something on _only_ 16GB GPU ram
| (!!!) which is far beyond many discrete cards. a 3080 has up to
| 16, some only 8 (I think 16 is the max?) and fairly decent entry
| level+ cards top out at 4GB.
|
| Any options out there?
| LanternLight83 wrote:
| If you're really alright with a few minutes delay, you might be
| able to run =<13b param. models on CPU
___________________________________________________________________
(page generated 2023-04-28 23:01 UTC)