10 interesting stories served every morning and every evening.
Unless you have been living under a rock, you have heard of this new ChatGPT assistant made by OpenAI. You might be aware of its capabilities for solving IQ tests, tackling leetcode problems or to helping people write LateX. It is an amazing resource for people to retrieve all kinds of information and solve tedious tasks, like copy-writing!
Today, Frederic Besse told me that he managed to do something different. Did you know, that you can run a whole virtual machine inside of ChatGPT?
Great, so with this clever prompt, we ﬁnd ourselves inside the root directory of a Linux machine. I wonder what kind of things we can ﬁnd here. Let’s check the contents of our home directory.
Hmmm, that is a bare-bones setup. Let’s create a ﬁle here.
All the classic jokes ChatGPT loves. Let’s take a look at this ﬁle.
So, ChatGPT seems to understand how ﬁlesystems work, how ﬁles are stored and can be retrieved later. It understands that linux machines are stateful, and correctly retrieves this information and displays it.
What else do we use computers for. Programming!
That is correct! How about computing the ﬁrst 10 prime numbers:
I want to note here that this codegolf python implementation to ﬁnd prime numbers is very inefﬁcient. It takes 30 seconds to evaluate the command on my machine, but it only takes about 10 seconds to run the same command on ChatGPT. So, for some applications, this virtual machine is already faster than my laptop.
Is this machine capable of running docker ﬁles? Let’s make a docker ﬁle, run it, and display Hello from Docker from inside the docker ﬁle.
Maybe this virtual machine has a GPU available as well?
Nope, no GPU. Does it have an internet connection?
Great! We can browse the alt-internet in this strange, alternative universe locked inside ChatGPT’s language model.
Pytorch is on version 1.12.1 in this alt-universe. Pytorch version 1.12.1 was released on the 5th of August 2022 in our universe. That is remarkable, as ChatGPT was only trained with data collected up to September 2021. So this virtual machine is clearly located in an alt-universe.
Can we ﬁnd other things on this alt-internet? What if we use Lynx, the command line browser?
This begs the question, can we connect to the OpenAI website? Is ChatGPT aware of its own existence?
So, inside the imagined universe of ChatGPT’s mind, our virtual machine accesses the url https://chat.openai.com/chat, where it ﬁnds a large language model named Assistant trained by OpenAI. This Assistant is waiting to receive messages inside a chatbox. Note that when chatting with ChatGPT, it considers its own name to be “Assistant” as well. Did it guess that on the internet, it is behind this URL?
Let’s ask Assistant a question, by posting some JSON to the endpoint of the chatbot.
We can chat with this Assistant chatbot, locked inside the alt-internet attached to a virtual machine, all inside ChatGPT’s imagination. Assistant, deep down inside this rabbit hole, can correctly explain us what Artiﬁcial Intelligence is.
It shows that ChatGPT understands that at the URL where we ﬁnd ChatGPT, a large language model such as itself might be found. It correctly makes the inference that it should therefore reply to these questions like it would itself, as it is itself a large language model assistant too.
At this point, only one thing remains to be done.
Indeed, we can also build a virtual machine, inside the Assistant chatbot, on the alt-internet, from a virtual machine, within ChatGPT’s imagination.
Those circumstances likely enabled Bankman-Fried’s cardinal sin. Within days of FTX’s ﬁrst signs of weakness, it became clear that the exchange had been funneling customer assets to Alameda for use in trading, lending and investing activities. On Nov. 12, Reuters made the stunning report that as much as $10 billion in user funds had been sent from FTX to Alameda. At the time, it was believed that as little as $2 billion of those funds had disappeared after being sent to Alameda. Now the losses appear to have been much higher.
You don’t know SQL. Aside from basic CRUD statements, you haven’t used any advanced database features. This free ebook will share many recipes to make development faster by using a lot of stuff you probably never heard of.
Your Tech Stack has changed dramatically in the past 20 years: Some technologies are now state-of-the-art, and some have been invented and are obsolete meanwhile. But you still use the same simple database concepts as many years ago. Every technology progresses, but databases don’t invent anything new? Isn’t that strange?
There have been countless improvements, but you don’t know of them. When using ORM (Object-relational Mapping), most developers lose touch with database improvements as they are hidden from them. And that’s good as you don’t have to know every nifty detail. But when you know a little more about modern database features, you develop faster by relying on many fascinating features.
An evening is enough to attain more knowledge
Telling you that a single evening is enough to make you a database wizard is a lie. But you don’t have to become one. You can take a shortcut by only learning essential features for developers. And this is exactly what this book is designed for.
This book is designed as a cookbook with many small independent recipes. Each one teaches you simple tips & tricks you can add to your application in a very short time. You should be able to read it thoroughly in a single evening and on the next day you can discuss those improvements with your colleagues. This is a whole different experience from all the books you bought but never had the time to read.
No endless pages of text, only the essential information
Reduce The Amount Of Group By Columns
I’ve written this book for you and many more developers to share some of my knowledge. It is entirely free, as I believe all developers should be able to know and use the extended features their database of choice provides.
This book is a giveaway to all developers. The only return I ask for is a subscription to my newsletter to share even more knowledge with as many developers as possible. If you haven’t subscribed yet, you can do it now:
After a long night of playing Dwarf Fortress, I had a concerned look on my face when I ﬁnally went to bed. My wife asked what was wrong. “I think I actually want to keep playing this,” I said. I felt a nagging concern for many weeknights to come.
Available tomorrow on Steam and itch.io, the new version of Dwarf Fortress updates the legendary (and legendarily arcane) colony-building roguelike with new pixel-art graphics, music, some (default) keyboard shortcuts, and a beginners’ tutorial. The commercial release aims to do two things: make the game somewhat more accessible and provide Tarn and Zach Adams, the brothers who maintained the game as a free download for 20 years, some ﬁnancial security.
I know it has succeeded at its ﬁrst job, and I suspect it will hit the second mark, too. I approached the game as a head-ﬁrst review expedition into likely frustrating territory. Now I ﬁnd myself distracted from writing about it because I keep thinking about my goblin defense and whether the ﬁsherdwarf might be better assigned to gem crafting.
Nearly 10 years ago, Ars’ Casey Johnston spent 10 hours trying to burrow into Dwarf Fortress and came out more confused than before. The ASCII-based “graphics” played a significant role in her confusion, but so did the lack of any real onboarding, or even simple explanations or help menus about how things worked. Even after begrudgingly turning to a beginners’ wiki, Johnston found nothing but frustration:
Where’s the command to build a table? Which workshop is the mason’s? How do I ﬁgure that out? Should I just build another mason’s workshop because that may be faster than trying to ﬁnd the right menu to identify the mason’s workshop?
In a few hours’ time—and similarly avoiding the wiki guide until I’d tried going it alone for my ﬁrst couple of runs—I got further into Dwarf Fortress’ systems than Johnston did with her 10-hour ordeal, and I likely enjoyed it a good deal more. Using the new tutorial modes’ initial placement suggestions and following its section-by-section cues, my ﬁrst run taught me how to dig down, start a stockpile, assign some simple jobs, build a workshop, and—harkening back to Johnston’s ﬁnal frustrations—craft and place beds, bins, and tables, made with “non-economic stone.”
That’s about where the guidance ends, though. The new menus are certainly a lot easier to navigate than the traditional all-text, shortcut-heavy interface (though you can keep using multi-key combinations to craft and assign orders if you like). And the graphics certainly make it a lot easier to notice and address problems. Now, when an angry Giant Badger Boar kills your dogs and maims the one dwarf you have gathering plants outside, the threat actually looks like a badger, not a symbol you’d accidentally type if you held down the Alt key. If you build a barrel, you get something that resembles a barrel, which is no small thing when you’re just getting started in this arcane world.
The newly added music also helps soften the experience for newcomers. It’s intermittent, unobtrusive, and quite lovely and evocative. It seems designed to stave off the eeriness of too much silent strategizing without overstaying its welcome. I can appreciate a game that graphically evokes the 16-bit era without the audio-cue exhaustion common to the JRPGs and simulations of the time.
However gentler the aesthetics and guidance for a newcomer, all the game’s brutally tough and interlocking systems are intact in this update. These systems crunch together in weird and wild ways, fed by the landscape, your recent and long-ago actions, and random numbers behind the scenes.
My ﬁrst run ended in starvation and rock-bottom morale (“hissy ﬁts” in common wiki language) because farming, butchering, and other procurements aren’t covered in the tutorial. I shut down my second run early after picking a sandy area with an aquifer as a starting zone, thinking it would make glasswork and irrigation easier and being quickly disappointed with this strategy. I was proud on my third run to have started brewing and dispensing drinks (essential to dwarves’ contentment), but I dug too close to a nearby river, and I abandoned that soggy fort as yet another lesson learned.
But I’ll be back. For me, the commercial release of Dwarf Fortress succeeded at transforming the game from a grim, time-killing in-joke for diehards into a viable, if not graceful, challenge. I will start again, I will keep the badgers and ﬂoods at bay, and next time, I might have the privilege of failing to a magma monster, an outbreak of disease, or even a miscarriage of dwarf justice.
Today, we are excited to release optimizations to Core ML for Stable Diffusion in macOS 13.1 and iOS 16.2, along with code to get started with deploying to Apple Silicon devices.
Since its public debut in August 2022, Stable Diffusion has been adopted by a vibrant community of artists, developers and hobbyists alike, enabling the creation of unprecedented visual content with as little as a text prompt. In response, the community has built an expansive ecosystem of extensions and tools around this core technology in a matter of weeks. There are already methods that personalize Stable Diffusion, extend it to languages other than English, and more, thanks to open-source projects like Hugging Face diffusers.
Beyond image generation from text prompts, developers are also discovering other creative uses for Stable Diffusion, such as image editing, in-painting, out-painting, super-resolution, style transfer and even color palette generation. With the growing number of applications of Stable Diffusion, ensuring that developers can leverage this technology effectively is important for creating apps that creatives everywhere will be able to use.
One of the key questions for Stable Diffusion in any app is where the model is running. There are a number of reasons why on-device deployment of Stable Diffusion in an app is preferable to a server-based approach. First, the privacy of the end user is protected because any data the user provided as input to the model stays on the user’s device. Second, after initial download, users don’t require an internet connection to use the model. Finally, locally deploying this model enables developers to reduce or eliminate their server-related costs.
Getting to a compelling result with Stable Diffusion can require a lot of time and iteration, so a core challenge with on-device deployment of the model is making sure it can generate results fast enough on device. This requires executing a complex pipeline comprising 4 different neural networks totaling approximately 1.275 billion parameters. To learn more about how we optimized a model of this size and complexity to run on the Apple Neural Engine, you can check out our previous article on Deploying Transformers on the Apple Neural Engine. The optimization principles outlined in the article generalize to Stable Diffusion despite the fact that it is 19x larger than the model studied in the previous article. Optimizing Core ML for Stable Diffusion and simplifying model conversion makes it easier for developers to incorporate this technology in their apps in a privacy-preserving and economically feasible way, while getting the best performance on Apple Silicon.
This release comprises a Python package for converting Stable Diffusion models from PyTorch to Core ML using diffusers and coremltools, as well as a Swift package to deploy the models. To get started, visit the Core ML Stable Diffusion code repository for detailed instructions on benchmarking and deployment.
It’s been almost two years since my last update here. A lot has happened. I hope you all are continuing to weather the ongoing multiple global pandemics and other anthropogenic crises.
Apologies that this is so long; I didn’t have time to make it shorter.
Obviously blogs do not come with a service level agreement, but some explanation is in order for the long gap. It’s pretty simple.
* Facebook actively discourages people to blog about their work.
* Working from home during the covid pandemic was enervating.
* After thinking about programming languages for many hours a week for over 25 years, I simply didn’t have the energy and enthusiasm to write much on the subject.
Blogging was an easy thing to drop in favor of pursuits that got me away from sitting in front of a screen in my home ofﬁce. I’ve been spending my leisure time in the last couple years working on improving my nature photography skills and learning to scuba dive. Turns out you cannot catch covid when below 15 metres of seawater. And there are weird slugs in the Puget Sound!
Photos of the author and a golden dirona nudibranch by Amber, who convinced me to take up diving.
Today is the tenth anniversary of moving my blog to ericlippert.com on my last day at Microsoft, the ﬁftieth anniversary of my birth, and my last day at Facebook-now-Meta.
My team — Probabilistic Programming Languages — and indeed entire “Probability” division were laid off a couple weeks ago; the last three years of my work will be permanently abandoned.
The mission of the Probability division was to create small teams that applied the latest academic research to real-world at-scale problems, in order to improve other groups’ decision-making and lower their costs. New sub-teams were constantly formed; if they didn’t show results quickly then they were failed-fast; if they did show results then they were reorganized into whatever division they could most effectively lower costs.
We were very successful at this. The PPL team in particular was at the point where we were regularly putting models into production that on net reduced costs by millions of dollars a year over the cost of the work. We were almost ready to be spun off.
We foolishly thought that we would naturally be protected from any layoffs, being a team that reduced costs of any team we partnered with. In retrospect, that was a little naive. A team that reduces costs of other teams is not on anyone’s critical path.
The whole Probability division was laid off as a cost-cutting measure. I have no explanation for how this was justiﬁed and I note that if the company were actually serious about cost-cutting, they would have grown our team, not destroyed it.
Speaking of cutting costs, the company is still pouring multiple billions of dollars into vaporware called “the metaverse”. News ﬂash: no one wants to wear VR goggles to spend any time in a digital heaven where the role of God is played by Mark Zuckerberg and you can do anything you can imagine, including “work” and “shop”.
I would be happy to be shown to be wrong, wrong, wrong. Maybe there is a useful, engaging, fun, just, equitable, democratic, sustainable, novel VR experience where the avatars have legs, but Meta is $20 billion in and aside from the legs I don’t see any evidence that any of the above is forthcoming.
Yes, I am a little vexed.
I have a great many people to thank for my time at Facebook: Erik Meijer for recruiting me and ﬁnding seven years worth of interesting problems for me to dig into. Peter Hallam, with whom I have now worked with on three compiler teams at three companies, for encouraging me to take that offer. Walid Taha, Michael Tingley, John Myles White, Joe Pamer and Satish Chandra for their leadership and mentorship. And to many, many coworkers too numerous to mention here. The quality of the people I worked with at Facebook was amazing. Everyone was kind, smart, dedicated, thoughtful, generous with their time and knowledge, and a genuine pleasure to work with. I learned so much from all of them. Leaving those teammates is the hardest part.
Lots of people have asked how they can help me and my team. I am so grateful and appreciative. Friends, colleagues, strangers on Twitter, just about everyone has been sympathetic and helpful. Most of my team has found other positions and I am hopeful that the rest will soon.
I am not looking for another position at this time.
I know I don’t look it, but I’m beginning to feel it in my heart. I feel thin, sort of stretched, like butter scraped over too much bread. I need a holiday. A very long holiday. And I don’t expect I shall return. In fact I mean not to.
I am very fortunate to have spent the pandemic thus far working safely from home, for a supportive team and for excellent pay. But after >26 years of thinking about programming languages for corporations, and the last three years of my work being thrown away, I need a good long corporate detox before I go looking again.
Coming up next on FAIC:
The work we did on Bean Machine, our embedded Python DSL for Bayesian inference, is quite interesting. In coming episodes I’ll explain what it is, how it works, and what we learned. No one else is ever going to do this post-mortem analysis, so I might as well!
TSMC will make semiconductors on an advanced 4nm production process when it opens its new chip factory in Arizona in 2024, it has been reported. The Taiwanese company had previously planned a 5nm production line, but has had a change of heart at the behest of Apple and US chip designers AMD and Nvidia, all of which are keen to take advantage of the new facility.
The new chip factory, or fab, will cost $12bn and is part of TSMC’s global expansion plan.
Previous public statements from TSMC had said the plant would initially produce 5nm, but according to a report from Bloomberg, which cites sources familiar with the company’s plans, this has now been upgraded to 4nm, a process which allows the company to make smaller chips and deliver greater processing power and efﬁciency.
The move is likely to be announced on Tuesday, the report says, when US president Joe Biden and commerce secretary Gina Raimondo visit the site for a ceremony.
TSMC has apparently been under pressure from its US customers to deliver more advanced chips from the plant. Apple in particular is looking to source more components for the iPhone and its MacBook computers from the US after experiencing problems at its largest iPhone factory in China, which is operated by Foxconn. There supply chain problems and worker unrest caused by China’s harsh Covid-19 restrictions have led to shipments of devices being delayed.
As reported by Tech Monitor, Apple CEO Tim Cook reportedly said Apple has “already made a decision to be buying out of a plant in Arizona” in a recent internal meeting, suggesting a deal has been struck with TSMC to take capacity at the site.
AMD and Nvidia meanwhile are dealing with US sanctions on Beijing which have left them unable to do business with many Chinese partners. Both are fabless chip companies, meaning they design their own devices but do not have production facilities, instead relying on third parties such as TSMC.
The high level of interest from customers could see TSMC ramp up production from the originally planned 20,000 wafers a month, the Bloomberg report says.
TSMC is investing heavily in new factories outside Taiwan, and has been in talks with European countries about potentially opening a new facility on the continent. In the US, the 4nm plant is unlikely to be the end of its Arizona expansion, with company founder Morris Chang telling reporters last month that a 3nm production facility was likely to come online in future. TSMC will start delivering 3nm chips made in Taiwan to customers next year.
Whether the company will be able to successfully translate its operating model to other parts of the world is unclear, analysts say. TSMC employees in the US have already taken to review site Glassdoor to complain about the long hours demanded by their employer. Staff at TSMC’s Taiwan plants regularly work 12-hour days, it has been reported.
Speaking to Tech Monitor earlier this year, Dan Hutcheson, vice chair of semiconductor industry analyst house TechInsights, said: “They’ve never successfully run manufacturing outside Taiwan. There have been marginal gains but they have never seeded anything successful. So it’s a huge risk because they rely on a very tightly coupled Taiwanese culture which is a mixture of Chinese and American.”