r/FunMachineLearning • • Dec 25 '18

The Latest Siraj Raval on YouTube

Thumbnail
youtube.com
3 Upvotes

r/FunMachineLearning • • Dec 10 '18

The Latest Siraj Raval on YouTube

Thumbnail
youtube.com
3 Upvotes

r/FunMachineLearning • • Nov 20 '18

The Latest Siraj Raval on YouTube

Thumbnail
youtube.com
3 Upvotes

r/FunMachineLearning • • 7d ago

CPU based Optimizer (Peanut)

2 Upvotes

Hello community,

We published two new files for Peanut as our thought direction. We need your support by various ways. We invite you to experiment our optimizer and tell us, even if they are negative, the ways that we can make it better.

Roadmap: https://github.com/dskc/peanut/blob/main/ROADMAP.md - where we are going, 6 baselines, 7 metrics, 4 unproven gaps to close

Evolution Log: https://github.com/dskc/peanut/blob/main/EVOLUTION_LOG.md - dated log of each experiment with results, like release notes, including failures

Our direction: CPU-only is a design decision, not a shortcoming. We will prove Peanut with same datasets, same models, properly tuned LRs, 5 prime seeds.

Tell us:

  1. Are we missing a baseline?

  2. Is our metric priority right?

  3. Should we test something else before adding new features?

  4. What metrics should we collect, such that it is proved better than the current optimizers

Thank you for reading till now.


r/FunMachineLearning • • 7d ago

Llama 3.2 1B, Kokoro TTS and Whisper all running in the browser for a racing game's team radio

2 Upvotes

I built Pitwall, an open-source race-strategy game where the team radio is fully on-device. It uses Transformers.js with WebGPU, and there's no backend.

  • Llama 3.2 1B (q4f16): answers free-form questions in character, grounded in a per-car fact sheet. Replies quoting numbers that aren't in the facts are dropped, and the model can't issue game commands.

  • Kokoro-82M: seven voices, rendered sentence by sentence.

  • Whisper tiny.en: prompted with the game's vocabulary. On a synthetic benchmark this raised command accuracy from 53% to 87%.

Code (MIT): https://github.com/rajvardhan19/pitwall · Play: https://rajvardhan19.github.io/pitwall/


r/FunMachineLearning • • 10d ago

Funkiest Zoom meeting EVER (Surprise video) - Two Minute Papers

Thumbnail
youtube.com
2 Upvotes

r/FunMachineLearning • • 10d ago

I made some improvements and would love to hear your feedback

2 Upvotes

Hey everyone,
I've been building ModelAnalysis.si, a free site that lets you compare AI models side by side on quality, price and speed. It also helps you work out what it would cost to run them for your own use.
I've just made a round of improvements and fixed some bugs and inconsistencies and made a general
cleanup so everything feels smoother
You can try it here: https://modelanalysis.si
I'd love your honest feedback.
What's confusing, what's missing, and what would make it more useful to you? Anything you'd like to see added?


r/FunMachineLearning • • 12d ago

The hero can lift a boulder. The teacup requires a separate plan.

Post image
2 Upvotes

A stop-motion character with enormous hands, trying to pick up a tiny teacup. That’s the whole scene I’d like to build.

The design question comes first: how large can the hands get while the gesture still looks careful?

With CapCut Web’s offer of seven days of unlimited image generation, I’d sketch a few versions of that same problem. Long fingers, round fists, a cup that nearly disappears between them.

Then make a rough physical hand-and-cup test: the wrist turns, the cup tilts, the other hand quietly comes to help. A character with world-saving confidence can still need complete silence to manage a sip.


r/FunMachineLearning • • 13d ago

I built a handwritten digit recognizer Neural Network completely from scratch in C++ (No Python, No ML Libraries, Custom Matrix Math)

2 Upvotes

r/FunMachineLearning • • 14d ago

10 empty sparks

2 Upvotes

Hey,

I started GPUwerk a few months ago. I had two DGX Sparks sitting idle and wanted someone to actually use them, so I built a simple platform where people can list their Sparks and earn a bit from them.

