Use targeted glob for cloud logdir subdirectory discovery#7089
Open
bzantium wants to merge 2 commits intotensorflow:masterfrom
Open
Use targeted glob for cloud logdir subdirectory discovery#7089bzantium wants to merge 2 commits intotensorflow:masterfrom
bzantium wants to merge 2 commits intotensorflow:masterfrom
Conversation
Replace the level-by-level globbing approach for cloud filesystems (GCS, S3) with a single recursive glob for *tfevents* files. The previous method listed all files at every directory level, which is extremely slow when the directory tree contains many non-event files such as model checkpoints. For a test case with ~26,000 checkpoint files alongside 8 event files, this reduces discovery time from ~100s to ~13s. Local filesystem paths are unaffected; they continue to use the walk-based approach.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #7088
Replace the level-by-level globbing approach in
GetLogdirSubdirectoriesfor cloud filesystems (GCS, S3) with a single recursive glob for*tfevents*files.The previous method called
ListRecursivelyViaGlobbing, which globs*,*/*,*/*/*, etc., listing all files at every directory level. This is extremely slow when the directory tree contains many non-event files (e.g., model checkpoints).The new approach uses a single
**/*tfevents*glob to directly find event files and derives containing directories from the results.Benchmark
Tested on a real GCS directory with ~26,000 checkpoint files and 8 event files:
**/*tfevents*glob)Scope
gs://,s3://): uses the new targeted globListRecursivelyViaWalkingListRecursivelyViaGlobbingis left intact (not removed) to avoid breaking any external consumersTest plan