More than code

More Than Code
The efficiency of your iteration of reading, practicing and thinking decides your understanding of the world.
未分类

torch dataloader 异常实验

Worker worker抛异常,worker循环会捕获这个异常丢给主进程 主进程再去做退出 worker调用system.exit() 主进程发现worker异常退出,也抛出Runtime error Main 主进程sys.exit() worker会存活一会,拉一些数据,然后发现主进程已经挂了,就会主动退出 用os.exit直接退出。 同样子进程也额外打印了一些数据。也自动退出了 不过这里在退出的时候resource_tracker打印了有一些leak的资源。 因为sys.exit()好像是会调用de…

2026年1月27日 0条评论 25点热度 0人点赞 sheep 阅读全文
未分类

MegatronLM Dataset

这篇文章来介绍一下MegatronLM中的Dataset,核心的代码逻辑主要在megatron/core/dataset中 在readme里有写dataset相关的设计。 MegatronLM中的dataset逻辑相对简单,提供的功能也有限,MegatronLM官方文档中推荐使用https://github.com/NVIDIA/Megatron-Energon作为Dataset,更加适合作为一个生产级别的Dataset/Dataloader使用。后面有机会也会出一篇文章介绍一下。 MegatronLM的datas…

2026年1月22日 0条评论 46点热度 0人点赞 sheep 阅读全文
未分类

ultrascale-playbook Notes

https://huggingface.co/spaces/nanotron/ultrascale-playbook 一上来有一个memory usage breakdown的图,展示了不同参数下,各个部分占用比重。 Memory usage breakdown llama3 8B 256的sequence length 打开mixed precision可以缩小activation memory。这里大概是认为从FP32变成了FP8,所以activation memory减少到了28G 打开zero后,P/G/O…

2026年1月20日 0条评论 32点热度 0人点赞 sheep 阅读全文
未分类

Pytorch Data Introduction

这篇文章来介绍一下torch/util/data目录下的一些组件。主要就是torch提供的Dataset和Dataloader Dataset负责做抽象数据的访问方式,提供两种Dataset。一般来说对应底层的存储方式 Map,随机访问,给定index,给出sample Iterable,顺序访问,给定一个iterator,每次next得到sample Dataloader负责做数据的读取,包含三个组件 Sampler 负责生成下一个访问的数据的index,给Map类型的dataset使用 支持一个BatchSam…

2026年1月20日 0条评论 51点热度 0人点赞 sheep 阅读全文
未分类

cs336 assignment4

2 Filtering common crawl look at cc CC-MAIN-20250417135010-20250417165010-00065.warc.gz里面就是原始的html .wet的就是提取的plain text。 一堆奇奇怪怪的网站 http://10www.chinatikfans.com/home.php?mod=space&uid=4693&do=blog&classid=104&view=me url是accessable的 看起来像是把html中…

2026年1月19日 0条评论 46点热度 0人点赞 sheep 阅读全文
未分类

Parallelism Mesh Zoo Notes

推荐的两本书 https://jax-ml.github.io/scaling-book/ https://huggingface.co/spaces/nanotron/ultrascale-playbook 为什么需要device mesh: device mesh are a reflection of the physical constraints of networking between GPUs 根据物理结构来选择不同的并行策略,优化communication开销 如何思考device mesh: W…

2026年1月18日 0条评论 42点热度 0人点赞 sheep 阅读全文
未分类

Visualizing 6D Mesh Parallelism Notes

https://main-horse.github.io/posts/visualizing-6d/ DataParallel Identical copies of the model exist on every accelerator. 通过all reduce汇聚梯度 这里还提到了fsdp2这篇论文:SimpleFSDP: Simpler Fully Sharded Data Parallel with torch.compile backward之后,会进行dp link之间的通信 同时和下一层的back…

2026年1月18日 0条评论 40点热度 0人点赞 sheep 阅读全文
未分类

MegatronLM ContextParallel

简单介绍一下MegatronLM中,ContextParallel相关的实现,主要是面向源码 这一节相关的Paper也挺多,也有一些不错的知乎上的文章: Sequence Parallelism: Long Sequence Training from System Perspective Ring self attention,主要引入了分布式的计算。看论文描述应该是两轮,先算score,再算S * V 这里应该是要求同一个Q的S被放到同一个设备上了。没有做在线计算 所以这里是把Attention的act…

2026年1月10日 0条评论 65点热度 0人点赞 sheep 阅读全文
未分类

MegatronLM DataParallel

这篇文章来介绍一下MegatronLM中DataParallel相关的实现,适合希望阅读源码的同学来看 主要会涉及到DDP/FSDP,distributed optimizer会单独再出一篇文章。 官方有一篇设计文档,可以简单看看https://docs.nvidia.com/megatron-core/developer-guide/latest/api-guide/custom_fsdp.html# DDP MegatronLM中DDP的代码主要在core/distributed/distributed…

2026年1月10日 0条评论 70点热度 0人点赞 sheep 阅读全文
未分类

MegatronLM ExpertParallel

这篇文章来介绍一下MegatronLM中,有关EP部分的代码。 因为我也是头一次接触MoE相关的,同时并没有对比过其他系统(DeepSpeed等)的实现,所以这块知识单纯讲一下MegatronLM中的一些细节。 理论基础的话,我在看相关代码的时候,看了这几篇Paper: GShard: Scaling Giant Models with Conditional Computation and Automatic Sharding Switch Transformers: Scaling to Trillion Pa…

2026年1月10日 0条评论 65点热度 0人点赞 sheep 阅读全文
12345…33
分类
  • Agent/RAG
  • ARTS
  • C++
  • CSAPP
  • daily
  • database
  • leetcode
  • linux
  • ml
  • nlp
  • paper
  • RL
  • rocksdb
  • rust
  • ScummVM
  • tech
  • 其他
  • 周报
  • 未分类
  • 笔记
  • 算法
  • 计算机图形学
归档
  • 2026 年 1 月
  • 2025 年 12 月
  • 2025 年 11 月
  • 2025 年 10 月
  • 2025 年 9 月
  • 2025 年 8 月
  • 2025 年 7 月
  • 2025 年 5 月
  • 2025 年 4 月
  • 2025 年 3 月
  • 2025 年 2 月
  • 2025 年 1 月
  • 2024 年 12 月
  • 2024 年 10 月
  • 2024 年 9 月
  • 2024 年 8 月
  • 2024 年 7 月
  • 2024 年 6 月
  • 2024 年 5 月
  • 2024 年 4 月
  • 2024 年 3 月
  • 2024 年 2 月
  • 2023 年 12 月
  • 2023 年 11 月
  • 2023 年 9 月
  • 2023 年 7 月
  • 2023 年 6 月
  • 2023 年 5 月
  • 2023 年 4 月
  • 2023 年 2 月
  • 2023 年 1 月
  • 2022 年 9 月
  • 2022 年 7 月
  • 2022 年 6 月
  • 2022 年 5 月
  • 2022 年 4 月
  • 2022 年 3 月
  • 2022 年 2 月
  • 2022 年 1 月
  • 2021 年 12 月
  • 2021 年 11 月
  • 2021 年 10 月
  • 2021 年 9 月
  • 2021 年 8 月
  • 2021 年 7 月
  • 2021 年 6 月
  • 2021 年 5 月
  • 2021 年 4 月
  • 2021 年 3 月
  • 2021 年 1 月
  • 2020 年 12 月

COPYRIGHT © 2021 heavensheep.xyz. ALL RIGHTS RESERVED.

THEME KRATOS MADE BY VTROIS