Right now I have 10 empty Sparks. Rather than let them sit, I'd rather give the hours away to people who will actually use them and tell me what they think.

You don't need a card, and it isn't a trial that starts billing later. Just time on a full DGX Spark (128GB unified memory) if you'll give me honest feedback after you try it.

If you want hours on one, comment what you'd like to use it for and I'll follow up.

Thanks.


r/FunMachineLearning • • 15d ago

I built my own 15M parameter AI model from scratch. It runs on CPU!

Thumbnail
reddit.com
2 Upvotes

r/FunMachineLearning • • Oct 19 '26

making my own ai from scratch

Thumbnail
gallery
2 Upvotes

my progress so far


r/FunMachineLearning • • Oct 18 '26

Do you remember SETI@Home. Decentralized Branch-Train-Mix Sparse MoE Upcycling & Speculative Swarm Inference over Consumer GPUs via DiLoCo-QLoRA and BOINC - Starting on old RTX 2070 !!! Let's build together HiveMind@Home

Post image
2 Upvotes

r/FunMachineLearning • • Oct 16 '26

I’m building Math2Model — implementing machine learning algorithms from scratch to understand the math behind them

Post image
2 Upvotes

r/FunMachineLearning • • Oct 14 '26

train the best model you can on your mac in one hour

2 Upvotes

i wanted to train my own llm but everything i found needed an nvidia gpu, so i made a mac version with mlx.

one command downloads tinystories, trains a tokenizer, pretrains a small llama-style model, finetunes it for chat, then you can talk to it.

on my m5 air (16gb): 1 hour gets an 8M model that writes short kids stories, 8 hours gets a 40M one that's a bit better. neither can really chat yet. the air didn't throttle in either run.

there's also a 2 min benchmark if you want to see how your mac compares.

https://github.com/navthings/airgpt


r/FunMachineLearning • • Sep 25 '26

Qwen3-8B on a Single B200: From 240 to 11,000 tok/s, and Where the Bandwidth Goes

2 Upvotes

One B200, one 8B model, seven concurrency levels. This post looks at LLM inference from an SRE's point of view: why a single request is slow, why batching is nearly free, and how to turn benchmark numbers into a capacity plan. Every script is at the end so you can reproduce it.

  • Single-request decode is a memory-bandwidth problem. Every output token requires reading all 16 GB of weights. Measured TPOT is 4.08 ms, about 4 TB/s of effective bandwidth (B200 is rated at roughly 8 TB/s).

  • Batching is nearly free throughput. Going from 1 to 16 concurrent requests raises total throughput 14× while each user gets only 9% slower.

  • The knee is between 64 and 128 concurrent requests. Past that, throughput gains only 18% (then drops), and P99 time-to-first-token goes from 0.3 s to 3 s.

  • At high concurrency the bottleneck moves from weights to the KV cache. At 128 concurrent requests, each decode step reads about 22 GB of KV cache, more than the 16 GB of weights.

  • Capacity takeaway: with an SLO of at least 100 tok/s per user and P99 TTFT under 1 s, the operating point for one GPU is 64–96 concurrent requests, about 10,000 output tok/s.

1. Setup

ItemConfiguration
GPUNVIDIA B200 (1 of 8 used, 179 GB usable)
Driver / CUDA580.178 / 13.0
EnginevLLM 0.30.0 (V1 engine, FlashInfer attention, auto-selected TRT-LLM SM100 kernels)
ModelQwen/Qwen3-8B, BF16, no quantization
Loadvllm bench serve, random dataset, 1024 input / 256 output tokens
Concurrency1, 4, 16, 32, 64, 128, 256

2. Where the GPU memory goes

The vLLM startup log reports:

UseSize
Model weights15.27 GiB
CUDA graphs0.97 GiB
KV cache145.16 GiB

About 90% of GPU memory goes to the KV cache, not the model. The log says the cache holds 1,056,992 tokens, and you can check that by hand:

