Skip to content

Commit

Permalink
[reland] Add int1 to int7 dtypes
Browse files Browse the repository at this point in the history
Summary:
Similar to #117208, we want to add int1 to int7 for edge use cases
for weight quantization

Test Plan:
python test/test_quantization.py -k test_uint4_int4_dtype

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 9979fb52ef74c78a1c1f024bb1697ed51c008954
Pull Request resolved: #137928
  • Loading branch information
jerryzh168 committed Oct 14, 2024
1 parent 86631ec commit f4dbb6b
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 29 deletions.
7 changes: 7 additions & 0 deletions aten/src/ATen/DLConvertor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ DLDataType getDLDataType(const Tensor& t) {
case ScalarType::UInt64:
dtype.code = DLDataTypeCode::kDLUInt;
break;
case ScalarType::Int1:
case ScalarType::Int2:
case ScalarType::Int3:
case ScalarType::Int4:
case ScalarType::Int5:
case ScalarType::Int6:
case ScalarType::Int7:
case ScalarType::Char:
dtype.code = DLDataTypeCode::kDLInt;
break;
Expand Down
Loading

0 comments on commit f4dbb6b

Please sign in to comment.