Download ext-torch/torch_binding.cpp from RedHatAI/quantization: direct link, hf CLI and curl.
- Browser
- Download file 4.58 kB
-
https://huggingface.co/RedHatAI/quantization/resolve/a77838dfd8411e9f7c08c1ea6856a2a8f4ff0f5f/ext-torch/torch_binding.cpp
- Command line
-
hf download hf://RedHatAI/quantization@a77838dfd8411e9f7c08c1ea6856a2a8f4ff0f5f/ext-torch/torch_binding.cpp
-
curl -L -o torch_binding.cpp https://huggingface.co/RedHatAI/quantization/resolve/a77838dfd8411e9f7c08c1ea6856a2a8f4ff0f5f/ext-torch/torch_binding.cpp
4.58 kB
| TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, ops) { | |
| // CUTLASS w8a8 GEMM, supporting symmetric per-tensor or per-row/column | |
| // quantization, as well as bias | |
| ops.def( | |
| "cutlass_scaled_mm(Tensor! out, Tensor a," | |
| " Tensor b, Tensor a_scales," | |
| " Tensor b_scales, Tensor? bias) -> ()"); | |
| ops.impl("cutlass_scaled_mm", torch::kCUDA, &cutlass_scaled_mm); | |
| // CUTLASS w8a8 GEMM, supporting asymmetric per-tensor or per-row/column | |
| // quantization. | |
| ops.def( | |
| "cutlass_scaled_mm_azp(Tensor! out, Tensor a," | |
| " Tensor b, Tensor a_scales," | |
| " Tensor b_scales, Tensor azp_adj," | |
| " Tensor? azp, Tensor? bias) -> ()"); | |
| ops.impl("cutlass_scaled_mm_azp", torch::kCUDA, &cutlass_scaled_mm_azp); | |
| // Check if cutlass scaled_mm is supported for CUDA devices of the given | |
| // capability | |
| ops.def("cutlass_scaled_mm_supports_fp8(int cuda_device_capability) -> bool"); | |
| ops.impl("cutlass_scaled_mm_supports_fp8", &cutlass_scaled_mm_supports_fp8); | |
| } | |
| REGISTER_EXTENSION(TORCH_EXTENSION_NAME) | |