Download claudson/kernel.py from joebruce1313/claudeson: direct link, hf CLI and curl.
- Browser
- Download file 536 Bytes
-
https://huggingface.co/joebruce1313/claudeson/resolve/main/claudson/kernel.py
- Command line
-
hf download hf://joebruce1313/claudeson/claudson/kernel.py
-
curl -L -o kernel.py https://huggingface.co/joebruce1313/claudeson/resolve/main/claudson/kernel.py
536 Bytes
| import torch | |
| def act_quant(x: torch.Tensor, block_size: int) -> tuple[torch.Tensor, torch.Tensor]: | |
| # Placeholder for activation quantization | |
| return x, torch.tensor(1.0) | |
| def weight_dequant(weight: torch.Tensor, scale: torch.Tensor) -> torch.Tensor: | |
| # Placeholder for weight dequantization | |
| return weight * scale | |
| def fp8_gemm(x: torch.Tensor, scale_x: torch.Tensor, weight: torch.Tensor, scale_w: torch.Tensor) -> torch.Tensor: | |
| # Placeholder for FP8 GEMM | |
| return torch.matmul(x, weight.t()) * (scale_x * scale_w) | |