More than code

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

zero bubble PP

最上面的是zero bubble h1 第二张图是减少T_w之后的调度结果 第三/四张图是不考虑内存的调度结果 bubble的计算逻辑: 3是1F1B,不放置w的调度结果。可以看到执行时间是: M * (F + B) + (P-1) * F + (P-1) * B 考虑这里的关键我认为在于看最后一个stage,因为最后一个stage没有任何依赖,一直都是跑满的。 那么bubble size就是最后一个stage idle的时间,对应的就是图中的(P - 1) * (F + B…

2026年2月8日 0条评论 6点热度 0人点赞 sheep 阅读全文
未分类

MoE global load balance 和MegatronLM中的实现

MegatronLM中实现了这个global load balance,这里来整理一下 论文:Demons in the Detail On Implementing Load Balancing Loss for Training Specialized Mixture-of-Expert Models 给aux loss起名,叫load balancing loss。 其中fi是路由到第i个expert的token的比例,Pi是router分配给expert i的概率 提到目前MoE framework实现的L…

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

breadth first pipeline parallelism notes

在section 3 distributed training这一节给了很详细的背景介绍和分析,包括: - FSDP和pp的冲突点 - compute/communicate overlap的定义 - Critical batch size的分析,在appendix上还给了详细的推导过程,以及直观的理解 a (mini-)batch is used to approximate the true gradients of the weights with respect to the loss. Increasin…

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

nccl tests

https://github.com/NVIDIA/nccl-tests/blob/master/doc/PERFORMANCE.md 基本概念 time: 小size的时候,用来衡量通信操作的overhead 大size的时候,带宽项主导,所以应该看算法的带宽来预估性能 Bandwidth: Algorithm bandwidth 代表的是纯数据的bandwidth,不看具体的算法。 就是输入的数据S 除以 花费的时间t Bus bandwidth P2P的通信,上面的algorithm bandwidth就是真…

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

minhash & LSH

主要来自cs336的lecture和assignment 要做近似去重,用了类似bag of gram的思想。定义两个文档的jaccard similarity是文档中词的交集的数量除以词的并集的数量。 jaccard simiarity大于阈值的时候,就认为文档比较相似,会被过滤掉。 但是jaccard similarity是两两计算的,复杂度是平方级别的,无法很好的拓展。 定义文档的minhash为所有gram的hash值的最小值。 这里有一个比较有意思的结论是: 证明思路也比较简单: 假设两个document…

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

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条评论 48点热度 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条评论 72点热度 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条评论 48点热度 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条评论 66点热度 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条评论 59点热度 0人点赞 sheep 阅读全文
12345…33
分类
  • Agent/RAG
  • ARTS
  • C++
  • CSAPP
  • daily
  • database
  • leetcode
  • linux
  • ml
  • nlp
  • paper
  • RL
  • rocksdb
  • rust
  • ScummVM
  • tech
  • 其他
  • 周报
  • 未分类
  • 笔记
  • 算法
  • 计算机图形学
归档
  • 2026 年 2 月
  • 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