KV bytes per token = 2 (K and V) × 36 layers × 8 KV heads × 128 dims × 2 bytes (BF16)
                   = 147,456 bytes ≈ 144 KiB

145.16 GiB ÷ 144 KiB ≈ 1,057,000 tokens  ✓

Every token of context costs 144 KB of GPU memory. That is why long context is expensive, and it is the basic formula for capacity planning. With the full 40K context, one GPU can hold about 26 requests at once. At an average of 2K tokens, it can hold over 500.

3. Results

ConcurrencyOutput throughput (tok/s)Per-user speed (tok/s)TPOT (ms)P99 TTFT (ms)P99 ITL (ms)
12412454.08304.5
49042434.12594.6
163,3782244.47965.8
326,0542024.9616011.1
649,5991616.2029915.1
12811,3459710.3077386.2
25610,8015817.293,071188.3

TPOT is the mean time per output token after the first. TTFT is time to first token. ITL is the gap between consecutive tokens. Per-user speed is 1000 / TPOT.

4. Analysis

4.1 A single request uses only half the bandwidth

During decode, each new token requires reading every weight from HBM, while the math per token is tiny. The speed limit is set by bandwidth:

Theoretical ceiling ≈ 8 TB/s ÷ 16.4 GB ≈ 490 tok/s
Measured            = 245 tok/s (TPOT 4.08 ms → ~4.0 TB/s effective)

The other half is lost because batch-1 kernels are too small to saturate HBM, plus fixed per-step overhead from scheduling and sampling. That gap is where kernel work and speculative decoding pay off.

4.2 Batching: read the weights once, serve N users

At 16 concurrent requests, one pass over the weights produces one token for each of 16 requests. Cost stays about the same while output goes up 16×:

  • Total throughput: 241 → 3,378 tok/s (14×)

  • Per-user speed: 245 → 224 tok/s (only 9% slower)

This is why every serving engine does continuous batching.

4.3 At high concurrency, the KV cache becomes the bottleneck

If decode were limited only by weight reads, TPOT would stay flat as concurrency grows. It doesn't: TPOT climbs quickly from 64 onward. Each step also reads the KV cache of every active request.

Each request has about 1,150 tokens of context during decode, or roughly 0.17 GB of KV cache. Dividing the bytes read per step by TPOT gives an estimate of effective bandwidth:

ConcurrencyWeightsKV cacheBytes per stepTPOTEffective BW
116.4 GB0.2 GB16.6 GB4.08 ms~4.1 TB/s
1616.4 GB2.7 GB19.1 GB4.47 ms~4.3 TB/s
6416.4 GB10.9 GB27.3 GB6.20 ms~4.4 TB/s
12816.4 GB21.7 GB38.1 GB10.30 ms~3.7 TB/s
25616.4 GB43.5 GB59.9 GB17.29 ms~3.5 TB/s

Two takeaways:

  1. Effective bandwidth stays roughly flat at 3.5–4.4 TB/s. So TPOT can be predicted fairly well as bytes per step ÷ effective bandwidth. That is a useful capacity-planning model.

  2. From 128 onward, KV cache reads exceed the weights. More concurrency just means moving more KV cache, so throughput stops growing. The lower bandwidth at 128 and 256 comes from new prefills being mixed into decode batches, which stretches TPOT (next section).

This points to the next optimization: an FP8 KV cache halves those reads.

(This is a rough estimate based on average context length. It shows the trend; it is not a precise bandwidth measurement.)

4.4 Tail latency: prefill and decode get in each other's way

At 128 concurrent requests, median ITL is 7.7 ms but P99 is 86 ms, so users see output stutter. When a new request arrives, its prefill (1,024 input tokens at once) runs in the same batch as ongoing decodes. The same effect pushes TTFT from 30 ms to 773 ms, because new requests wait in line for prefill.

This is the problem prefill/decode disaggregation solves: run prefill and decode on separate GPUs so they don't interfere. It is the core idea behind projects like llm-d and NVIDIA Dynamo.

