[QUESTION] How does veScale FSDP handles 2D FP8 blockwise scaling for RaggedShard

未关闭
#73 1 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
10/100
Issue 类型
文档
描述清晰度
需要澄清
活跃度
停滞
技术栈
python, pytorch

调研方向

This is a design question about how veScale FSDP shards FP8 weights for the DeepSeek blockwise recipe, not a scoped change. Start by reading the RaggedShard/FSDP parameter sharding path and wherever the FP8 blockwise scaling is applied, then compare it with the to_blocked_128x128 helper quoted in the issue to see whether the permutation happens before sharding, after the all-gather, or not at all. Done means an explanation of whether the permute/unpermute round-trip is required around the AG and how a regular FP8 GEMM is launched on the result — ideally recorded as a doc or comment so the next reader does not have to ask.

由索引模型根据 Issue 内容生成。

描述

For deepseek FP8 blockwise recipe, the scaling block size for weights is 128x128. Having 2D block scaling means sharding by blocks will make memory incontiguous. Does it mean that we have to go through the following function to "permute" the original [N, K] weight tensor. And then after the parameter AG, do we also need to "unpermute" it such that we can launch a regular FP8 GEMM?

def to_blocked_128x128(a: torch.Tensor) -> torch.Tensor:
    N, K = a.shape
    return a.view(N//128, 128, K//128, 128).permute(0, 2, 1, 3).contiguous()
Image
主要语言
Python
星标
1k
派生
65
平均合并
21 小时 34 分钟
30 天内合并 PR
1

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

volcengine/veScale 的其他 Issue

查看 volcengine/veScale 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。