A Deep Investigation into MMAP Not Leaking Memory

September 28, 2022 by stas | No Comments | Filed in Machine Learning, Software Engineering

This write up is going to demonstrate that while it looks that a mmap‘ed file IO looks like it’s leaking memory it actually is not.

HuggingFace’s datasets project uses MMAP to make datasets available to multiple processes in an efficient way. This is very important since typically a machine learning training program will use a Dataloader which may use multiple workers, or alternatively the same dataset is simply accessed by multiple processes.

An issue was posted that suggested that a datasets-based program leaks memory with each iteration. This triggered an extensive research into understanding that MMAP doesn’t leak memory and bringing a lot of deepeer understanding of the different components used under the hood of datasets.

If you’d like to gain a deeper understanding into why and how please read on.
Read the rest of this entry »

Tags: , , , ,

Getting NVIDIA A100-80GB PCIe to work on a consumer motherboard with custom water cooling

April 14, 2022 by stas | 8 Comments | Filed in Machine Learning

For the last few months I have been trying to get A100 80GB PCIe to work on my desktop computer.

The first stage was to get the card recognized by BIOS and then the OS which took quite some figuring out.

The second stage was to get a custom water cooling solution, since A100 runs really hot and it’s very difficult to cool with just fans and typically requires a server-level cooling hardware and a server room with air conditioning.

But after a few months of trials and tribulations I have a working solution, which I’ll share with you in this post. Read the rest of this entry »

Tags: , , ,

Play a Game to Understand The Learning in Machine Learning

January 28, 2020 by stas | No Comments | Filed in Machine Learning

This is an introduction article to Machine Learning, and its various concepts, that even a high-school student should be able to understand. We are going to play with blocks and through that game understand how Machine Learning works.

The big news nowadays is Machine Learning (ML). But what is it? The machine part is obvious – it’s the computer that does the learning. But the learning part may appear as tricky, even though in reality it’s a very simple thing in its foundation. Let’s gain an intuitive understand of the learning in ML.

Let’s play a game

I don’t know if you have ever played a computer game where you have a ball at a starting position, and you have to direct it to a target with the help of blocks, springs, rotating gears, etc. The original game was named The Incredible Machine. It usually relies on the laws of physics and you need to re-arrange those helper components to make the ball move from let’s say the left top corner of the screen to the right bottom of the screen where some sort of a target is located. The way you play the game is by experimenting with the block arrangement, so that they will do the work of guiding the ball to its target.

Here is a possible initial game board setup:

Read the rest of this entry »

Tags: , ,

Stop Making Money for Social Networks!

January 24, 2020 by stas | No Comments | Filed in Marketing

Many businesses, especially, independent entrepreneurs spend a lot of time and money on social networks in hope that the effort will lead to a steady stream of customers.

Unfortunately, this doesn’t work, because those who run social networks have a conflicting interest with yours.

Welcome to the Social Network Black Hole

Social networks primarily make income from advertising. In order to be able to sell advertisement placements, the social networks need a lot of eyeballs and that requires minions to generate new content all the time. Who are those minions? Well, it’s most of us…

Read the rest of this entry »

Tags: , , ,

How Chinese companies generate real-fake reviews on Amazon

January 24, 2020 by stas | No Comments | Filed in Marketing

You’re probably aware that most social networks are loaded with fake likes and reviews, and it’s quite cheap to buy those if you’d like your profile boosted. In the past an entrepreneur would arrange a network of participants who for a small monetary token would like and/or write fake reviews.

These days, with extremely powerful realistic text-generating machine learning engines like GPT-2, this technique becomes more and more automated and no longer requires networks of humans to create fake things. It’s the domain of AI agents these days.

But, in the domain of online stores these machinations are still tricky to do, since unlike online profiles that have no physical boundaries, real products are bound by hard coins and thus it’s much more difficult to game. But, of course, it’s being gamed.

The name of the game is generating multiple positive reviews by buying them with freebies.

Read the rest of this entry »

Tags: , ,

Authors of Aging Tech Books on Amazon Will Have Their Ratings Dropped

January 24, 2020 by stas | 2 Comments | Filed in Machine Learning, Marketing

TL;DR: Amazon has implemented a new strategy of giving old reviews a significantly lower weight than the newer ones. And should anybody post a single bad review as of recent, which would be normal for outdated tech books, that review will pretty much define the quality of the book (== terrible).

Gaming reviews has been a big issue for any marketplace, and in particular on Amazon. Amazon does a pretty so-so job at weeding out fake reviews out as it is gamed freely by some Chinese vendors in an inventive way that appears legit. But it has recently deployed a new strategy of how it weighs each given review. Reviews with no ‘Verified Purchase’ tag get a lesser weight than those with the tag, and older reviews get progressively less weight in the game.

Read the rest of this entry »

Tags: , , , ,

Online Scammers Are Getting More Creative

