forked from vllm-project/vllm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ROCm] Add support for Punica kernels on AMD GPUs (vllm-project#3140)
Co-authored-by: miloice <jeffaw99@hotmail.com>
- Loading branch information
1 parent
0ee535b
commit ff5abcd
Showing
10 changed files
with
287 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#pragma once | ||
|
||
#include <torch/extension.h> | ||
|
||
void dispatch_bgmv(torch::Tensor y, torch::Tensor x, torch::Tensor w, | ||
torch::Tensor indicies, int64_t layer_idx, float scale); | ||
|
||
void dispatch_bgmv_low_level(torch::Tensor y, torch::Tensor x, torch::Tensor w, | ||
torch::Tensor indicies, int64_t layer_idx, | ||
float scale, int64_t h_in, int64_t h_out, | ||
int64_t y_offset); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include <torch/extension.h> | ||
|
||
#include "punica_ops.h" | ||
|
||
//====== pybind ====== | ||
|
||
#define DEFINE_pybind(name) m.def(#name, &name, #name); | ||
|
||
PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { | ||
m.def("dispatch_bgmv", &dispatch_bgmv, "dispatch_bgmv"); | ||
m.def("dispatch_bgmv_low_level", &dispatch_bgmv_low_level, | ||
"dispatch_bgmv_low_level"); | ||
} |
Oops, something went wrong.