8000 Update · pytorch/pytorch@8be99ae · GitHub
[go: up one dir, main page]

Skip to content

Commit 8be99ae

Browse files
committed
Update
[ghstack-poisoned]
2 parents ffe49af + f5ffeef commit 8be99ae

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

aten/src/ATen/native/quantized/cpu/ACLUtils.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ QuantMatmul::QuantMatmul(
3636
arm_compute::DataType::F32);
3737
bia_tensor_ = arm_compute::Tensor();
3838

39-
bia_tensor_.value().allocator()->init(bia_tensor_info);
40-
bia_tensor_.value().allocator()->import_memory(bias_ptr.value());
39+
bia_tensor_->allocator()->init(bia_tensor_info);
40+
bia_tensor_->allocator()->import_memory(bias_ptr.value());
4141
}
4242
const bool fuse_relu =
4343
std::get<static_cast<int>(QuantMatmulCacheKeyIndex::FUSE_RELU)>(key);
@@ -52,7 +52,7 @@ QuantMatmul::~QuantMatmul() {
5252
// using the pointer
5353
wei_q_tensor_.allocator()->free();
5454
if (bia_tensor_.has_value()) {
55-
bia_tensor_.value().allocator()->free();
55+
bia_tensor_->allocator()->free();
5656
}
5757
}
5858

@@ -147,7 +147,7 @@ void DynamicQuantMatmul::configure() {
147147
&dst_tensor,
148148
gemm_info_);
149149
if (relu.has_value()) {
150- relu.value().configure(&dst_tensor, &dst_tensor, relu_info_.value());
150+
relu->configure(&dst_tensor, &dst_tensor, relu_info_.value());
151151
}
152152
}
153153

@@ -348,8 +348,8 @@ PackedLinearWeightsACL::PackedLinearWeightsACL(
348348
auto w = *(weight_.get());
349349
k_ = w.get_dim(0);
350350
n_ = w.get_dim(1);
351-
wei_zero_point_ = orig_weight_.q_zero_point();
352-
wei_scale_ = orig_weight_.q_scale();
351+
weight_zero_point_ = orig_weight_.q_zero_point();
352+
weight_scale_ = orig_weight_.q_scale();
353353
}
354354

355355
#endif // AT_MKLDNN_ACL_ENABLED()

aten/src/ATen/native/quantized/cpu/ACLUtils.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ struct PackedLinearWeightsACL : public PackedLinearWeightsOnednn {
184184
private:
185185
int64_t k_;
186186
int64_t n_;
187-
int64_t wei_zero_point_;
188-
double wei_scale_;
187+
int64_t weight_zero_point_;
188+
double weight_scale_;
189189

190190
// A 2 element (per layer) cache. Given it's not intended to store more than 2
191191
// elements, we do not need a fancy implementation. The idea behind it is to
@@ -224,8 +224,8 @@ struct PackedLinearWeightsACL : public PackedLinearWeightsOnednn {
224224
auto acl_gemm = std::make_shared<ACLQuantMatmulT>(
225225
k_,
226226
n_,
227-
wei_scale_,
228-
wei_zero_point_,
227+
weight_scale_,
228+
weight_zero_point_,
229229
(int8_t*)weight_.get()->get_data_handle(),
230230
bias_ptr,
231231
key);

aten/src/ATen/native/quantized/cpu/qlinear.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,11 +1118,11 @@ at::Tensor PackedLinearWeightsACL::apply_impl(
11181118
int64_t output_zero_point) {
11191119
const int64_t dim = input.dim();
11201120
TORCH_CHECK(
1121-
dim != 0, "qlinear (ONEDNN): input dim should be at least 1, but got 0");
1121+
dim != 0, "qlinear (ACL): input dim should be at least 1, but got 0");
11221122
TORCH_CHECK(
11231123
input.scalar_type() == c10::ScalarType::QUInt8 ||
11241124
input.scalar_type() == c10::ScalarType::QInt8,
1125-
"qlinear (ONEDNN): data type of input should be QUInt8 or QInt8.");
1125+
"qlinear (ACL): data type of input should be QUInt8 or QInt8.");
11261126

11271127
auto input_contig = input.expect_contiguous();
11281128

aten/src/ATen/native/quantized/cpu/qlinear_dynamic.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ at::Tensor PackedLinearWeightsACL::apply_dynamic_impl(
713713
"The dimension of input tensor should be larger than or equal to 2");
714714
TORCH_CHECK(
715715
input.scalar_type() == c10::ScalarType::Float,
716-
"qlinear_dynamic (ONEDNN): data type of input should be float.");
716+
"qlinear_dynamic (ACL): data type of input should be float.");
717717

718718
auto input_contig = input.contiguous();
719719
const int64_t dim = input.dim();
@@ -774,7 +774,7 @@ at::Tensor PackedLinearWeightsACL::apply_dynamic_impl(
774774
acl_gemm->quant.run();
775775

776776
// allocation for fp32 out tensor
777-
at::Tensor output = at::empty({m, n_}, input.options().dtype(at::kFloat));
777+
auto output = at::empty({m, n_}, input.options().dtype(at::kFloat));
778778
if (output.numel() == 0)
779779
return output;
780780

@@ -790,7 +790,7 @@ at::Tensor PackedLinearWeightsACL::apply_dynamic_impl(
790790
acl_gemm->gemm.run();
791791

792792
if (acl_gemm->relu.has_value()) {
793-
acl_gemm->relu.value().run();
793+
acl_gemm->relu->run();
794794
}
795795

796796
// this will not free memory, it will just tell ACL that we're no longer

0 commit comments

Comments
 (0)
0