Skip to content
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 information that can be received from SoC_Descriptor or HAL out of Device interface #17205

Open
ayerofieiev-tt opened this issue Jan 28, 2025 · 4 comments
Assignees

Comments

@ayerofieiev-tt
Copy link
Member

std::unordered_set<CoreCoord> MeshDevice::get_active_ethernet_cores(bool skip_reserved_tunnel_cores) const
std::unordered_set<CoreCoord> MeshDevice::get_inactive_ethernet_cores() const;
bool MeshDevice::is_inactive_ethernet_core(CoreCoord logical_core) const;
std::tuple<chip_id_t, CoreCoord> MeshDevice::get_connected_ethernet_core(CoreCoord eth_core) const;
bool MeshDevice::is_active_ethernet_core(CoreCoord logical_core, bool skip_reserved_tunnel_cores) const;
std::vector<CoreCoord> MeshDevice::get_ethernet_sockets(chip_id_t connected_chip_id) const;
bool MeshDevice::is_mmio_capable() const;
std::vector<std::vector<chip_id_t>> MeshDevice::get_tunnels_from_mmio() const;
size_t MeshDevice::get_device_kernel_defines_hash();
std::vector<std::pair<transfer_info_cores, uint32_t>> MeshDevice::extract_dst_noc_multicast_info(const std::vector<CoreRange>& ranges, const CoreType core_type);
@ayerofieiev-tt
Copy link
Member Author

ayerofieiev-tt commented Jan 29, 2025

std::unordered_set<CoreCoord> MeshDevice::get_active_ethernet_cores(bool skip_reserved_tunnel_cores) const;

Only used in tests and in device itself.

Additionally there are calls to Cluser::instance()::get_active_ethernet_cores(t_chip_id); in

  • profiler.cpp
  • tt_metal_profiler.cpp
  • llrt
  • sub_device_manager
  • watcher_device_reader
  • debug_helpers

Similar situation with

std::unordered_set<CoreCoord> MeshDevice::get_inactive_ethernet_cores() const;
bool MeshDevice::is_inactive_ethernet_core(CoreCoord logical_core) const;
std::tuple<chip_id_t, CoreCoord> MeshDevice::get_connected_ethernet_core(CoreCoord eth_core) const;

This method has use in erisc_datamover_builder.cpp in TT-NN CCL

bool MeshDevice::is_active_ethernet_core(CoreCoord logical_core, bool skip_reserved_tunnel_cores) const;

Same as above + all_gather_op_multi_core.cpp + ccl_common.cpp

std::vector<CoreCoord> MeshDevice::get_ethernet_sockets(chip_id_t connected_chip_id) const;

In eth_tunneler.cpp and hardware_command_queue.cpp and EnqueueRecordEventCommand inside command_queue

bool MeshDevice::is_mmio_capable() const;

Not used anywhere

std::vector<std::vector<chip_id_t>> MeshDevice::get_tunnels_from_mmio() const;

Unrelated to the rest, only used by Program to calculate KernelCompileHash during program compilation

size_t MeshDevice::get_device_kernel_defines_hash();

Also unrelated to the rest, used by Program to populate_dispatch_data

std::vector<std::pair<transfer_info_cores, uint32_t>> MeshDevice::extract_dst_noc_multicast_info(const std::vector<CoreRange>& ranges, const CoreType core_type);

@ayerofieiev-tt
Copy link
Member Author

My recommendation:

  • Remove unused get_tunnels_from_mmio
  • Remove next methods from device. Replace with direct calls to Cluster::instance() (used in tests, or there are already plenty of calls to cluster)
    • get_active_ethernet_cores
    • get_inactive_ethernet_cores
    • is_inactive_ethernet_core
    • get_connected_ethernet_core
    • is_active_ethernet_core
    • get_ethernet_sockets
    • is_mmio_capable
  • Extract to a separate ticket get_device_kernel_defines_hash, extract_dst_noc_multicast_info

@ayerofieiev-tt
Copy link
Member Author

@cfjchu @afuller-TT thoughts?

@cfjchu
Copy link
Collaborator

cfjchu commented Jan 29, 2025

I agree with the proposal. That sounds great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants