Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ class TransposeKvCacheByBlock : public OpDef {
.UnknownShapeFormat({ge::FORMAT_ND, ge::FORMAT_ND});
this->Input("blockIDs")
.ParamType(REQUIRED)
.DataTypeList({ge::DT_INT64})
.FormatList({ge::FORMAT_ND})
.UnknownShapeFormat({ge::FORMAT_ND});
.DataType({ge::DT_INT64, ge::DT_INT64})
.Format({ge::FORMAT_ND, ge::FORMAT_ND})
.UnknownShapeFormat({ge::FORMAT_ND, ge::FORMAT_ND});
Comment on lines +20 to +22
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

This change appears to be a workaround for a framework requirement where all input definitions in an operator must specify the same number of data types and formats, even for REQUIRED inputs that only support a single type. While this fixes the issue, the duplicated type ge::DT_INT64 is not intuitive and could be mistaken for a bug by future developers. To improve maintainability and prevent this fix from being accidentally reverted, please add a comment explaining why this duplication is necessary.

            // NOTE: The number of types and formats must match other dynamic inputs
            // in this op definition, even though this input is required and only supports one type.
            .DataType({ge::DT_INT64, ge::DT_INT64})
            .Format({ge::FORMAT_ND, ge::FORMAT_ND})
            .UnknownShapeFormat({ge::FORMAT_ND, ge::FORMAT_ND})

this->Attr("blockSize").Int();
this->Attr("headNum").Int();
this->Attr("headDim").Int();
Expand Down
Loading