mirror of
https://github.com/ml-explore/mlx.git
synced 2025-07-22 09:31:14 +08:00
Remove unused variables (#706)
This commit is contained in:
parent
dc937b8ed3
commit
0925af43b0
@ -24,8 +24,6 @@ void _qmm_t_4_64(
|
|||||||
constexpr int bitmask = (1 << bits) - 1;
|
constexpr int bitmask = (1 << bits) - 1;
|
||||||
constexpr int pack_factor = 32 / bits;
|
constexpr int pack_factor = 32 / bits;
|
||||||
constexpr int packs_in_group = group_size / pack_factor;
|
constexpr int packs_in_group = group_size / pack_factor;
|
||||||
const int Kg = K / group_size;
|
|
||||||
const int Kw = K / pack_factor;
|
|
||||||
|
|
||||||
for (int m = 0; m < M; m++) {
|
for (int m = 0; m < M; m++) {
|
||||||
const uint32_t* w_local = w;
|
const uint32_t* w_local = w;
|
||||||
|
@ -410,7 +410,6 @@ void Compiled::eval_cpu(
|
|||||||
|
|
||||||
// Get the kernel name from the lib
|
// Get the kernel name from the lib
|
||||||
int ndim = shape.size();
|
int ndim = shape.size();
|
||||||
bool dynamic = ndim >= 8;
|
|
||||||
auto kernel_name = kernel_lib_ + (contiguous ? "_contiguous" : "_strided_");
|
auto kernel_name = kernel_lib_ + (contiguous ? "_contiguous" : "_strided_");
|
||||||
if (!contiguous) {
|
if (!contiguous) {
|
||||||
kernel_name += std::to_string(shape.size());
|
kernel_name += std::to_string(shape.size());
|
||||||
|
@ -182,7 +182,6 @@ void implicit_gemm_conv_2D_gpu(
|
|||||||
|
|
||||||
int implicit_M = conv_params.N * conv_params.oS[0] * conv_params.oS[1];
|
int implicit_M = conv_params.N * conv_params.oS[0] * conv_params.oS[1];
|
||||||
int implicit_N = conv_params.O;
|
int implicit_N = conv_params.O;
|
||||||
int implicit_K = conv_params.wS[0] * conv_params.wS[1] * conv_params.C;
|
|
||||||
|
|
||||||
size_t grid_dim_x = (implicit_N + bn - 1) / bn;
|
size_t grid_dim_x = (implicit_N + bn - 1) / bn;
|
||||||
size_t grid_dim_y = (implicit_M + bm - 1) / bm;
|
size_t grid_dim_y = (implicit_M + bm - 1) / bm;
|
||||||
|
@ -167,10 +167,6 @@ void Scatter::eval_gpu(const std::vector<array>& inputs, array& out) {
|
|||||||
|
|
||||||
auto& upd = inputs.back();
|
auto& upd = inputs.back();
|
||||||
size_t nthreads = upd.size();
|
size_t nthreads = upd.size();
|
||||||
NS::UInteger thread_group_size = kernel->maxTotalThreadsPerThreadgroup();
|
|
||||||
if (thread_group_size > nthreads) {
|
|
||||||
thread_group_size = nthreads;
|
|
||||||
}
|
|
||||||
|
|
||||||
compute_encoder->setComputePipelineState(kernel);
|
compute_encoder->setComputePipelineState(kernel);
|
||||||
|
|
||||||
|
@ -691,7 +691,6 @@ void RandomBits::eval_gpu(const std::vector<array>& inputs, array& out) {
|
|||||||
// organize into grid nkeys x elem_per_key
|
// organize into grid nkeys x elem_per_key
|
||||||
MTL::Size grid_dims = MTL::Size(num_keys, half_size + odd, 1);
|
MTL::Size grid_dims = MTL::Size(num_keys, half_size + odd, 1);
|
||||||
NS::UInteger thread_group_size = kernel->maxTotalThreadsPerThreadgroup();
|
NS::UInteger thread_group_size = kernel->maxTotalThreadsPerThreadgroup();
|
||||||
auto nthreads = std::min(num_keys * (half_size + odd), thread_group_size);
|
|
||||||
MTL::Size group_dims = MTL::Size(thread_group_size, 1, 1);
|
MTL::Size group_dims = MTL::Size(thread_group_size, 1, 1);
|
||||||
auto compute_encoder = d.get_command_encoder(s.index);
|
auto compute_encoder = d.get_command_encoder(s.index);
|
||||||
compute_encoder->setComputePipelineState(kernel);
|
compute_encoder->setComputePipelineState(kernel);
|
||||||
|
@ -114,7 +114,6 @@ void gguf_load_quantized(
|
|||||||
<< "has incompatible last dim shape: " << shape[shape.size() - 1];
|
<< "has incompatible last dim shape: " << shape[shape.size() - 1];
|
||||||
throw std::runtime_error(msg.str());
|
throw std::runtime_error(msg.str());
|
||||||
}
|
}
|
||||||
const uint64_t num_blocks = tensor.num_weights / weights_per_block;
|
|
||||||
|
|
||||||
std::vector<int> weights_shape = shape;
|
std::vector<int> weights_shape = shape;
|
||||||
weights_shape.back() /= (weights_per_byte * 4);
|
weights_shape.back() /= (weights_per_byte * 4);
|
||||||
|
@ -628,7 +628,6 @@ std::vector<array> Convolution::vjp(
|
|||||||
auto& wt = primals[1];
|
auto& wt = primals[1];
|
||||||
auto cotan = cotangents[0];
|
auto cotan = cotangents[0];
|
||||||
|
|
||||||
int N = in.shape(0);
|
|
||||||
int O = wt.shape(0);
|
int O = wt.shape(0);
|
||||||
|
|
||||||
// Resolve Padded input shapes and strides
|
// Resolve Padded input shapes and strides
|
||||||
|
Loading…
Reference in New Issue
Block a user