-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LightMetal - Add LoadTrace() API and move TraceDescriptor out of detail namespace (#17039) #17313
Conversation
@@ -312,7 +312,7 @@ EnqueueTraceCommand::EnqueueTraceCommand( | |||
uint32_t command_queue_id, | |||
IDevice* device, | |||
SystemMemoryManager& manager, | |||
std::shared_ptr<detail::TraceDescriptor>& descriptor, | |||
std::shared_ptr<TraceDescriptor>& descriptor, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yikes, I think all of these can and should be const &
. (outside of the PR, just a drive by comment:) )
this->id_, | ||
active_sub_device_manager->id()); | ||
|
||
auto& trace_buffer = active_sub_device_manager->create_trace(trace_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(outside of this PR)
These are weird APIs that return references to smart pointers. @dmakoviichuk-tt wdyt? I think these:
const std::unique_ptr<Allocator>& get_initialized_allocator(SubDeviceId sub_device_id) const;
std::unique_ptr<Allocator>& sub_device_allocator(SubDeviceId sub_device_id);
std::shared_ptr<TraceBuffer>& create_trace(uint32_t tid);
Should be re-written as:
const Allocator* get_initialized_allocator(SubDeviceId sub_device_id) const;
Allocator* sub_device_allocator(SubDeviceId sub_device_id);
std::shared_ptr<TraceBuffer> create_trace(uint32_t tid);
…il namespace (#17039) - Will be used by Light Metal replay after upcoming PR, when executing a metal-trace traced program from binary, TraceDescriptor is extracted from flatbuffer binary and loaded to device through this API. - Unrelated - Change trace_buffer.hpp to use fwd decl Buffer instead of buffer.hpp incl to reduce dependencies on users of trace_buffer.hpp
6294297
to
d1eb7be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks for making the changes.
Ticket
I am breaking up original PR I put up recently into smaller bite-sized chunks as @omilyutin-tt suggested. Here is round 3.
Problem description
This is initial/bootstrapping changes for "Light Metal" capture/replay feature that uses Flatbufers as serialization/deserialization library. See my previous bigger PR (#16573) if you want to see how this will be used by followup merge, or context.
What's changed
LoadTrace(IDevice* device, const uint8_t cq_id, const uint32_t trace_id, TraceDescriptor& trace_desc)
that is unused now, but will be used by Light Metal replay after upcoming PR, when executing a metal-trace traced program from binary, TraceDescriptor is extracted from flatbuffer binary and loaded to device through this API.TraceDescriptor
out of detail namespace after discussion in parent PR. Don't want to expose detail objects on public APIs. Thetrace_buffer.hpp
that containsTraceDescriptor
was already in public API folder (nice).I incorporated some feedback in parent PR to use "trace_id" as variable name instead of "tid" (which is departure from other trace-related APIs, but in order to keep this PR contained, not updating existing APIs).
Checklist