Nested Dataset Slowdown
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- python, tensorflow
調査の方向性
例に示されているネストされた DataLoader パスから始め、特に低速化が報告されている state の作成と検証を確認してください。pyinstrument の flamegraph を使って、Grain が内側の dataset に対して repr を呼び出す理由を確認してください。ネストされた episode/steps ループと、ネストされていないケースを比較してください。state の作成と検証で報告されている低速化が、ネストされた dataset の動作を変更せずに解消されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
TLDR: I'm working with robotics datasets. They are expressed a nested dataset. Grain calls repr on the inner dataset which slows down the loops significantly.
I think grain has serious benefits over tfds for nested datasets like this. Currently, rlds is the best way of handling these types of datasets. It somewhat abuses tfds dataset manipulation techniques since it doesn't have a better of handling this. I think grain would be able to simplify a lot of these workflows and allow for much more complex things to be created, i.e stitching multiple robot episodes together in unique ways that aren't easily expressible in tfds or rlds.
Fixing the above problem would be hugely beneficial and doesn't feel like it's super necessary.
Simple example to showcase the problem:
builder = tfds.builder_from_directory(builder_dir=dataset_path)
episode_data_source = builder.as_data_source("train", deserialize_method=tfds.core.decode.DeserializeMethod.DESERIALIZE_AND_DECODE)
episode_index_sampler = grain.IndexSampler(
num_records=2,
num_epochs=1,
shard_options=grain.ShardOptions(shard_index=0, shard_count=1, drop_remainder=True),
shuffle=True,
seed=0
)
steps_index_sampler = grain.IndexSampler(
num_records=2,
num_epochs=1,
shard_options=grain.ShardOptions(shard_index=0, shard_count=1, drop_remainder=True),
shuffle=True,
seed=0
)
import pyinstrument
profiler = pyinstrument.Profiler()
profiler.start()
episode_data_loader = grain.DataLoader(data_source=episode_data_source, sampler=episode_index_sampler)
for episode_data in episode_data_loader:
steps_data_source = episode_data[rlds.STEPS]
steps_data_loader = grain.DataLoader(data_source=steps_data_source, sampler=steps_index_sampler)
for steps_data in steps_data_loader:
pass
profiler.stop()
# Save the flamegraph to an HTML file
with open('flamegraph.html', 'w') as f:
f.write(profiler.output_html())
Specific slowdowns happen when creating the state/validating the state.
- 主要言語
- Python
- スター
- 801
- フォーク
- 97
- 平均マージ
- 20時間 16分
- マージ済み PR(30日)
- 12
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
google/grain のほかの issue
-
[Docs] DataLoader tutorial fails with UnparsedFlagAccessError at cell 26 (grain 0.2.18 + JAX ≥ 0.10.1)再び着手できるかも @akhil9tiet が 10 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンdocumentation type:bug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
google/grain#1444 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Restoring an exhausted flatmap checkpoint can replay consumed records対応中かも @salma2vec が 10 日前に担当しました。 オープンtype:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
ConcatThenSplitIterDataset drops a document when restored from a JSON-serialized state対応中かも @AshishKumar4 が 20 日前に担当しました。 オープンtype:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
Closing an mp_prefetch iterator stops its worker processes one at a time対応中かも @jabrailkhalil が 26 日前に担当しました。 オープンtype:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
WindowShuffleMapDataset duplicates and omits records in incomplete windows対応中かも @salma2vec が 17 日前に担当しました。 オープンtype:bug
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
ChatBedrockConverse changes the keys of JSON tool results to camelCase (`order_id` becomes `orderId`)対応中かも @geyazheng が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
langchain-ai/langchain-aws#1469 ·
メンテナーはふだん 1 日以内に返信
-
GCToggler leaves collection enabled if the body re-enables it対応中かも @Gambit-Checkmate が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 7 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
doronz88/pymobiledevice3#2176 ·
メンテナーはふだん 1 日以内に返信
-
b4b usability
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信