Skip to content

Commit

Permalink
more style adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Jun 17, 2024
1 parent 0649fcd commit 05c96a1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 5 additions & 7 deletions csrc/custom/custom.cu
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,18 @@ void LLMM1(at::Tensor in_a, at::Tensor in_b, at::Tensor out_c,
at::cuda::getCurrentCUDAStream(), rows_per_block);
}

void wvSpltK_(void* in_a, void* in_b, void* out_c, const int M, const int K, const int N,
cudaStream_t stream, const int CuCount);
void wvSpltK_(void* in_a, void* in_b, void* out_c, const int M, const int K,
const int N, cudaStream_t stream, const int CuCount);

void wvSpltK(at::Tensor in_a, at::Tensor in_b, at::Tensor out_c,
const int N_in, const int CuCount) {
void wvSpltK(at::Tensor in_a, at::Tensor in_b, at::Tensor out_c, const int N_in,
const int CuCount) {
int M = in_a.size(0);
int K = in_a.size(1);
int N = N_in;
wvSpltK_(in_a.data_ptr(), in_b.data_ptr(), out_c.data_ptr(), M, K, N,
at::cuda::getCurrentCUDAStream(), CuCount);
at::cuda::getCurrentCUDAStream(), CuCount);
}



void LLGemmZZ(void* in_a, void* in_b, void* out_c, const int M, const int K,
cudaStream_t stream, const int solidx);

Expand Down
6 changes: 4 additions & 2 deletions vllm/model_executor/layers/tuned_gemm.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def __init__(self):
self.bestsols = {}
self.load_best_sols()
self.create_ds()
self.CuCount = torch.cuda.get_device_properties(device='cuda').multi_processor_count
self.CuCount = torch.cuda.get_device_properties(
device='cuda').multi_processor_count

if (self.save_gemm == 1):
self.tuned_df = pd.DataFrame(columns=['M', 'N', 'K'])
Expand Down Expand Up @@ -89,7 +90,8 @@ def mm(self, inp, weights):
]).drop_duplicates()
self.tuned_df.to_csv(self.untune_path, index=False)

if ((n == 4 or n == 3 or n== 2 or n == 1 ) and inp_view.dtype == torch.float16) :
if ((n == 4 or n == 3 or n== 2 or n == 1)
and inp_view.dtype == torch.float16):
out = torch.empty(inp_view.shape[0],
weights.shape[0],
dtype=inp_view.dtype,
Expand Down

0 comments on commit 05c96a1

Please sign in to comment.