5. Takeaways for operators

Pick the operating point from the SLO. With a target of at least 100 tok/s per user and P99 TTFT under 1 s:

  • 64 concurrent: 161 tok/s per user, P99 TTFT 299 ms. Meets the SLO with plenty of headroom.

  • 128 concurrent: 97 tok/s per user, just below target.

  • Recommended per-GPU operating point: 64–96. Cap it with --max-num-seqs and let the load balancer spread overflow to other GPUs instead of queueing on one.

Cost. At 64 concurrent, one GPU produces about 9,599 × 3,600 ≈ 34.6M output tokens per hour.

Cost per 1M output tokens ≈ hourly GPU price ÷ 34.6

First startup needs the internet. On first launch, FlashInfer downloads prebuilt Blackwell kernels from NVIDIA, and the model comes from Hugging Face. Before scaling out in production, bake ~/.cache/huggingface, ~/.cache/flashinfer, and ~/.cache/vllm into the image or put them on shared storage. Otherwise new nodes stall at startup.

6. Limitations

  • Each level was run once. A standalone run at 64 concurrent gave 7,379 tok/s versus 9,599 in the sweep, mostly due to warm-up and request count. A rigorous comparison should take the median of 3 runs per level.

  • The random dataset uses fixed input lengths, so prefix caching barely helps. Real traffic has different length distributions and cache hit rates.

  • Only one GPU at BF16 was tested. FP8 weights, FP8 KV cache, and multi-GPU parallelism are for follow-up posts.

7. Reproduce

# Environment
conda create -n vllm python=3.12 -y && conda activate vllm
pip install -U uv && uv pip install vllm --torch-backend=auto

# Start the server (1 GPU)
CUDA_VISIBLE_DEVICES=0 vllm serve Qwen/Qwen3-8B --port 8000 2>&1 | tee vllm.log

# Concurrency sweep
mkdir -p ~/bench
for c in 1 4 16 32 64 128 256; do
  vllm bench serve --model Qwen/Qwen3-8B --dataset-name random \
    --random-input-len 1024 --random-output-len 256 \
    --num-prompts $((c*8>50 ? c*8 : 50)) --max-concurrency $c \
    --save-result --result-dir ~/bench --result-filename c${c}.json
done

Next up

  • FP8 KV cache: testing the prediction from section 4.3 and measuring the throughput gain at high concurrency.

  • 8-GPU tensor parallelism and deploying DeepSeek-class models.

Author: [kimsun]. 10 years in SRE and 5 years in DevOps engineering, now moving into AI infrastructure and LLM serving. Get in touch: [contact:https://www.linkedin.com/in/kim-sun-945b06298/?isSelfProfile=true]


r/FunMachineLearning • • Sep 21 '26

I distilled SigLIP 2 into MobileNetV4 for pet breed recognition. Check it out :)

2 Upvotes

Been working on a pet breed classifier using Oxford-IIIT Pets, distilling SigLIP 2 into MobileNetV4.

I also wanted to learn Hugging Face Spaces, so after training the models, I made a quick demo and deployed a Gradio demo. It lets you compare the baseline and distilled models side by side, its a cool little project that lets you poke around and try to understand the differences.

Try the demo here: https://huggingface.co/spaces/MRCherryPie/breedlite-mnv4

Curious how it handles people’s actual pet photos. If you try it and get a fummy prediction, I’d like to see that too


r/FunMachineLearning • • Aug 21 '26

Dangers of negative constraints in reasoning models

Post image
2 Upvotes

Prompt (translated to English):

"Write a short dialogue (up to 6 lines) between an old broken toaster and a new smart fridge in the kitchen at night.

Conditions:

  • The toaster speaks like a weary philosopher.

  • The fridge is obsessed with efficiency and software updates.

  • No word in the dialogue may start with the letter 'P' (Cyrillic 'П')."

What happened: I gave qwen/qwen3.6-35b-a3b a classic lipogram challenge. Instead of filtering words on the fly during generation, the reasoning trace decided to brainstorm a blacklist of forbidden words starting with "П".

