Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

BeamWriter hits "Record exceeds maximum record size" in Dataflow with autosharding

オープン
#10,995 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
gcp, python, tensorflow

調査の方向性

tensorflow_datasets/core/utils/shard_utils.py から始め、特に参照されている行のサイズ計算ロジックを確認し、それが train_write/GroupShards 用の shard 数をどのように決定しているかを追跡します。自動的に決定された 2048 shards の結果と、明示的に 4096 shards を指定して成功した Dataflow 実行を、recordwriter のサイズエラーも含めて比較します。完了条件は、サイズ計算の不一致を説明し、サポートされる修正または明確化された制限を定義することです。

索引モデルが issue の本文から書いたものです。

説明

bug

For TFDS 4.9.7 on Dataflow 2.60.0, I have a company-internal Dataflow job that fails. Given the input collection:

Elements added 332,090
Estimated size 1.74 TB

to train_write/GroupShards, where the output collection reports:

Elements added 2
Estimated size 1.8 GB

it then fails on the next element with

"E0123 207 recordwriter.cc:401] Record exceeds maximum record size (1096571470 > 1073741823)."

Workaround

By installing the TFDS prerelease after https://github.com/tensorflow/datasets/commit/37007453e963424b5cd5f81f19e0c4698dbed8e3 and controlling --num_shards=4096 (auto-detection choose 2048), the DatasetBuilder runs to completion on Dataflow. I'm curious why the auto-detection didn't choose more file shards however, as all training examples should be roughly the same size in this DatasetBuilder.

Suggested fix

Maybe this https://github.com/tensorflow/datasets/blob/9969ce542f4b0e1cbf0a085e8e0df11bccea5c17/tensorflow_datasets/core/utils/shard_utils.py#L79 is too little headroom for the training examples. The FeatureDict in this particular DatasetBuilder is large, and perhaps the key overhead is unusually large. Should that number be 0.8 instead? Or whether https://github.com/tensorflow/datasets/blob/9969ce542f4b0e1cbf0a085e8e0df11bccea5c17/tensorflow_datasets/core/utils/shard_utils.py#L54 should be larger when the FeatureDict contains many keys?

Side remark

Surprisingly Dataflow limits mention

Maximum size for a single element (except where stricter conditions apply, for example Streaming Engine). 2 GB

which doesn't seem to be true in practice since the GroupBy fails on ~1 GB as per the logged error.

主要言語
Python
スター
4.6k
フォーク
1.6k
平均マージ
5時間 47分
マージ済み PR(30日)
2

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

tensorflow/datasets のほかの issue

tensorflow/datasets の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。