September 22, 2017 by stas | No Comments | Filed in General

My email address has been online since 1999, so I get a lot of spam emails, a big chunk of which is scam emails. Most of such scam emails you are well familiar with – the kind someone is asking you to help them transfer $5M inheritance to some poor widow. Obviously I never reply to any of those.

Today one of the scammers almost got me.

I do healing work amongst other things and today I received what seems to be a normal contact from a potential client with a slightly odd side to it.

Hello, i’m kylie , i would like to know if you are a Wellness Coach or Reiki Healing and if you accept credit card for payment?

I follow up, yes, sure. I get next:

Read the rest of this entry »


How Amazon Discriminates Against Small Publishers

June 10, 2017 by admin | 2 Comments | Filed in General

It’s well known that Amazon is loved by online shoppers, mainly due to its amazing customer support. Amazon is now a lot more than a big online shop, as they annexed a bunch of other businesses to it. One of which is a publishing business. This department unfortunately can’t be called amazing. Here is my little story to showcase what’s happening behind the scenes and how injustice is done to the long tail.

As of this writing I have published 4 books. First with O’Reilly and Associates, second with Onyx Neon Press, and the the most recent two I self-published via Amazon KDP (Kindle Digital Publishing).

Publishing via KDP was OK, they still have a long way to go to make things smooth, the main gift to us was to make it possible to publish books without needing to convince a mainstream publisher to want to publish them. When things work, they work, when there are problems, usually after stumbling through a few clueless support people, eventually you hit someone who knows their business and things get resolved. All was good.

Read the rest of this entry »

Tags: ,

How To Get Hired – an Infallible Scheme Invented by Mark Twain

December 16, 2015 by stas | 2 Comments | Filed in General

young mark twainMark Twain invented an infallible scheme for anyone to get hired. He describes his scheme and how he got three men to get a job using this scheme in the following text. The approach worked more than 100 years ago and chances are that it’ll still work just the same today as human nature hasn’t really changed that much in such a “short” period of time.

Higbie was the first person to profit by my great and infallible scheme for finding work for the unemployed. I have tried that scheme, now and then, for forty-four years. So far as I am aware it has always succeeded, and it is one of my high prides that I invented it, and that in basing it upon what I conceived to be a fact of human nature I estimated that fact of human nature accurately.

Higbie and I were living in a cotton-domestic lean-to at the base of a mountain. It was very cramped quarters, with barely room for us and the stove-wretched quarters indeed, for every now and then, between eight in the morning and eight in the evening, the thermometer would make an excursion of fifty degrees. We had a silver-mining claim under the edge of a hill half a mile away, in partnership with Bob Howland and Horatio Phillips, and we used to go there every morning carrying with us our luncheon, and remain all day picking and blasting in our shaft, hoping, despairing, hoping again, and gradually but surely running out of funds. At last, when we were clear out and still had struck nothing, we saw that we must find some other way of earning a living. I secured a place in a near-by quartz mill to screen sand with a long-handled shovel. I hate a long-handled shovel. I never could learn to swing it properly. As often as any other way the sand didn’t reach the screen at all, but went over my head and down my back, inside of my clothes. It was the most detestable work I have ever engaged in, but it paid ten dollars a week and board-and the board was worth while, because it consisted not only of bacon, beans, coffee, bread and molasses, but we had stewed dried apples every day in the week just the same as if it were Sunday. But this palatial life, this gross and luxurious life, had to come to an end, and there were two sufficient reasons for it. On my side, I could not endure the heavy labor; and on the Company’s side, they did not feel justified in paying me to shovel sand down my back; so I was discharged just at the moment that I was going to resign.

Read the rest of this entry »

How to Get Your Business Cards for Free

November 11, 2011 by admin | 1 Comment | Filed in Advertising

update: this is an old article – vistaprint gives no free biz cards for free these days.

Running a small business can be tough, especially in the current economy conditions where clients aren’t easy to come by, so keeping your expenses to the minimum is a certain way to improve your bottom line. When it comes to promotional materials, one could spend a lot of money there. And business cards are usually the most commonly used way to promote one’s business. It’s the magic handshake protocol most entrepreneurs are so familiar with:

– “What do you do?”

– “I’m a Registered Massage Therapist. What about you?”

– “I’m a Reiki Master, and here is my business card. Can I have your card?”

– “Of course, here it is.”

The Internet has been around for a relatively long time by now, yet, business cards aren’t a thing of a past and it’ll probably take quite some time before one will not carry any around with them anymore and not leave a few here and there on various posting boards in caf├ęs and community places.

Business cards have been around for centuries (In China since 15th century, Europe – 17th century) . So it’s not surprising that these days there are many shops that will print your business cards in various shapes and forms, using different fancy kinds of paper and color. But they can be quite expensive, especially if someone designs them from scratch – since you’re paying for their time, their rent costs, etc.

Read the rest of this entry »