It got to the Russian word "Полный" (meaning full / complete)... and fell into an infinite token attractor loop for over 3 minutes until the context / thought budget blew up.


r/FunMachineLearning • • Aug 19 '26

DeepSeek Just Made Closed AI Look Ridiculous - Two Minute Papers

Thumbnail
youtube.com
2 Upvotes

r/FunMachineLearning • • Aug 15 '26

F(23) HOW TO BUILD A CAREER IN ML AS A MSC PHYSICS GRADUATE .

2 Upvotes

I graduated in April 2026 and was looking for jobs , but most of them were teaching jobs which I'm not interested at all , i want to make a career in ml , but i don't have relevant skills and i also read somewhere that they usually hire mostly Phd's for such roles . I haven't done a single internship during my bachelor's or my masters . I know I'm lacking , but i really want land my first job in ml related role . i know some python and libraries (mostly numpy , pandas , matplotlib ) . What skills should i know ? , what kind of projects should i do to stand out ? and what kind of internships should i look for to get into this field ? . PLEASE RECOMMED ME BOOKS AND COURSES WHICH HELPED U GET A JOB AND OTHER SUGGESTIONS AND ADVICES ARE WELCOMED ! Thankyou for you're time <3


r/FunMachineLearning • • Aug 14 '26

I keep hitting a wall trying to learn LLMs systematically. So I'm building an open map of the whole stack — need contributors

2 Upvotes

After a year of working with LLMs, I still don't feel like I've built any real, systematic knowledge. Even when I go deep on one area — RAG, say — and track every detail, the fog around LLMs as a whole doesn't lift. It just feels equally thick.

I think most of us learn this field through news headlines and whatever project suddenly jumps into the spotlight. What's missing is a map — something that shows the whole pipeline, from raw data to the app someone actually uses, and for each layer, links both the newest tools/papers AND the older, less-famous work that the newest stuff is quietly standing on. A lot of the real foundations predate "Attention Is All You Need" and never made it into any course.

So I started building one: an open, community-maintained GitHub repo mapping the LLM stack layer by layer —

Data → Training → Model → Deployment → Inference → API → Gateway/Router → Application → User

Each layer gets:
- a plain-language definition
- current, actively maintained projects
- the foundational paper(s) that layer is built on (even if they're old and unglamorous)

Repo here: https://github.com/YKs22k/LLM-Big-Map

I'd love help from people who actually work in data curation, training infra, inference engines, or the app layer, to correct what's wrong and add what's missing. Even a single "you're missing X paper" comment helps.

If this resonates with anyone else who's felt the same fog, I'd appreciate a look.


r/FunMachineLearning • • Jul 26 '26

Need help with CS endorsement for my first arXiv paper submission (Computer Vision / Medical AI)

2 Upvotes

Hi everyone,

I'm an independent researcher and I'm trying to submit my first paper to arXiv under cs.CV.

My paper is titled "Cethraian-X: A Leakage-Clean, Multi-Seed Benchmark of Chest X-Ray Classification Under Weak Labels." The project focuses on reproducibility and rigorous benchmarking for chest X-ray classification.

The project and paper are already publicly available:

I recently learned that first-time submissions in cs.CV require an arXiv endorsement. Unfortunately, I don't personally know anyone who is eligible to endorse submissions.

If anyone here has experience with the endorsement process, I'd really appreciate your advice.

If you're an eligible endorser and are willing to review my paper, I'd be grateful if you would consider endorsing my submission only if you believe the work is appropriate for arXiv after reviewing it.


r/FunMachineLearning • • Jul 16 '26

ECCV Oral/Spotlight

2 Upvotes

When will ECCV oral/spotlight decisions be announced? Also, what scores usually have a chance at CVPR/ICCV?


r/FunMachineLearning • • Jul 16 '26

My LLM is so unhinged

Post image
2 Upvotes

i decided to build a LLM model but.... what do you think ?