[D] Modern best coding practices for Pytorch (for research)? : r/MachineLearning
Beginners -> /r/mlquestions or /r/learnmachinelearning , AGI -> /r/singularity, career advices -> /r/cscareerquestions, datasets -> r/datasets Hi all, I've been using Pytorch since 2019, and it has changed a lot in that time (especially since huggingface). Are there any modern guides/style-docs/example-repos you would recommend? For example, are namedtensors a good/common practice? Is Pytorch Lightning recommended? What are the best config management tools these days? How often do you use torch.script or torch.compile? I really like the torchcfm library (it does flow matching) as an example of something modern and nontrivial that is none the less implemented in an extremely clean and well-organized way. I think there's a real need for something akin to namedtensors, in the sense that reading regular pytorch code often doesn't give clear indications about what the meaning or shape of tensors is expected to be. At the same time, though, I think the lack of enthusiastic adoption suggests
I really like the torchcfm library (it does flow matching) as an example of something modern and nontrivial that is none the less implemented in an extremely clean and well-organized way. I think there's a real need for something akin to namedtensors, in the sense that reading regular pytorch code often doesn't give clear indications about what the meaning or shape of tensors is expected to be. At the same time, though, I think the lack of enthusiastic adoption suggests that namedtensors don't really solve that problem; I think people have found it a lot easier to just remember various…
related reading
- PyTorch internals : ezyang's blogblog.ezyang.com
- UW PLSE | How does torch.compile work?uwplse.org
- State of torch.compile for training (August 2025) : ezyang's blogblog.ezyang.com
- Tensor Considered Harmfulnlp.seas.harvard.edu
- PyTorch (@PyTorch) / Xx.com
- the bug that taught me more about PyTorch than years of using it | Elana Simonelanapearl.github.io
- GitHub - srush/Tensor-Puzzles: Solve puzzles. Improve your pytorch.github.com
- PyTorch, a year in…. – PyTorchpytorch.org
- Learning PyTorch with Examples — PyTorch Tutorials 2.12.0+cu130 documentationpytorch.org
- PyTorch in One Hour: From Tensors to Training Neural Networks on Multiple GPUssebastianraschka.com
- Accelerating Generative AI with PyTorch II: GPT, Fast – PyTorchpytorch.org
- <no title> — PyTorch Tutorials 2.13.0+cu130 documentationpytorch.org