Menu

#DevtoPytorch

150 posts

Feed·
20 of 150 posts
Does your thread count change your model's output? I tested torch.set_num_threads on 11 operations
📰
0Read More

Does your thread count change your model's output? I tested torch.set_num_threads on 11 operations

DEV Community: pytorch·Vahana·about 7 hours ago
#BW4BbSRd
#devtopytorch#devto#dev#thread#torch

I summed the same 10 million float32 numbers five times on my laptop, changing only...

15s
Run Any PyTorch LLM Natively on Google TPUs: A Zero-to-Hero Guide to TorchTPU (Part 1)
📰
0Read More

Run Any PyTorch LLM Natively on Google TPUs: A Zero-to-Hero Guide to TorchTPU (Part 1)

DEV Community: pytorch·Ahmed Elnaggar·1 day ago
#RlDGX6Gf
#devtopytorch#devto#dev#torch#torchtpu

Run standard PyTorch and HuggingFace LLMs directly on Google Cloud TPUs using TorchTPU (torch.device('tpu')) with zero JAX wrappers. Includes execution mode benchmarks, MXU precision parity, bounded dynamism, and 36x faster StaticCache decoding on Colab…

15s
Pre-Train Transformers & Fine-Tune HuggingFace LLMs with LoRA on Native PyTorch TPUs (Part 2)
📰
0Read More

Pre-Train Transformers & Fine-Tune HuggingFace LLMs with LoRA on Native PyTorch TPUs (Part 2)

DEV Community: pytorch·Ahmed Elnaggar·1 day ago
#6QaZlyMm
#devtopytorch#devto#dev#torch#loss

Pre-train a modern Causal Transformer from scratch with activation checkpointing, 10.2x lower HBM chunked cross-entropy, and SingleTraceTrainer (AdamW & Muon), then fine-tune Qwen3-0.6B with native PyTorch PEFT LoRA at 20,511 tok/s on Colab TPU.

15s
Post-Training Alignment (DPO) & Live Online GRPO Reinforcement Learning on TPUs with TorchTPU (Part 3)
📰
0Read More

Post-Training Alignment (DPO) & Live Online GRPO Reinforcement Learning on TPUs with TorchTPU (Part 3)

DEV Community: pytorch·Ahmed Elnaggar·1 day ago
#IXsIIP4b
#devtopytorch#devto#dev#grpo#model

Run static-shape compiled Direct Preference Optimization (DPO) and live online Group Relative Policy Optimization (GRPO) RL on a single 16 GiB Colab TPU (0.0% -> 96.9% math accuracy, 0 recompiles), plus Disaggregated TPU Pod RL with VeRL + vllm-torchtpu +…

15s
FlashAttention on TPUs (splash_sdpa), Custom Verified Pallas Kernels & XProf in TorchTPU (Part 4)
📰
0Read More

FlashAttention on TPUs (splash_sdpa), Custom Verified Pallas Kernels & XProf in TorchTPU (Part 4)

DEV Community: pytorch·Ahmed Elnaggar·1 day ago
#C6u6W9VY
#devtopytorch#devto#dev#torch#pallas

Eliminate O(S^2) attention HBM bottlenecks on Google TPUs with torch.tpu.ops.splash_sdpa (6.39x faster at 4K, 1.2 GiB vs OOM at 8K), author custom differentiable Pallas kernels verified with pallas.verifier.verify, control 6-pass MXU float32 precision,…

15s
Scaling PyTorch Across Cloud TPU Slices & Pods: SimpleFSDP, DTensor TP, Pallas RDMA & vLLM (Part 5)
📰
0Read More

Scaling PyTorch Across Cloud TPU Slices & Pods: SimpleFSDP, DTensor TP, Pallas RDMA & vLLM (Part 5)

DEV Community: pytorch·Ahmed Elnaggar·1 day ago
#SdLqUcO3
#devtopytorch#devto#dev#torchtpu#slice

Scale native PyTorch across Cloud TPU slices (ICI) and multi-slice pods (DCN) with tpu_dist, topology_aware_mesh, @spmd_safe, SimpleFSDP + DTensor Tensor Parallelism (0 graph breaks!), 4-device verified Pallas RDMA, GKE JobSet recipes, and vllm-torchtpu…

15s
Overfitting vs Underfitting in Practice: 4 Experiments on MNIST
🖼️
0Read More

Overfitting vs Underfitting in Practice: 4 Experiments on MNIST

DEV Community: pytorch·Zoricic·1 day ago
#w0CpuNXd
#devtopytorch#devto#dev#model#loss

"The model is overfitting" is one of the first things you hear when you start training neural...

15s
bf16 in one picture: 8 bits of mantissa, round-to-nearest-even, and what it hides
📰
0Read More

bf16 in one picture: 8 bits of mantissa, round-to-nearest-even, and what it hides

DEV Community: pytorch·Vahana·1 day ago
#IrL5FuPb
#devtopytorch#devto#dev#bits#fp32

Add 1.0 to a bfloat16 counter a thousand times. The answer is 256. Not 1000, not "about 1000"....

15s
Can You Train a 64M LLM in 2 Hours for ¥3? Inside 75.4K-Star MiniMind's 4,753 Lines of Pure PyTorch
📰
0Read More

Can You Train a 64M LLM in 2 Hours for ¥3? Inside 75.4K-Star MiniMind's 4,753 Lines of Pure PyTorch

DEV Community: pytorch·tomTOP·1 day ago
#fwEa0JVp
#devtopytorch#devto#dev#minimind#lines

jingyaogong/minimind just surged past 75,382 stars (9,985 forks, Apache-2.0) on GitHub Trending. Its...

15s
What are DeepSpeed ZeRO stages 1, 2 and 3?
🖼️
0Read More

What are DeepSpeed ZeRO stages 1, 2 and 3?

DEV Community: pytorch·Viswaretas Kotra·5 days ago
#FIPu0MZg
#devtopytorch#devto#dev#zero#stage

ZeRO-1 splits optimizer state, ZeRO-2 adds gradients, ZeRO-3 adds weights. Per-GPU memory math for 7B and 70B, configs and a rule for picking one.

15s