Skip to content

Conversation

@jacobbohlin
Copy link
Contributor

This PR improves the cascader's memory transfer cycle estimates by taking memory burst length and latency into account. Copying tensors between external memories are also more accurately modeled.

Change-Id: Idadc5f354dce42c8dbcdcbe281d324adddb41ba3
@jacobbohlin
Copy link
Contributor Author

@manupak
Copy link
Contributor

manupak commented Mar 8, 2022

@ekalda would be able to take a look here ?

Copy link
Contributor

@ekalda ekalda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Some nits, can be done in a follow up :)

Comment on lines +67 to +69
read_latency: int = 0,
write_latency: int = 0,
burst_length: int = 1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: add these to the docstring as well

int read_bandwidth;
/*! \brief The write bandwidth of the region in bytes per cycle */
int write_bandwidth;
/*! \brief The read bandwidth of the region in bytes per cycle */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Update the docstring

output_cycles *= reduce(lambda a, b: a * b, output_block, 1)
output_cycles = int(math.ceil(output_cycles))
block_config.append(BlockConfig(output_block, 0, output_cycles))
block_config.append(BlockConfig(output_block, output_block, 0, output_cycles))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use the larger of the input blocks?

Comment on lines +366 to +367
int read_cycles = bytes_transferred * home_region->read_bandwidth +
input_configs[i]->GetHomeRegion()->read_latency;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
int read_cycles = bytes_transferred * home_region->read_bandwidth +
input_configs[i]->GetHomeRegion()->read_latency;
int read_cycles = bytes_transferred * home_region->read_bandwidth +
home_region->read_latency;

Copy link
Contributor

@manupak manupak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets take it in a follow up :)

@manupak manupak merged commit 4d88a45 into apache:main Mar 14, 2022
@manupak
Copy link
Contributor

manupak commented Mar 14, 2022

Thanks @ekalda @jacobbohlin ! this is merged now.

pfk-beta pushed a commit to pfk-beta/tvm that referenced this pull request Apr 11, 2022
Change-Id: Idadc5f354dce42c8dbcdcbe281d324adddb41ba3
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

Successfully merging this pull request may close these issues.

3 participants