Explorar el Código

fix a few warnings on the cpu kernels

AlpinDale hace 7 meses
padre
commit
b746fb5562
Se han modificado 2 ficheros con 1 adiciones y 2 borrados
  1. 1 1
      kernels/cpu/cache.cpp
  2. 0 1
      kernels/cpu/pos_encoding.cpp

+ 1 - 1
kernels/cpu/cache.cpp

@@ -84,7 +84,7 @@ void reshape_and_cache_cpu_impl(
 void copy_blocks(std::vector<torch::Tensor> &key_caches,
                  std::vector<torch::Tensor> &value_caches,
                  const torch::Tensor& block_mapping) {
-  int num_layers = key_caches.size();
+  unsigned num_layers = key_caches.size();
   TORCH_CHECK(num_layers == value_caches.size());
   if (num_layers == 0) {
     return;

+ 0 - 1
kernels/cpu/pos_encoding.cpp

@@ -18,7 +18,6 @@ void rotary_embedding_impl(
     const int num_tokens) {
   using scalar_vec_t = vec_op::vec_t<scalar_t>;
   constexpr int VEC_ELEM_NUM = scalar_vec_t::get_elem_num();
-  constexpr int ELEM_SIZE = sizeof(scalar_t);
 
   const int embed_dim = rot_dim / 2;
   TORCH_CHECK(embed_dim % VEC_ELEM_NUM == 0);