Fix minus axis case for kv cache primitive buffer fusing (#21958)

Co-authored-by: Taylor Lee <taylor.lee@intel.com>
This commit is contained in:
Pavel Durandin 2024-01-05 04:22:42 +04:00 committed by GitHub
parent ca31765d1a
commit a741d5a8ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -648,6 +648,8 @@ void prepare_buffer_fusing::run(program& p) {
return;
auto concat_axis_legacy = node.get_primitive()->concat_axis;
if (concat_axis_legacy < 0)
concat_axis_legacy = kv_out_layout.get_partial_shape().size() + concat_axis_legacy;
if (concat_axis_legacy >= 2) {
auto spatial_axis = concat_axis_legacy - 2;
// Default and minimum number of dimensions is 4