Store batch size samples in DB for all ranks #130
Open
ppraneth wants to merge 6 commits into
Open
Conversation
…Project folding). Git auto-applied the rename to my new files and surfaced content conflicts in the four files this PR also touches: sqlite_writer.py, h2d_auto_timer_patch.py, sampler_registry.py, and wrappers.py. Resolved by keeping main's traceml_ai.* import paths while preserving this PR's additions (batch_size writer, sampler import, record_batch_size_bytes call, tensor_bytes container traversal). Updated inner imports of the new batch_size modules and the test/demo files to use traceml_ai.
# Conflicts: # src/traceml_ai/runtime/sampler_registry.py
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.
Closes #81
Adds input batch size in bytes as a per-step, per-rank metric. Storage only, no rendering work.
What it does:
element_size * numelbytes whenever a tensor moves from CPU to CUDA insidetrace_step.wrap_h2ddoes the same for manual mode (tensor + dict/list/tuple containers).BatchSizeSamplersums bytes within a step so gradient accumulation is handled naturally, then emits one record per (step, rank).batch_size_samplesfor every rank, same retention rules as other per-rank tables.Files:
utils/batch_size.py,samplers/batch_size_sampler.py,samplers/schema/batch_size_schema.py,aggregator/sqlite_writers/batch_size.pyh2d_auto_timer_patch.py,sdk/wrappers.py,utils/flush_buffers.py,runtime/sampler_registry.py,aggregator/sqlite_writer.pytests/test_batch_size_sampler.py(24 tests),tests/runtime/test_sampler_registry.py(updated tuples)tests/batch_size_demo.pyVerified on RunPod:
bytes_total = 2,105,344,n_transfers = 4per step. Matches expected2 * (512*512*4 + 512*8).