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

Clean Device init APIs #17209

Open
ayerofieiev-tt opened this issue Jan 28, 2025 · 1 comment
Open

Clean Device init APIs #17209

ayerofieiev-tt opened this issue Jan 28, 2025 · 1 comment
Assignees

Comments

@ayerofieiev-tt
Copy link
Member

ayerofieiev-tt commented Jan 28, 2025

These APIs are used by DevicePool only. They are critical to init a device.

bool Device::initialize(const uint8_t num_hw_cqs, size_t l1_small_size, size_t trace_region_size, tt::stl::Span<const std::uint32_t> l1_bank_remap, bool minimal);
void Device::build_firmware();
void Device::reset_cores();
void Device::initialize_and_launch_firmware();
void Device::init_command_queue_host();
void Device::init_command_queue_device();
@ayerofieiev-tt ayerofieiev-tt changed the title Clean init related APIs in Device Clean Device init APIs Jan 29, 2025
@ayerofieiev-tt
Copy link
Member Author

ayerofieiev-tt commented Jan 29, 2025

Should this be Device::initialize method?

void DevicePool::initialize_device(IDevice* dev) const {
    detail::ClearProfilerControlBuffer(dev);

    // Create system memory writer for this device to have an associated interface to hardware command queue (i.e.
    // hugepage). Need to do this before FW init so we know what dispatch cores to reset.
    if (this->using_fast_dispatch) {
        detail::DispatchStateCheck(true);
        dev->init_command_queue_host();
    } else {
        detail::DispatchStateCheck(false);
        TT_ASSERT(dev->num_hw_cqs() == 1, "num_hw_cqs must be 1 in slow dispatch");
    }

    ClearNocData(dev);
    DprintServerAttach(dev);
    watcher_init(dev);

    // TODO: as optimization, investigate removing all this call for already initialized devivces
    if (!llrt::RunTimeOptions::get_instance().get_skip_reset_cores_on_init()) {
        dev->reset_cores();
    }
    dev->initialize_and_launch_firmware();

    watcher_attach(dev);

    // Set up HW command queues on device for FD
    if (this->using_fast_dispatch) {
        dev->init_command_queue_device();
    }
}

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

2 participants