Skip to content

Commit

Permalink
LightMetal - Workaround in captureDeallocateBuffer() to ignore if Cre…
Browse files Browse the repository at this point in the history
…ateBuffer() not used (program binaries, trace buffer)
  • Loading branch information
kmabeeTT committed Jan 13, 2025
1 parent bad6a24 commit a311929
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tt_metal/impl/lightmetal/host_api_capture_helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ inline void CaptureCreateBuffer(std::shared_ptr<Buffer> buffer, const Interleave
inline void CaptureDeallocateBuffer(Buffer* buffer) {
auto& ctx = LightMetalCaptureContext::Get();

// TODO (kmabee) - Workaround for now. Program Binaries buffer is created via Buffer::create() but can be
// deallocated on Program destruction while capturing is still enabled depending on test structure (scope).
// If we avoid recursively tracing host APIs this could go away.
if (!ctx.IsInMap(buffer)) {
log_warning(tt::LogMetalTrace, "Cannot capture DeallocateBuffer() without CreateBuffer() - ignoring.");
return;
}

auto buffer_global_id = ctx.GetGlobalId(buffer);

log_debug(
Expand Down

0 comments on commit a311929

Please sign in to comment.