AI-Hypercomputer / AI-Hypercomputer/maxtext

Issue with gradient accumulation and expansion_factor_real_data>1

未关闭
#3,381 0 条评论 0 个 reaction 已指派 1 人 已被 @khatwanimohit 认领 在 GitHub 查看
bug
主要语言
Python
星标
2.4k
派生
607
平均合并
2 天 19 小时
30 天内合并 PR
158

描述

### Bug report

`expansion_factor_real_data` > 1 generates placeholder data and then truncates the inputs in `loss_fn` to the correct size, which is supposed to eliminate the placeholder data. In gradient accumulation, from `train_step` we reshape the inputs to introduce a `gradient_accumulation_steps` dimension.

If we first truncated then reshaped, this would work correctly. However, we reshape then truncate, which means later gradient accumulation steps use the placeholder data.

I believe `max_checkify` does not catch this issue because it happens too early in the process.

(Internally we're on an older fork of this codebase, so I apologize if this has been fixed already. I looked through the relevant code and it looked like it would have the same issue)

### Logs/Output

_No response_

### Environment Information

_No response_

### Additional Context

_No response_

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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