COE 592Lecture 01Part 02
Segmentation, generative models and LLMs
Promptable segmentation, diffusion models, 3D perception and large language models push computation and memory far beyond classification, and each has an efficient counterpart that recovers speed without losing quality.
- Concepts
- 5
- Slides
- 9-16
- Reading
- 30 min
Why this part matters
Part 01 measured the price of accuracy on ImageNet. This part follows the same question into the models that define the field today: promptable segmentation, image and video diffusion, 3D perception in a moving car, and large language models. In every case the same move rescues the system: find the block that dominates the cost, then attack that block and only that block.
Every research direction in this course (quantisation, pruning, distillation, efficient attention, distributed inference) is motivated by one of the five cases here, and this is also how you scope a PhD project on embedded ML. Exam questions turn the slide numbers into arithmetic: bytes per parameter, speedup versus MAC ratio, frame budgets in milliseconds. Each concept below ends with that arithmetic worked out so you can do it from memory.
By the end you can
- Name SAM's three blocks, say which one dominates the cost, and explain what EfficientViT-SAM swaps to reach 48.9x.
- Explain why compute follows tokens and denoising steps rather than parameters, and why diffusion cost is super-quadratic in resolution.
- Compare naive patch parallelism with DistriFusion on MACs, latency and artifacts, and account for the gap between 4.0x less work and 3.0x speedup.
- Turn frames per second into a frame time and show which of Fast-LiDARNet's two levers crosses the 30 fps line.
- Convert parameters and precision into bytes and GPU counts, and give the three reasons LLMs must also run at the edge.
Picture a head-mounted camera looking at a door, a small label reading id 27, 52 cm, and a green mask painted over one region. A single click on the door produced that mask. That is what promptable means. The user supplies a hint, a point, a box or a phrase, and the model returns the object the hint refers to. The Segment Anything Model (SAM) from Kirillov et al. was trained on SA-1B, over one billion masks on 11 million images, so it can do this for objects it has never been told about.
The architecture matters more than the demo. SAM is three blocks. An image encoder, a ViT-H pre-trained with masked autoencoding, reads the image once and produces an image embedding. A prompt encoder turns sparse prompts (points, boxes, text) and dense prompts (masks) into prompt embeddings. A lightweight mask decoder combines the two and outputs a valid mask. The paper is explicit about the asymmetry: the image encoder runs once per image, and given a precomputed embedding, the prompt encoder and mask decoder run in a web browser, on a CPU, in about 50 ms. Encode once, expensively; prompt many times, cheaply.
SAM's three blocks
- Image encoder
- ViT-H, 641.1 M parameters, 2973 GMACs per image, runs once per image
- Prompt encoder
- Points, boxes and text (sparse), masks (dense); tiny
- Mask decoder
- Fuses image and prompt embeddings into a valid mask; with the prompt encoder, about 50 ms on a browser CPU
Attack the block that dominates
Once you see that the encoder holds 2973 GMACs and the rest is a 50 ms CPU job, the efficiency strategy writes itself. EfficientViT-SAM (Zhang, Cai and Han) keeps SAM's prompt encoder and mask decoder unchanged and replaces only the image encoder with EfficientViT, the multi-scale linear attention backbone from Cai et al. (ICCV 2023). Training happens in two stages: first the new encoder is distilled from SAM's ViT-H encoder as the teacher, then the whole model is trained end to end on SA-1B. Nothing else in the pipeline moves.
Hover, tap or focus a block to see what it costs and whether EfficientViT-SAM touches it.
Numbers from Table 1 of the EfficientViT-SAM paper. The prompt encoder and mask decoder are identical in every configuration, which is why swapping only the encoder moves the whole bar.
The fair way to judge the swap is accuracy against speed on the same hardware: zero-shot COCO mAP against A100 throughput with TensorRT in FP16. Zero-shot here has a precise meaning: the models were never trained on COCO, and they are evaluated with boxes from a ViTDet detector as prompts. Two speedups get quoted, and they belong to different models. The 16.5x figure is EfficientViT-SAM-XL1, which is faster and more accurate than SAM (47.8 versus 46.5 mAP). The 48.9x headline belongs to EfficientViT-SAM-L2, which matches SAM at 46.6 mAP while running 538 images per second instead of 11. The full table from the paper makes the families visible.
| Model | Encoder params | Encoder MACs | Throughput (img/s) | mAP | Speedup vs SAM-ViT-H |
|---|---|---|---|---|---|
| SAM-ViT-H | 641.1 M | 2973 G | 11 | 46.5 | 1x |
| EfficientViT-SAM-XL1 | 203.3 M | 322 G | 182 | 47.8 | 16.5x |
| EfficientViT-SAM-XL0 | 117.0 M | 185 G | 278 | 47.5 | 25.3x |
| EfficientViT-SAM-L2 | 61.3 M | 69 G | 538 | 46.6 | 48.9x |
| EfficientViT-SAM-L1 | 47.7 M | 49 G | 638 | 46.2 | 58.0x |
| EfficientViT-SAM-L0 | 34.8 M | 35 G | 762 | 45.7 | 69.3x |
| EfficientSAM | 25.3 M | 247 G | 183 | 44.4 | 16.6x |
| EdgeSAM | 9.6 M | 20 G | 449 | 42.1 | 40.8x |
| MobileSAM | 9.8 M | 39 G | 278 | 38.7 | 25.3x |
Worked example
Compute reduction versus measured speedup
MAC ratio
SAM-ViT-H to L2: 2973 / 69 ≈ 43.1x fewer encoder MACs.Throughput ratio
538 / 11 ≈ 48.9x more images per second.Compare
The measured speedup is larger than the MAC ratio. MACs are a hardware-neutral proxy; the real number also depends on memory access patterns and how well TensorRT kernels run linear attention.Result
43x less arithmetic bought 49x more throughput. MACs predict the direction, not the exact size, of a speedup.
The table carries a second lesson. EfficientSAM has 25.3 M encoder parameters, eight times fewer than XL1's 203.3 M, and yet the two run at the same throughput (183 versus 182 img/s), with EfficientSAM losing 3.4 mAP. Model size is about memory; speed is about MACs, memory traffic and kernels. Keep the three apart.
Quick check
Which block of SAM does EfficientViT-SAM replace to get its speedup?
Quick check
What does zero-shot mean for the COCO mAP on slide 10?
Recall
Name SAM's three blocks and say which one runs once per image.
Recall
What does EfficientViT-SAM change, what does it keep, and what are the throughput and mAP of its 48.9x variant against SAM-ViT-H?
Type "teddy bears working as mad scientists", "a bowl of soup as a planet on a 1960s poster" or "an astronaut riding a horse on Mars" into Midjourney and a finished picture comes back. A diffusion model produced each one from a sentence, by starting from noise and removing a little of it at every step until an image appears. The results look effortless. The bill is not. Emad Mostaque, then CEO of Stability AI, said that training Stable Diffusion used 256 A100 GPUs for about 150,000 GPU-hours at a cost of about $600,000, the figure the lecture uses as Stable Diffusion's training cost.
Worked example
What $600,000 of training looks like
Wall-clock time
150,000 GPU-hours / 256 GPUs ≈ 586 hours, which is about 24.4 days with every GPU busy the whole time.Price per GPU-hour
$600,000 / 150,000 GPU-hours = $4.00 per A100-hour.Cross-check
256 GPUs × 24 h × 24.4 days ≈ 149,900 GPU-hours, matching the stated total.Result
One training run: a rack of 256 accelerators for most of a month. Nobody iterates on that budget casually, which is why efficient training and inference are research topics rather than polish.
Stable Diffusion training run, 2022
- GPUs
- 256 × A100
- GPU-hours
- about 150,000
- Wall clock
- about 24 days
- Cost
- about $600,000
- Implied price
- about $4 per GPU-hour
| Run | A100s | GPU-hours | Wall clock | Cost |
|---|---|---|---|---|
| Stable Diffusion, 2022 | 256 | about 150,000 | about 24 days | about $600,000 |
| MosaicML SD2 base, 2023 | 128 | about 21,000 | 6.8 days | under $42,000 |
Why parameters are not the cost
Training is paid once. Inference is paid on every request, so compare what one forward pass costs in MACs across four very different models. The natural expectation is that the biggest model costs the most. The numbers say otherwise, and the reason is the most important idea in this concept.
| Model | Parameters | Workload | MACs | Ratio |
|---|---|---|---|---|
| ViT-H | 0.6 B | 518 x 518 image, one forward pass | 1.02 T | baseline |
| Llama 3 8B | 8 B | 1,024-token context, 512 output tokens | 11.2 T | 11x ViT-H |
| FLUX.1 | 12 B | 1K x 1K image, one denoising step | 37.2 T | 36x ViT-H, 3.3x Llama 3 |
| CogVideoX | 5.6 B | 480 x 720, 49 frames, one denoising step | 332 T | 8.9x FLUX.1, 326x ViT-H |
FLUX.1 has 12 B parameters and CogVideoX has 5.6 B, yet CogVideoX needs 8.9x the MACs per step. Llama 3 8B has more parameters than ViT-H by a factor of thirteen but costs eleven times more, not thirteen, and FLUX.1 with 1.5x the parameters of Llama 3 costs 3.3x as much. Parameters alone predict none of these ratios. What predicts them is how many tokens each model pushes through those parameters. A dense transformer spends roughly one multiply-accumulate (two FLOPs) per parameter per token in its linear layers, and on top of that attention compares every token with every other token.
Now the numbers make sense. ViT-H sees one 518 × 518 image cut into 14-pixel patches, 37 × 37 = 1,369 tokens: 632 M × 1,370 ≈ 0.87 T for the linear layers, and the attention term adds the rest of the 1.02 T. Llama 3 processes about 1,500 tokens. FLUX.1 works on the latent of a 1K × 1K image, about 4,000 tokens. CogVideoX compresses 49 frames of 480 × 720 video into 13 latent frames and denoises them all at once, about 17,500 tokens, roughly four times FLUX.1. Because the attention term grows with the square of that count, the bill grows far more than four times, and the smaller parameter count cannot save it. Read the linear term as the weights each token actually passes through, not the headline parameter count: for FLUX.1 the naive 12 B × 4,096 ≈ 49 T overshoots the 37.2 T bar because image and text tokens use separate weights in its double-stream blocks. One accounting rule explains the ordering of the chart: compute is parameters times tokens, plus attention.
One more multiplier hides in the words "single step" under the FLUX.1 and CogVideoX bars. A diffusion model repeats its forward pass once per denoising step. With a 50-step sampler, one 1K FLUX.1 image costs 37.2 T × 50 = 1,860 T MACs, and a CogVideoX clip costs 332 T × 50 = 16,600 T. A classifier pays its bar once; a generator pays it fifty times.
Resolution is worse than quadratic
Now hold the model fixed and vary only the image side length for FLUX.1, from 1024 to 4096. Going four times wider makes the image sixteen times larger in pixels, so a quadratic law would predict sixteen times the MACs. From the slide's left chart, one step at 1K x 1K costs 37.2 T, and the curve on the right ends near 1,950 T at 4096: a factor of about 52, far above the 16x a quadratic law predicts. This is what the lecture calls super-quadratic scaling, and the formula above explains it. Tokens grow with pixels (16x), the linear term grows with tokens (16x), and the attention term grows with tokens squared (256x). The blend lands at about 52x.
The solid curve is 31.6 (s/1024)^2 + 5.6 (s/1024)^4 trillion MACs, fitted to the two end points of the slide chart. It is a teaching model of the slide curve, not a profile of FLUX.1 itself.
FLUX.1 MACs per step read off the slide chart, by image side
- 1024
- about 37 T
- 1536
- about 94 T
- 2048
- about 207 T
- 2560
- about 406 T
- 3072
- about 728 T
- 3584
- about 1,226 T
- 4096
- about 1,950 T
Worked example
Fitting the slide curve
Model
Let r = side / 1024 and write MACs(r) = A r² + B r⁴: a token-linear part and an attention part.Fit the end points
A + B = 37.2 at r = 1 and 16A + 256B = 1950 at r = 4, so B ≈ 5.6 T and A ≈ 31.6 T.Check the middle
At 2048: 4 × 31.6 + 16 × 5.6 ≈ 216 T (chart about 207 T). At 3072: 9 × 31.6 + 81 × 5.6 ≈ 741 T (chart about 728 T).Result
At 1024 attention is about 15% of the cost. At 4096 it is about three quarters. This is why efficient attention (the EfficientViT backbone from the previous concept, FlashAttention, linear attention) is a research area of its own.
Quick check
Why does one CogVideoX step cost more MACs than one FLUX.1 step?
Quick check
FLUX.1 MACs rise from about 37 T at 1024 to about 1,950 T at 4096, roughly 52x, while pixels grow 16x. What best explains that?
Recall
256 A100s for 150,000 GPU-hours: how many days is that, and what price per GPU-hour does $600,000 imply?
Recall
Why does CogVideoX with 5.6 B parameters need 8.9x the MACs of FLUX.1 with 12 B parameters?
Recall
From 1024 to 4096, how much do pixels grow and how much do FLUX.1 MACs grow, and why the difference?
Ask SDXL for a "Romantic painting of a ship sailing in a stormy sea" at high resolution. One GPU paints one ship in 12.3 s. The obvious way to go faster is to cut the canvas into four vertical strips, hand each strip to its own GPU, and let them work without talking. The result is 3.9x faster and wrong: four strips, four ships, four different skies. Each patch generated its own picture because no patch could see the others.
DistriFusion (Li et al., CVPR 2024) keeps the split and restores the context. The trick rests on a property of diffusion: consecutive denoising steps produce similar activations, because each step removes only a little noise. So a patch can attend to its neighbours' activations from the previous step instead of waiting for the current one. The paper calls this displaced patch parallelism. The first few denoising steps (the warm-up: the first step plus four more in the paper) run synchronous patch parallelism so everyone starts from the same picture; after that, communication runs asynchronously and hides behind computation. No retraining is needed. The latency drops to 4.16 s, 3.0x faster than one GPU, and the ship is one ship.
| Setup | MACs per device | Work per device | Latency | Speedup | Quality |
|---|---|---|---|---|---|
| Original, 1 GPU | 907 T | 1x | 12.3 s | 1x | reference image |
| Naive patches, 4 GPUs | 190 T | 4.8x less | 3.14 s | 3.9x | duplicated subjects |
| DistriFusion, 4 GPUs | 227 T | 4.0x less | 4.16 s | 3.0x | no artifacts |
| DistriFusion, 8 GPUs (paper, not on the slide) | 113 T | 8.0x less | 2.74 s | 4.5x | no artifacts |
Worked example
Where the work went
Naive total
190 T × 4 = 760 T, less than the original 907 T. Naive patches skip all cross-patch attention, so the total work drops. The missing 147 T is exactly the missing context.DistriFusion total
227 T × 4 = 908 T ≈ 907 T. The full computation is preserved and simply divided by four.Ideal latency
12.3 s / 4 ≈ 3.08 s if four GPUs were perfectly parallel. Naive lands at 3.14 s, DistriFusion at 4.16 s.Result
DistriFusion does 4.0x less work per GPU but runs only 3.0x faster. The difference is the cost of exchanging activations between GPUs and of the synchronous warm-up steps.
The pattern is general in distributed systems: splitting work across machines helps only when the compute you save exceeds the communication you add. Here the saving is large because a high-resolution diffusion step is enormous (MACs in the hundreds of trillions), and the communication is hidden behind it. The paper also runs a scaling study on a larger image, 3840 × 3840, shown in the table below. Read down the efficiency column: every added GPU still helps, but each device contributes less than the last, because the communication grows while the per-device work shrinks.
| A100s | Speedup over one GPU | Marginal speedup | Parallel efficiency |
|---|---|---|---|
| 1 | 1x | reference | 100% |
| 2 | 1.8x | 1.8x | 90% |
| 4 | 3.4x | 1.9x | 85% |
| 8 | 6.1x | 1.8x | 76% |
Quick check
DistriFusion cuts MACs per GPU 4.0x but latency only 3.0x. What explains the gap?
Quick check
Where does a DistriFusion patch get context about its neighbours?
Recall
What artifact does naive patch parallelism produce, and why?
Recall
Why is 190 T times 4 less than the original 907 T?
A 2015 Toyota Prius V with a roof-mounted Velodyne LiDAR drives a wooded test track. A network reads raw 3D point clouds and produces steering. A car does not care how elegant the network is; it cares whether the answer arrives before the deadline the system sets. Three measurements tell the story: MinkowskiNet at 5 fps is "too slow to drive", the same network with optimised kernels reaches 18 fps, and Fast-LiDARNet reaches 47 fps, above the 30 fps line the slide marks as real time.
The most useful way to read fps is to invert it into a frame time. A stream at 30 fps gives you 33.3 ms per frame, and everything the model does must fit inside that budget.
Frame times behind the bars
- Budget at 30 fps
- 33.3 ms
- MinkowskiNet, 5 fps
- 200 ms, 167 ms over budget
- Optimised kernels, 18 fps
- 55.6 ms, 22 ms over budget
- Fast-LiDARNet, 47 fps
- 21.3 ms, 12 ms to spare
The paper (Liu, Amini, Zhu, Karaman, Han and Rus, ICRA 2021) is explicit about the two levers. Their optimised sparse convolution kernel gives a 3.6x acceleration, and their hardware-aware model design reduces latency by another 2.6x. The two multiply: 3.6 × 2.6 ≈ 9.4, which is 47 / 5. The first lever is pure systems work: the same network, the same accuracy, better code for the sparse operations point clouds need. The second is algorithmic: a smaller architecture chosen with the hardware in mind. This pairing is what the lecture means by algorithm and system co-design. Neither lever alone reaches the line. Kernels take the network from 200 ms to 55.6 ms and still miss by 22 ms; the redesign brings it to 21.3 ms.
| Configuration | Rate | Frame time | Lever | Inside 33.3 ms? |
|---|---|---|---|---|
| MinkowskiNet | 5 fps | 200 ms | none | no, 167 ms over |
| MinkowskiNet, optimised sparse kernels | 18 fps | 55.6 ms | system: 3.6x | no, 22 ms over |
| Fast-LiDARNet | 47 fps | 21.3 ms | algorithm: 2.6x more, 9.4x total | yes, 12 ms to spare |
Quick check
Kernel optimisation lifts MinkowskiNet to 18 fps. Why is that still not enough?
Recall
Name Fast-LiDARNet's two levers with their multipliers and the resulting frame rates.
Recall
What is the frame budget at 30 fps, and what is MinkowskiNet's frame time at 5 fps?
MT-NLG, the largest model on the lecture's chart, has 530 billion parameters. Store each one in FP16, two bytes, and the weights alone occupy 530 × 10⁹ × 2 = 1,060 GB. The largest GPU of that period, an A100 with 80 GB, holds 40 billion FP16 parameters. The gap between the two is 1,060 / 80 = 13.25, so 14 GPUs of weights before a single activation is computed.
To compare a model with a chip, put both on one log axis of model size by converting GPU bytes into a parameter count at FP16, which is what the lecture's assumption "data are FP16" means. 16 GB becomes 8 B parameters, 32 GB becomes 16 B, 80 GB becomes 40 B. On that shared axis the two curves tell the story of the large language model era: model size climbs from 0.05 B to 530 B, about 10,000x in roughly four years, while GPU memory climbs from 16 GB to 80 GB, 5x. Models have outgrown the chips they run on, and the distance keeps widening.
| Model | Year | Parameters | FP16 weights | A100 80 GB GPUs |
|---|---|---|---|---|
| Transformer | 2017 | 0.05 B | 0.1 GB | 1 |
| GPT | 2018 | 0.11 B | 0.22 GB | 1 |
| BERT-Large | 2018 | 0.34 B | 0.68 GB | 1 |
| GPT-2 | 2019 | 1.5 B | 3 GB | 1 |
| Megatron-LM | 2019 | 8.3 B | 16.6 GB | 1 |
| T-NLG | 2020 | 17 B | 34 GB | 1 |
| GPT-3 | 2020 | 175 B | 350 GB | 5 |
| MT-NLG | 2021 (paper 2022) | 530 B | 1,060 GB | 14 |
| Accelerator | Memory | FP16 parameters it holds |
|---|---|---|
| TPU v2 | 16 GB | 8 B |
| V100 | 32 GB | 16 B |
| TPU v3 | 32 GB | 16 B |
| A100 | 40 GB | 20 B |
| A100 | 80 GB | 40 B |
Parameters to bytes to GPUs
Every memory question in this course starts with one multiplication. Parameters times bytes per parameter gives the weight memory; divide by the memory of one device and round up to get the device count. The bytes per parameter depend on the numeric format: 4 for FP32, 2 for FP16 or BF16, 1 for INT8, 0.5 for INT4. Quantisation, which later lectures cover in depth, is simply the art of moving down that list without losing accuracy.
Worked example
MT-NLG on A100 80 GB GPUs
FP16
530 B × 2 bytes = 1,060 GB; 1,060 / 80 = 13.25, so 14 GPUs for the weights alone.INT8
530 B × 1 byte = 530 GB; 530 / 80 = 6.6, so 7 GPUs.INT4
530 B × 0.5 byte = 265 GB; 265 / 80 = 3.3, so 4 GPUs.Result
Every halving of precision halves the shelf. The same rule says an 80 GB card holds at most 40 B FP16 parameters, and that leaves zero room for anything else.
Weights only. Activations and the KV cache add memory that grows with batch size and context length, so a model that just fits here does not run. GB means 10^9 bytes. The 4 GB is the RAM slide 23 gives mobile AI (its activation-memory row), which holds weights and activations together; the 1 MB is the flash weight storage it gives a microcontroller.
Try Llama 3 8B in the calculator. In FP16 it needs 16 GB, four times the 4 GB of RAM slide 23 gives a phone. Slide 23 lists that 4 GB as activation memory and 256 GB as weight storage; in practice LLM inference loads the weights into that same RAM, so the 4 GB is the binding limit. In INT4 the model needs 4 GB, exactly at the line, with nothing left for activations. Now try the 2017 Transformer at 0.05 B against a microcontroller's 1 MB of weight storage: 100 MB in FP16, a hundred times over. The gap between what models need and what edge hardware has is the subject of part 03.
Why run them at the edge anyway
If LLMs barely fit in a rack of cloud GPUs, why does the lecture insist on running them on laptops, cars and robots? Three reasons, each one a research direction in this course.
- Copilot services, such as code completion, office assistants and in-game chat, running locally on the machine that uses them. Latency drops, and the service works in a car or a robot far from any data center.
- Resource-constrained, low-power devices that are not always connected. An edge LLM must work when the link is slow or absent.
- Privacy of user data. Prompts contain code, documents and conversations, and a local model never uploads them.
This is the design space for an on-device assistant, and it is why the rest of the course is about shrinking the memory (quantisation, pruning), the compute (efficient attention, distillation) and the deployment (compilers, kernels) of exactly the models on this chart. For a PhD project on embedded ML, the two-slope chart is the problem statement.
Quick check
A 175 B parameter model is stored in INT8. What is its weight memory?
Quick check
Why can 16 GB of GPU memory be drawn as 8 B parameters?
Recall
What is the FP16 weight memory of MT-NLG, and how many A100 80 GB GPUs does it need for weights alone?
Recall
How many FP16 parameters fit in 16 GB, and how much did model size and GPU memory grow over the chart?
Recall
Give the three reasons on slide 16 for running LLMs at the edge.
Recap
If you remember nothing else
- SAM is an image encoder that runs once per image and dominates the cost, plus a prompt encoder and a lightweight mask decoder that together run in about 50 ms on a CPU.
- EfficientViT-SAM replaces only the image encoder: 538 versus 11 img/s (48.9x) at 46.6 versus 46.5 zero-shot COCO mAP.
- Training Stable Diffusion took 256 A100s for 150k GPU-hours, about 24 days and about $600,000, so about $4 per GPU-hour.
- Compute follows tokens times steps: CogVideoX with 5.6 B parameters needs 332 T MACs per step, 8.9x FLUX.1's 37.2 T with 12 B parameters.
- FLUX.1 MACs grow about 52x from 1024 to 4096 while pixels grow 16x, because attention is quadratic in token count.
- DistriFusion on 4 GPUs: 227 T MACs per device (4.0x less), 4.16 s (3.0x faster), no duplicated subjects. Naive patches are 3.9x faster but fragment the image.
- Fast-LiDARNet: kernel optimisation 3.6x, model redesign 2.6x, 5 to 47 fps against a 30 fps (33.3 ms) budget.
- Model size grew about 10,000x in four years while GPU memory grew about 5x; 530 B FP16 parameters are 1,060 GB, or 14 A100 80 GB GPUs for weights alone.
- Edge LLMs exist for local copilots on laptops, cars and robots, for low-power devices that are not always connected, and for privacy.
Sources
- Segment AnythingPaperKirillov et al., ICCV 2023Three components, SA-1B (1 B masks on 11 M images), prompt encoder and decoder in about 50 ms on a browser CPU(opens in a new tab)
- EfficientViT-SAM: Accelerated Segment Anything Model Without Accuracy LossPaperZhang, Cai and Han, arXiv 2024Table 1: params, MACs, A100 TensorRT FP16 throughput and zero-shot COCO mAP; 48.9x(opens in a new tab)
- EfficientViT-SAM demoDocsMIT HAN LabThe link printed on slide 10; the demo host is intermittently offline, the arXiv paper is the durable source(opens in a new tab)
- Training cost for Stable Diffusion was just $600,000ArticleThe Decoder, 8 September 2022Emad Mostaque's 256 A100, 150k GPU-hour, $600k figures(opens in a new tab)
- How We Trained Stable Diffusion for Less than $50k (Part 3)ArticleDatabricks (MosaicML)Measured run: 21,000 A100-hours, 6.79 days on 128 A100s, under $42,000(opens in a new tab)
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScalePaperDosovitskiy et al., ICLR 2021Table 1: ViT-H has 632 M parameters(opens in a new tab)
- FLUX.1 [dev] model cardDocsBlack Forest Labs, Hugging Face12 billion parameter rectified flow transformer(opens in a new tab)
- CogVideoX-5b model cardDocsZhipu AI, Hugging Face720 x 480, 6 s at 8 fps, 49 frames(opens in a new tab)
- CogVideoX: Text-to-Video Diffusion Models with An Expert TransformerPaperYang et al., arXiv 2024(opens in a new tab)
- The Llama 3 Herd of ModelsPaperMeta AI, arXiv 20248B, 70B and 405B models(opens in a new tab)
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessPaperDao et al., NeurIPS 2022Attention time and memory are quadratic in sequence length(opens in a new tab)
- DistriFusion: Distributed Parallel Inference for High-Resolution Diffusion ModelsPaperLi et al., CVPR 2024Displaced patch parallelism; 1.8x, 3.4x and 6.1x on 2, 4 and 8 A100s(opens in a new tab)
- DistriFusion repository and teaser figureDocsMIT HAN Lab, GitHub907 T / 12.3 s, 190 T / 3.14 s, 227 T / 4.16 s, 113 T / 2.74 s; SDXL 1280 x 1920, 50-step Euler(opens in a new tab)
- Efficient and Robust LiDAR-Based End-to-End NavigationPaperLiu, Amini, Zhu, Karaman, Han and Rus, ICRA 20213.6x from kernels, 2.6x from model design, 47 fps on GTX 1080Ti, 11 fps on Jetson AGX Xavier(opens in a new tab)
- Using DeepSpeed and Megatron to Train Megatron-Turing NLG 530BPaperSmith et al., arXiv 2022530 billion parameters(opens in a new tab)
- Language Models are Few-Shot LearnersPaperBrown et al., NeurIPS 2020GPT-3, 175 B parameters(opens in a new tab)
- Megatron-LM: Training Multi-Billion Parameter Language Models Using Model ParallelismPaperShoeybi et al., arXiv 2019Up to 8.3 billion parameters(opens in a new tab)
- BERT: Pre-training of Deep Bidirectional TransformersPaperDevlin et al., NAACL 2019BERT-Large, 340 M parameters(opens in a new tab)
- Turing-NLG: A 17-billion-parameter language model by MicrosoftArticleMicrosoft Research Blog, 13 February 2020(opens in a new tab)
- NVIDIA A100 Tensor Core GPUDocsNVIDIA40 GB and 80 GB variants(opens in a new tab)
- NVIDIA V100 datasheetDocsNVIDIA32 GB or 16 GB HBM2(opens in a new tab)
- TPU v3DocsGoogle Cloud documentation32 GiB HBM2 per chip(opens in a new tab)
- MIT 6.5940 TinyML and Efficient Deep Learning Computing, Lecture 1DocsMIT HAN LabOrigin of the MAC comparison, resolution curve and model-size charts on slides 12 and 15(opens in a new tab)