Download torch-ext/torch_binding.cpp from phanerozoic/spec-decode-ops: direct link, hf CLI and curl.
- Browser
- Download file 940 Bytes
-
https://huggingface.co/kernels/phanerozoic/spec-decode-ops/resolve/v1/torch-ext/torch_binding.cpp
- Command line
-
hf download hf://phanerozoic/spec-decode-ops@v1/torch-ext/torch_binding.cpp
-
curl -L -o torch_binding.cpp https://huggingface.co/kernels/phanerozoic/spec-decode-ops/resolve/v1/torch-ext/torch_binding.cpp
940 Bytes
| TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, ops) { | |
| ops.def("fused_sample(Tensor! tokens, Tensor logits, Tensor? prev_tokens, float temperature, int top_k, float top_p, float min_p, float repetition_penalty, int seed, int offset) -> ()"); | |
| ops.def("fused_filter(Tensor! out_logits, Tensor logits, Tensor? prev_tokens, float temperature, int top_k, float top_p, float min_p, float repetition_penalty) -> ()"); | |
| ops.def("spec_verify(Tensor! accept_len, Tensor! out_tokens, Tensor target_logits, Tensor draft_logits, Tensor draft_tokens, float temperature, int seed, int offset) -> ()"); | |
| ops.impl("fused_sample", torch::kCUDA, &fused_sample); | |
| ops.impl("fused_filter", torch::kCUDA, &fused_filter); | |
| ops.impl("spec_verify", torch::kCUDA, &spec_verify); | |
| } | |
| REGISTER_EXTENSION(TORCH_EXTENSION_NAME) | |