-
Notifications
You must be signed in to change notification settings - Fork 100
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
Extract CommandQueue interface #17352
Conversation
#include "trace_buffer.hpp" | ||
#include "hardware_command_queue.hpp" | ||
#include "memcpy.hpp" | ||
#include "command_queue_interface.hpp" |
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.
not an interface really. need to find a better name, likely need to split. definitely need to move some things to cpp.
contains SystemMemoryManager, some "deprecated" singleton and a bunch of other things. Very big include.
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.
Yeah, definitely needs a split. Since now there is an actual "cq interface", maybe rename to "cq utils"?
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.
Great!
#include "trace_buffer.hpp" | ||
#include "hardware_command_queue.hpp" | ||
#include "memcpy.hpp" | ||
#include "command_queue_interface.hpp" |
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.
Yeah, definitely needs a split. Since now there is an actual "cq interface", maybe rename to "cq utils"?
volatile bool is_dprint_server_hung() override; | ||
volatile bool is_noc_hung() override; |
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.
🥇
…nds. move things around
### Ticket #17339 ### Problem description CommandQueue exposes all the details. CommandQueue has many things in the interface which I'd prefer us to cleanup. We need to allow MeshBuffer and MeshWorkload to go via CommandQueue. ### What's changed CommandQueue is now just an inteface command_queue.hpp is what you care about and it now includes way less. Moved command_queue_commands.hpp our of API folder. Yay! 😁 HWCommandQueue implements that interface. Device creates it inside. hardware_command_queue.hpp is relocated from api and can't be included. Yay! 😁 There is still some crap with 3 free functions which had Enqueue in them - which have nothing to do with CommandQueue - for now, located in command_queue.hpp 💩 There is some mess with command_queue_interface.hpp and command_queue_commands.hpp. Need to sort out separately. 💩 ### What's next I expect that next we work our an interface that works for both MeshBuffer and MeshWorkload, while still accommodating Buffer and Program 🔮 ```cpp // CommandQueue virtual void enqueue_program(Program& program, bool blocking) = 0; virtual void enqueue_write_buffer(Buffer& buffer, const void* src, const BufferRegion& region, bool blocking, tt::stl::Span<const SubDeviceId> sub_device_ids = {}) = 0; ``` vs ```cpp // MeshCommandQueue void enqueue_mesh_workload(MeshWorkload& mesh_workload, bool blocking); void enqueue_write_shard( std::shared_ptr<MeshBuffer>& mesh_buffer, const void* host_data, const Coordinate& coord, bool blocking); void enqueue_write_shard_to_sub_grid( const MeshBuffer& buffer, const void* host_data, const LogicalDeviceRange& device_range, bool blocking); void enqueue_write_mesh_buffer(const std::shared_ptr<MeshBuffer>& buffer, const void* host_data, bool blocking); ``` #### enqueue_program vs enqueue_mesh_workload I propose to update as `enqueue_workload(MeshWorkload)` and make sure that MeshWorkload can be (maybe even implicitly) constructed from Program #### enqueue_write_buffer vs enqueue_write* I don't know how to best handle. Need to align with @omilyutin-tt @tt-asaigal @cfjchu ### Checklist - [x] [Post commit CI](https://github.com/tenstorrent/tt-metal/actions/runs/13060406436)
### Ticket tenstorrent#17339 ### Problem description CommandQueue exposes all the details. CommandQueue has many things in the interface which I'd prefer us to cleanup. We need to allow MeshBuffer and MeshWorkload to go via CommandQueue. ### What's changed CommandQueue is now just an inteface command_queue.hpp is what you care about and it now includes way less. Moved command_queue_commands.hpp our of API folder. Yay! 😁 HWCommandQueue implements that interface. Device creates it inside. hardware_command_queue.hpp is relocated from api and can't be included. Yay! 😁 There is still some crap with 3 free functions which had Enqueue in them - which have nothing to do with CommandQueue - for now, located in command_queue.hpp 💩 There is some mess with command_queue_interface.hpp and command_queue_commands.hpp. Need to sort out separately. 💩 ### What's next I expect that next we work our an interface that works for both MeshBuffer and MeshWorkload, while still accommodating Buffer and Program 🔮 ```cpp // CommandQueue virtual void enqueue_program(Program& program, bool blocking) = 0; virtual void enqueue_write_buffer(Buffer& buffer, const void* src, const BufferRegion& region, bool blocking, tt::stl::Span<const SubDeviceId> sub_device_ids = {}) = 0; ``` vs ```cpp // MeshCommandQueue void enqueue_mesh_workload(MeshWorkload& mesh_workload, bool blocking); void enqueue_write_shard( std::shared_ptr<MeshBuffer>& mesh_buffer, const void* host_data, const Coordinate& coord, bool blocking); void enqueue_write_shard_to_sub_grid( const MeshBuffer& buffer, const void* host_data, const LogicalDeviceRange& device_range, bool blocking); void enqueue_write_mesh_buffer(const std::shared_ptr<MeshBuffer>& buffer, const void* host_data, bool blocking); ``` #### enqueue_program vs enqueue_mesh_workload I propose to update as `enqueue_workload(MeshWorkload)` and make sure that MeshWorkload can be (maybe even implicitly) constructed from Program #### enqueue_write_buffer vs enqueue_write* I don't know how to best handle. Need to align with @omilyutin-tt @tt-asaigal @cfjchu ### Checklist - [x] [Post commit CI](https://github.com/tenstorrent/tt-metal/actions/runs/13060406436)
Ticket
#17339
Problem description
CommandQueue exposes all the details.
CommandQueue has many things in the interface which I'd prefer us to cleanup.
We need to allow MeshBuffer and MeshWorkload to go via CommandQueue.
What's changed
CommandQueue is now just an inteface
command_queue.hpp is what you care about and it now includes way less.
Moved command_queue_commands.hpp our of API folder. Yay! 😁
HWCommandQueue implements that interface.
Device creates it inside.
hardware_command_queue.hpp is relocated from api and can't be included. Yay! 😁
There is some mess with command_queue_interface.hpp. Need to sort out separately. 💩
What's next
I expect that next we work our an interface that works for both MeshBuffer and MeshWorkload, while still accommodating Buffer and Program 🔮
vs
enqueue_program vs enqueue_mesh_workload
I propose to update as
enqueue_workload(MeshWorkload)
and make sure that MeshWorkload can be (maybe even implicitly) constructed from Programenqueue_write_buffer vs enqueue_write*
I don't know how to best handle. Need to align with @omilyutin-tt @tt-asaigal @cfjchu
Checklist