Skip to content

Commit

Permalink
Add shape to rotation deltas
Browse files Browse the repository at this point in the history
  • Loading branch information
vshampor committed Dec 20, 2024
1 parent 9e393b1 commit 9bf9aa8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cpp/src/continuous_batching_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void ContinuousBatchingPipeline::ContinuousBatchingImpl::init(
/* collect_attention_scores = */ true,
/* is_use_per_layer_cache_control = */ true);
m_rotation_deltas_stores.reserve(m_num_decoder_layers);
ov::Shape rotation_deltas_store_shape{m_scheduler->get_block_size() * scheduler_config.num_kv_blocks};
ov::Shape rotation_deltas_store_shape{scheduler_config.num_kv_blocks, m_scheduler->get_block_size()}; // last dim can be later changed to BLOCK_SIZE for per-token granularity
std::cout << "VSHAMPOR: memsetting and pushing delta stores" << std::endl;
for (size_t i = 0; i < m_num_decoder_layers; i++) {
ov::Tensor store(ov::element::i32, rotation_deltas_store_shape);
Expand Down Expand Up @@ -503,8 +503,8 @@ void ContinuousBatchingPipeline::ContinuousBatchingImpl::_compute_cache_rotation
for (size_t i = 0; i < m_num_decoder_layers; i++) {
m_current_step_rotation_deltas.emplace_back(
m_rotation_deltas_stores[i],
ov::Coordinate{0},
ov::Coordinate{num_blocks_to_rotate_for_each_layer[i] * m_scheduler->get_block_size()});
ov::Coordinate{0, 0},
ov::Coordinate{num_blocks_to_rotate_for_each_layer[i], m_scheduler->get_block_size()});
}
}

Expand Down

0 comments on commit 9bf9aa8

Please sign in to comment.