8000 Pass an allocation index to MemoryDebugAnnotation::pending_shape_func. by copybara-service[bot] · Pull Request #3679 · google/tsl · GitHub
[go: up one dir, main page]

Skip to content

Pass an allocation index to MemoryDebugAnnotation::pending_shape_func. - #3679

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_1014903409
Nov 7, 2026
Merged

copybara-service[bot] merged 1 commit into
mainfrom
test_1014903409

Conversation

@copybara-service
Copy link
Copy Markdown

Pass an allocation index to MemoryDebugAnnotation::pending_shape_func.

MemoryDebugAnnotation::pending_shape_func currently takes no arguments and can only describe a single pending tensor allocation, preventing batched allocation paths from lazily formatting distinct per-buffer shapes through thread-local debug annotations without passing shape objects through lower-level byte-buffer APIs.

Update MemoryDebugAnnotation::pending_shape_func (and DefaultPendingShapeFunc) to accept a size_t allocation index (0 for single-tensor allocations), add indexed ScopedMemoryDebugAnnotation constructors while retaining delegating zero-argument constructors for existing callers, and pass index 0 at existing single-allocation call sites.

`MemoryDebugAnnotation::pending_shape_func` currently takes no arguments and can only describe a single pending tensor allocation, preventing batched allocation paths from lazily formatting distinct per-buffer shapes through thread-local debug annotations without passing shape objects through lower-level byte-buffer APIs.

Update `MemoryDebugAnnotation::pending_shape_func` (and `DefaultPendingShapeFunc`) to accept a `size_t` allocation index (`0` for single-tensor allocations), add indexed `ScopedMemoryDebugAnnotation` constructors while retaining delegating zero-argument constructors for existing callers, and pass index `0` at existing single-allocation call sites.

PiperOrigin-RevId: 1016029870
@copybara-service
copybara-service Bot merged commit fbb84e9 into main Nov 7, 2026
1 check passed
@copybara-service
copybara-service Bot deleted the test_1014903409 branch November 7, 2026 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0