Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
chenfucn committed Nov 20, 2023
1 parent 720b85e commit 2a85532
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions onnxruntime/core/mickey/blk_q4/prepack_sm80.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,12 @@ struct BlockwiseQuantization {
ORT_ENFORCE(weights_prepacked.size() == weights.size(),
"Prepacked Weight tensor buffer should be the same size!");

const MatrixRef<uint8_t const, ColumnMajorLayout, ExtraBoundsCheck> tensor_weight(weights, make_Position(rows / 2, columns));
const MatrixRef<uint8_t, LayoutWPack, ExtraBoundsCheck> tensor_weight_prepacked(weights_prepacked, make_Position(rows, columns / 2));
const MatrixRef<uint8_t const, ColumnMajorLayout, ExtraBoundsCheck>
tensor_weight(weights, make_Position(rows / 2, columns));
const MatrixRef<uint8_t, LayoutWPack, ExtraBoundsCheck>
tensor_weight_prepacked(weights_prepacked, make_Position(rows, columns / 2));

// TODO!! parallized this.
// TODO(fuchen)!! parallized this.

Check warning on line 122 in onnxruntime/core/mickey/blk_q4/prepack_sm80.h

View workflow job for this annotation

GitHub Actions / Lint C++

[cpplint] reported by reviewdog 🐶 TODO(my_username) should be followed by a space [whitespace/todo] [2] Raw Output: onnxruntime/core/mickey/blk_q4/prepack_sm80.h:122: TODO(my_username) should be followed by a space [whitespace/todo] [2]
auto t0_base = make_Position(0, 0);
auto t1_base = make_Position(4, 0);
auto t2_base = make_Position(0, 8);
Expand Down Expand Up @@ -155,8 +157,6 @@ struct BlockwiseQuantization {
* @brief We rearrange the values of the quantization scale and offset tensors
* to facilitate faster loading to tensor core, only 16b gemm, and (1,n)
* block quantization.
*
* TODO!! also only in sm80 the mma tile is 16x8x16.
*/
static constexpr bool ShouldRearrangeMeta = sizeof(ElementT) == 2 && QuantBlocking::kRow == 1;

Expand Down Expand Up @@ -245,7 +245,8 @@ struct BlockwiseQuantization {
ORT_ENFORCE(offsets.size() == size_t(((meta_shape[0] + 1) / 2) * meta_shape[1]),
"Quantization offset tensor shape mismatch!");

MatrixRef<uint8_t const, ColumnMajorLayout, ExtraBoundsCheck> tensor_offset(offsets, make_Position((meta_shape[0] + 1) / 2, meta_shape[1]));
MatrixRef<uint8_t const, ColumnMajorLayout, ExtraBoundsCheck>
tensor_offset(offsets, make_Position((meta_shape[0] + 1) / 2, meta_shape[1]));
MatrixRef<uint8_t, LayoutQmeta, ExtraBoundsCheck> tensor_offset_prepacked(offsets_prepacked, meta_shape);

// Only prepacking scale and offset tensors for a often used special case:
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/util/matrix_layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ class MatrixRef {
}

__forceinline__
gsl::span<Element> const& data() const { return data_;}
gsl::span<Element> const& data() const { return data_; }

__forceinline__
MatCoord const& shape() const { return shape_; }
Expand Down

0 comments on commit 2a85532

Please sign in to comment.