Instructions to use galqiwi/flute_kernels with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Kernels
How to use galqiwi/flute_kernels with Kernels:
# !pip install kernels from kernels import get_kernel # a version (or an explicit revision) is required; see the "Files and versions" tab for the available ones kernel = get_kernel("galqiwi/flute_kernels", version=1) - Notebooks
- Google Colab
- Kaggle
Download torch-ext/torch_binding.cpp from galqiwi/flute_kernels: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/galqiwi/flute_kernels/resolve/main/torch-ext/torch_binding.cpp
- Command line
-
hf download hf://galqiwi/flute_kernels/torch-ext/torch_binding.cpp
-
curl -L -o torch_binding.cpp https://huggingface.co/galqiwi/flute_kernels/resolve/main/torch-ext/torch_binding.cpp
1.04 kB
| TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, ops) { | |
| ops.def( | |
| "qgemm_raw_simple(Tensor input, Tensor weight, Tensor scales, " | |
| "Tensor table, Tensor table2, Tensor(a!) workspace, " | |
| "int num_bits, int group_size, int template_id, int num_sms) -> Tensor"); | |
| ops.def( | |
| "qgemm_raw_simple_hadamard(Tensor input, Tensor weight, Tensor scales, " | |
| "Tensor table, Tensor table2, Tensor(a!) workspace, " | |
| "int num_bits, int group_size, int hadamard_size, " | |
| "int template_id, int num_sms) -> Tensor"); | |
| ops.def("hadamard_transform(Tensor(a!) input, bool inplace) -> Tensor"); | |
| ops.impl("qgemm_raw_simple", c10::kCUDA, &qgemm_raw_simple); | |
| ops.impl("qgemm_raw_simple_hadamard", c10::kCUDA, &qgemm_raw_simple_hadamard); | |
| ops.impl("hadamard_transform", c10::kCUDA, &hadamard_transform); | |
| } | |
| REGISTER_EXTENSION(TORCH_EXTENSION_NAME) | |