AI-Hypercomputer / AI-Hypercomputer/maxtext

Issue with gradient accumulation and expansion_factor_real_data>1

オープン
#3,381 コメント 0 件 リアクション 0 件 担当者 1 名 @khatwanimohit が担当を希望しています GitHub で見る
bug
主要言語
Python
スター
2.4k
フォーク
607
平均マージ
2日 19時間
マージ済み PR(30日)
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 を短くまとめたダイジェスト。