Skip to content

Commit

Permalink
add dynamic quantize gemm benchmark [step 3: int8 gemm compute] (pyto…
Browse files Browse the repository at this point in the history
…rch#2271)

Summary:

This diff adds support for the `qlinear_channelwise` operation in the FX backend for Freya and Artemis. The kernel implementation is left as a placeholder.

Differential Revision: D50437264
  • Loading branch information
Jiawei Zhang authored and facebook-github-bot committed Jan 17, 2024
1 parent 54a56f0 commit a42c378
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions fbgemm_gpu/src/qlinear_channelwise/qlinear_channelwise_mtia.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/

#include <ATen/ATen.h>
#include <ATen/core/op_registration/op_registration.h>
#include <torch/library.h>

static at::Tensor qlinear_channelwise(
at::Tensor x,
at::Tensor weight,
at::Tensor bias,
at::Tensor input_scale,
at::Tensor weight_scale,
at::Tensor weight_zero_point,
at::Tensor relu) {
return x;
}

TORCH_LIBRARY_FRAGMENT(fbgemm, m) {
m.def(
"qlinear_channelwise(Tensor x, Tensor weight, Tensor "
"bias, Tensor input_scale, Tensor weight_scale, Tensor "
"weight_zero_point, Tensor relu) -> Tensor");
m.impl(
"qlinear_channelwise",
torch::dispatch(c10::DispatchKey::CPU, TORCH_FN(qlinear_channelwise)));
}

0 comments on commit a42c378

Please sign in to comment.