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

Where are the compute cycles simulated? #15

Open
prapti02 opened this issue May 18, 2024 · 2 comments
Open

Where are the compute cycles simulated? #15

prapti02 opened this issue May 18, 2024 · 2 comments

Comments

@prapti02
Copy link

Look at the following code fragment in PIMBenchTestCases.h:

uint64_t measureCycle(bool is_pim_ = false)
{
cout << "Inside uint64_t measureCycle(bool is_pim_ = false). 1" << endl;
// cin.get();
uint64_t cycle = 0;
uint64_t starting_addr = 0;

    if (is_pim_ == true)
    {
        cout << "Inside if (usePIM). "<<endl;
        kernel_->executeEltwise(dim_data_->output_npbst_.getTotalDim(), pimBankType::ALL_BANK,
                                kernel_type_, input_row0_, result_row_, input_row1_);
        kernel_->runPIM();
        cycle = kernel_->getCycle();
    }
    else
    {
        cout << "Inside else (usePIM). "<<endl;
        uint32_t input_data_size_in_byte =
            dim_data_->getDataSize(dim_data_->input_dim_, dim_data_->batch_size_);
        uint32_t input1_data_size_in_byte =
            dim_data_->getDataSize(dim_data_->input_dim_, dim_data_->batch_size_);
        uint32_t output_data_size_in_byte =
            dim_data_->getDataSize(dim_data_->output_dim_, dim_data_->batch_size_);
        starting_addr = genMemTraffic(mem_, false, input_data_size_in_byte, starting_addr);
        starting_addr = genMemTraffic(mem_, false, input1_data_size_in_byte, starting_addr);
        run(mem_, &cycle);
        genMemTraffic(mem_, true, output_data_size_in_byte, starting_addr);  // result-vec
        run(mem_, &cycle);
    }
    
    Where is it simulating the compute cycles in this code? The run() adds memory cycles in its implementation. How are we comparing cycles taken with and without PIM without taking in account the compute cycles?
@iamshcha
Copy link
Collaborator

This is a similar question to another issue. Please See #10

@prapti02
Copy link
Author

I have a follow-up question. Is this code considering the data transfer time to the CPU for non-PIM cases? I see that the PIM-enabled cycles are more than the PIM-disabled cycles. I am adding compute cycles to the PIM disabled case. Even after that the cycles are less than that of the PIM enabled case.

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

No branches or pull requests

2 participants