Rebuild CUDA variants with the current builder (provenance, digest, no shim)
Browse files- .gitattributes +6 -0
- build/torch211-cxx11-cu126-x86_64-linux/_gguf_kernels_cuda_e4e2164.abi3.so +2 -2
- build/torch211-cxx11-cu128-x86_64-linux/_gguf_kernels_cuda_e4e2164.abi3.so +2 -2
- build/torch211-cxx11-cu130-x86_64-linux/_gguf_kernels_cuda_e4e2164.abi3.so +2 -2
- build/torch212-cxx11-cu126-x86_64-linux/__init__.py +10 -3
- build/torch212-cxx11-cu126-x86_64-linux/{_gguf_kernels_cuda_e4e2164.abi3.so → _gguf_kernels_cuda_1df3b99.abi3.so} +2 -2
- build/torch212-cxx11-cu126-x86_64-linux/_ops.py +3 -3
- build/torch212-cxx11-cu126-x86_64-linux/gguf_kernels/__init__.py +0 -26
- build/torch212-cxx11-cu126-x86_64-linux/metadata.json +21 -2
- build/torch212-cxx11-cu130-x86_64-linux/__init__.py +10 -3
- build/torch212-cxx11-cu130-x86_64-linux/__pycache__/__init__.cpython-311.pyc +0 -0
- build/torch212-cxx11-cu130-x86_64-linux/__pycache__/_ops.cpython-311.pyc +0 -0
- build/{torch212-cxx11-cu132-x86_64-linux/_gguf_kernels_cuda_e4e2164.abi3.so → torch212-cxx11-cu130-x86_64-linux/_gguf_kernels_cuda_1df3b99.abi3.so} +2 -2
- build/torch212-cxx11-cu130-x86_64-linux/_ops.py +3 -3
- build/torch212-cxx11-cu130-x86_64-linux/gguf_kernels/__init__.py +0 -26
- build/torch212-cxx11-cu130-x86_64-linux/metadata.json +21 -2
- build/torch212-cxx11-cu132-x86_64-linux/__init__.py +10 -3
- build/{torch212-cxx11-cu130-x86_64-linux/_gguf_kernels_cuda_e4e2164.abi3.so → torch212-cxx11-cu132-x86_64-linux/_gguf_kernels_cuda_1df3b99.abi3.so} +2 -2
- build/torch212-cxx11-cu132-x86_64-linux/_ops.py +3 -3
- build/torch212-cxx11-cu132-x86_64-linux/gguf_kernels/__init__.py +0 -26
- build/torch212-cxx11-cu132-x86_64-linux/metadata.json +21 -2
- build/torch212-metal-aarch64-darwin/_gguf_kernels_metal_0becb0a.abi3.so +2 -2
- build/torch213-cxx11-cu126-x86_64-linux/__init__.py +62 -0
- build/torch213-cxx11-cu126-x86_64-linux/_gguf_kernels_cuda_1df3b99.abi3.so +3 -0
- build/torch213-cxx11-cu126-x86_64-linux/_ops.py +9 -0
- build/torch213-cxx11-cu126-x86_64-linux/metadata.json +36 -0
- build/torch213-cxx11-cu130-x86_64-linux/__init__.py +62 -0
- build/torch213-cxx11-cu130-x86_64-linux/_gguf_kernels_cuda_1df3b99.abi3.so +3 -0
- build/torch213-cxx11-cu130-x86_64-linux/_ops.py +9 -0
- build/torch213-cxx11-cu130-x86_64-linux/metadata.json +38 -0
- build/torch213-cxx11-cu132-x86_64-linux/__init__.py +62 -0
- build/torch213-cxx11-cu132-x86_64-linux/_gguf_kernels_cuda_1df3b99.abi3.so +3 -0
- build/torch213-cxx11-cu132-x86_64-linux/_ops.py +9 -0
- build/torch213-cxx11-cu132-x86_64-linux/metadata.json +38 -0
- build/torch213-metal-aarch64-darwin/_gguf_kernels_metal_0becb0a.abi3.so +2 -2
.gitattributes
CHANGED
|
@@ -50,3 +50,9 @@ build/torch212-cxx11-cu130-x86_64-linux/_gguf_kernels_cuda_e4e2164.abi3.so filte
|
|
| 50 |
build/torch212-cxx11-cu132-x86_64-linux/_gguf_kernels_cuda_e4e2164.abi3.so filter=lfs diff=lfs merge=lfs -text
|
| 51 |
build/torch212-metal-aarch64-darwin/_gguf_kernels_metal_0becb0a.abi3.so filter=lfs diff=lfs merge=lfs -text
|
| 52 |
build/torch213-metal-aarch64-darwin/_gguf_kernels_metal_0becb0a.abi3.so filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
build/torch212-cxx11-cu132-x86_64-linux/_gguf_kernels_cuda_e4e2164.abi3.so filter=lfs diff=lfs merge=lfs -text
|
| 51 |
build/torch212-metal-aarch64-darwin/_gguf_kernels_metal_0becb0a.abi3.so filter=lfs diff=lfs merge=lfs -text
|
| 52 |
build/torch213-metal-aarch64-darwin/_gguf_kernels_metal_0becb0a.abi3.so filter=lfs diff=lfs merge=lfs -text
|
| 53 |
+
build/torch212-cxx11-cu126-x86_64-linux/_gguf_kernels_cuda_1df3b99.abi3.so filter=lfs diff=lfs merge=lfs -text
|
| 54 |
+
build/torch212-cxx11-cu130-x86_64-linux/_gguf_kernels_cuda_1df3b99.abi3.so filter=lfs diff=lfs merge=lfs -text
|
| 55 |
+
build/torch212-cxx11-cu132-x86_64-linux/_gguf_kernels_cuda_1df3b99.abi3.so filter=lfs diff=lfs merge=lfs -text
|
| 56 |
+
build/torch213-cxx11-cu126-x86_64-linux/_gguf_kernels_cuda_1df3b99.abi3.so filter=lfs diff=lfs merge=lfs -text
|
| 57 |
+
build/torch213-cxx11-cu130-x86_64-linux/_gguf_kernels_cuda_1df3b99.abi3.so filter=lfs diff=lfs merge=lfs -text
|
| 58 |
+
build/torch213-cxx11-cu132-x86_64-linux/_gguf_kernels_cuda_1df3b99.abi3.so filter=lfs diff=lfs merge=lfs -text
|
build/torch211-cxx11-cu126-x86_64-linux/_gguf_kernels_cuda_e4e2164.abi3.so
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b13c3193a71b1801478effbc94a8007b706c1ec6f140f9567349d97bcef68ace
|
| 3 |
+
size 133
|
build/torch211-cxx11-cu128-x86_64-linux/_gguf_kernels_cuda_e4e2164.abi3.so
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:039423d3e913e348225f13e3764e50c4cd8feb79617f045003a447e63bafe609
|
| 3 |
+
size 133
|
build/torch211-cxx11-cu130-x86_64-linux/_gguf_kernels_cuda_e4e2164.abi3.so
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e8af7132e7c0e5ee536b2537b538b880325d8b00ac1fa8e53aa3914f537d0149
|
| 3 |
+
size 133
|
build/torch212-cxx11-cu126-x86_64-linux/__init__.py
CHANGED
|
@@ -20,9 +20,16 @@ __all__ = ["GEMV_TYPES", "MAX_GEMV_ROWS", "dequantize", "mul_mat_vec"]
|
|
| 20 |
# caller with more (prefill) dequantizes and uses an ordinary matmul.
|
| 21 |
MAX_GEMV_ROWS = 8
|
| 22 |
|
| 23 |
-
# ggml type ids `mul_mat_vec` implements
|
| 24 |
-
#
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
|
| 28 |
def dequantize(
|
|
|
|
| 20 |
# caller with more (prefill) dequantizes and uses an ordinary matmul.
|
| 21 |
MAX_GEMV_ROWS = 8
|
| 22 |
|
| 23 |
+
# ggml type ids `mul_mat_vec` implements, as this build reports them -- it is backend-specific, and
|
| 24 |
+
# a type routed into a gemv that has no kernel for it is a fault, not a fallback. CUDA covers
|
| 25 |
+
# Q4_0/Q4_1/Q5_0/Q5_1/Q8_0, the K quants, the IQ quants, MXFP4/NVFP4 and Q1_0/Q2_0; Metal is the
|
| 26 |
+
# same minus NVFP4/Q1_0/Q2_0, which its metallib has no kernels for. `dequantize` covers more, so
|
| 27 |
+
# check this before choosing the fused path.
|
| 28 |
+
try:
|
| 29 |
+
GEMV_TYPES = frozenset(ops.gemv_types())
|
| 30 |
+
except AttributeError:
|
| 31 |
+
# A build published before `gemv_types` existed; those are CUDA-only, so its list is theirs.
|
| 32 |
+
GEMV_TYPES = frozenset({2, 3, 6, 7, 8, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 29, 39, 40, 41, 42})
|
| 33 |
|
| 34 |
|
| 35 |
def dequantize(
|
build/torch212-cxx11-cu126-x86_64-linux/{_gguf_kernels_cuda_e4e2164.abi3.so → _gguf_kernels_cuda_1df3b99.abi3.so}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a0dcdaf3e54554158476036dad0d2e6412aa42d4d1bfefa8d68e019e841283da
|
| 3 |
+
size 24822056
|
build/torch212-cxx11-cu126-x86_64-linux/_ops.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
import torch
|
| 2 |
-
from . import
|
| 3 |
-
ops = torch.ops.
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
-
return f"
|
|
|
|
| 1 |
import torch
|
| 2 |
+
from . import _gguf_kernels_cuda_1df3b99
|
| 3 |
+
ops = torch.ops._gguf_kernels_cuda_1df3b99
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
+
return f"_gguf_kernels_cuda_1df3b99::{op_name}"
|
build/torch212-cxx11-cu126-x86_64-linux/gguf_kernels/__init__.py
DELETED
|
@@ -1,26 +0,0 @@
|
|
| 1 |
-
import ctypes
|
| 2 |
-
import importlib.util
|
| 3 |
-
import sys
|
| 4 |
-
from pathlib import Path
|
| 5 |
-
from types import ModuleType
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
def _import_from_path(file_path: Path) -> ModuleType:
|
| 9 |
-
# We cannot use the module name as-is, after adding it to `sys.modules`,
|
| 10 |
-
# it would also be used for other imports. So, we make a module name that
|
| 11 |
-
# depends on the path for it to be unique using the hex-encoded hash of
|
| 12 |
-
# the path.
|
| 13 |
-
path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value)
|
| 14 |
-
module_name = path_hash
|
| 15 |
-
spec = importlib.util.spec_from_file_location(module_name, file_path)
|
| 16 |
-
if spec is None:
|
| 17 |
-
raise ImportError(f"Cannot load spec for {module_name} from {file_path}")
|
| 18 |
-
module = importlib.util.module_from_spec(spec)
|
| 19 |
-
if module is None:
|
| 20 |
-
raise ImportError(f"Cannot load module {module_name} from spec")
|
| 21 |
-
sys.modules[module_name] = module
|
| 22 |
-
spec.loader.exec_module(module) # type: ignore
|
| 23 |
-
return module
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py")))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch212-cxx11-cu126-x86_64-linux/metadata.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "gguf-kernels",
|
| 3 |
-
"id": "
|
| 4 |
"version": 1,
|
| 5 |
"license": "MIT",
|
| 6 |
"python-depends": [],
|
|
@@ -13,5 +13,24 @@
|
|
| 13 |
"8.9",
|
| 14 |
"9.0"
|
| 15 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
}
|
| 17 |
-
}
|
|
|
|
| 1 |
{
|
| 2 |
"name": "gguf-kernels",
|
| 3 |
+
"id": "_gguf_kernels_cuda_1df3b99",
|
| 4 |
"version": 1,
|
| 5 |
"license": "MIT",
|
| 6 |
"python-depends": [],
|
|
|
|
| 13 |
"8.9",
|
| 14 |
"9.0"
|
| 15 |
]
|
| 16 |
+
},
|
| 17 |
+
"digest": {
|
| 18 |
+
"algorithm": "sha256",
|
| 19 |
+
"files": {
|
| 20 |
+
"__init__.py": "GoFcHJbbJ9C8b40XNznMxsTcC+CV9kaFE8a1DP763kU=",
|
| 21 |
+
"_gguf_kernels_cuda_1df3b99.abi3.so": "oNza8+VFVBWEdgNtrQ0uZBKqQtTRv++o1o4BnoQSg9o=",
|
| 22 |
+
"_ops.py": "dRIZkil9x8IS6KhIwXlRzO6qzQoGYUQkGL87Z3gpEzY="
|
| 23 |
+
}
|
| 24 |
+
},
|
| 25 |
+
"provenance": {
|
| 26 |
+
"kernel-builder": {
|
| 27 |
+
"version": "0.17.0-dev0",
|
| 28 |
+
"sha": "81f55ea30fd8f819dcf93a3c934dd584c895bd2f",
|
| 29 |
+
"dirty": false
|
| 30 |
+
},
|
| 31 |
+
"kernel": {
|
| 32 |
+
"sha": "1df3b999686b77ef298ae13d066a39958503164c",
|
| 33 |
+
"dirty": false
|
| 34 |
+
}
|
| 35 |
}
|
| 36 |
+
}
|
build/torch212-cxx11-cu130-x86_64-linux/__init__.py
CHANGED
|
@@ -20,9 +20,16 @@ __all__ = ["GEMV_TYPES", "MAX_GEMV_ROWS", "dequantize", "mul_mat_vec"]
|
|
| 20 |
# caller with more (prefill) dequantizes and uses an ordinary matmul.
|
| 21 |
MAX_GEMV_ROWS = 8
|
| 22 |
|
| 23 |
-
# ggml type ids `mul_mat_vec` implements
|
| 24 |
-
#
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
|
| 28 |
def dequantize(
|
|
|
|
| 20 |
# caller with more (prefill) dequantizes and uses an ordinary matmul.
|
| 21 |
MAX_GEMV_ROWS = 8
|
| 22 |
|
| 23 |
+
# ggml type ids `mul_mat_vec` implements, as this build reports them -- it is backend-specific, and
|
| 24 |
+
# a type routed into a gemv that has no kernel for it is a fault, not a fallback. CUDA covers
|
| 25 |
+
# Q4_0/Q4_1/Q5_0/Q5_1/Q8_0, the K quants, the IQ quants, MXFP4/NVFP4 and Q1_0/Q2_0; Metal is the
|
| 26 |
+
# same minus NVFP4/Q1_0/Q2_0, which its metallib has no kernels for. `dequantize` covers more, so
|
| 27 |
+
# check this before choosing the fused path.
|
| 28 |
+
try:
|
| 29 |
+
GEMV_TYPES = frozenset(ops.gemv_types())
|
| 30 |
+
except AttributeError:
|
| 31 |
+
# A build published before `gemv_types` existed; those are CUDA-only, so its list is theirs.
|
| 32 |
+
GEMV_TYPES = frozenset({2, 3, 6, 7, 8, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 29, 39, 40, 41, 42})
|
| 33 |
|
| 34 |
|
| 35 |
def dequantize(
|
build/torch212-cxx11-cu130-x86_64-linux/__pycache__/__init__.cpython-311.pyc
ADDED
|
Binary file (3.26 kB). View file
|
|
|
build/torch212-cxx11-cu130-x86_64-linux/__pycache__/_ops.cpython-311.pyc
ADDED
|
Binary file (574 Bytes). View file
|
|
|
build/{torch212-cxx11-cu132-x86_64-linux/_gguf_kernels_cuda_e4e2164.abi3.so → torch212-cxx11-cu130-x86_64-linux/_gguf_kernels_cuda_1df3b99.abi3.so}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7355d69df74e88b5163248a7ada198f95c5310b2b182268e951ee7da67f4a537
|
| 3 |
+
size 37396976
|
build/torch212-cxx11-cu130-x86_64-linux/_ops.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
import torch
|
| 2 |
-
from . import
|
| 3 |
-
ops = torch.ops.
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
-
return f"
|
|
|
|
| 1 |
import torch
|
| 2 |
+
from . import _gguf_kernels_cuda_1df3b99
|
| 3 |
+
ops = torch.ops._gguf_kernels_cuda_1df3b99
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
+
return f"_gguf_kernels_cuda_1df3b99::{op_name}"
|
build/torch212-cxx11-cu130-x86_64-linux/gguf_kernels/__init__.py
DELETED
|
@@ -1,26 +0,0 @@
|
|
| 1 |
-
import ctypes
|
| 2 |
-
import importlib.util
|
| 3 |
-
import sys
|
| 4 |
-
from pathlib import Path
|
| 5 |
-
from types import ModuleType
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
def _import_from_path(file_path: Path) -> ModuleType:
|
| 9 |
-
# We cannot use the module name as-is, after adding it to `sys.modules`,
|
| 10 |
-
# it would also be used for other imports. So, we make a module name that
|
| 11 |
-
# depends on the path for it to be unique using the hex-encoded hash of
|
| 12 |
-
# the path.
|
| 13 |
-
path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value)
|
| 14 |
-
module_name = path_hash
|
| 15 |
-
spec = importlib.util.spec_from_file_location(module_name, file_path)
|
| 16 |
-
if spec is None:
|
| 17 |
-
raise ImportError(f"Cannot load spec for {module_name} from {file_path}")
|
| 18 |
-
module = importlib.util.module_from_spec(spec)
|
| 19 |
-
if module is None:
|
| 20 |
-
raise ImportError(f"Cannot load module {module_name} from spec")
|
| 21 |
-
sys.modules[module_name] = module
|
| 22 |
-
spec.loader.exec_module(module) # type: ignore
|
| 23 |
-
return module
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py")))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch212-cxx11-cu130-x86_64-linux/metadata.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "gguf-kernels",
|
| 3 |
-
"id": "
|
| 4 |
"version": 1,
|
| 5 |
"license": "MIT",
|
| 6 |
"python-depends": [],
|
|
@@ -15,5 +15,24 @@
|
|
| 15 |
"8.9",
|
| 16 |
"9.0"
|
| 17 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
}
|
| 19 |
-
}
|
|
|
|
| 1 |
{
|
| 2 |
"name": "gguf-kernels",
|
| 3 |
+
"id": "_gguf_kernels_cuda_1df3b99",
|
| 4 |
"version": 1,
|
| 5 |
"license": "MIT",
|
| 6 |
"python-depends": [],
|
|
|
|
| 15 |
"8.9",
|
| 16 |
"9.0"
|
| 17 |
]
|
| 18 |
+
},
|
| 19 |
+
"digest": {
|
| 20 |
+
"algorithm": "sha256",
|
| 21 |
+
"files": {
|
| 22 |
+
"__init__.py": "GoFcHJbbJ9C8b40XNznMxsTcC+CV9kaFE8a1DP763kU=",
|
| 23 |
+
"_gguf_kernels_cuda_1df3b99.abi3.so": "c1XWnfdOiLUWMkinraGY+VxTELKxgiaOlR7n2mf0pTc=",
|
| 24 |
+
"_ops.py": "dRIZkil9x8IS6KhIwXlRzO6qzQoGYUQkGL87Z3gpEzY="
|
| 25 |
+
}
|
| 26 |
+
},
|
| 27 |
+
"provenance": {
|
| 28 |
+
"kernel-builder": {
|
| 29 |
+
"version": "0.17.0-dev0",
|
| 30 |
+
"sha": "81f55ea30fd8f819dcf93a3c934dd584c895bd2f",
|
| 31 |
+
"dirty": false
|
| 32 |
+
},
|
| 33 |
+
"kernel": {
|
| 34 |
+
"sha": "1df3b999686b77ef298ae13d066a39958503164c",
|
| 35 |
+
"dirty": false
|
| 36 |
+
}
|
| 37 |
}
|
| 38 |
+
}
|
build/torch212-cxx11-cu132-x86_64-linux/__init__.py
CHANGED
|
@@ -20,9 +20,16 @@ __all__ = ["GEMV_TYPES", "MAX_GEMV_ROWS", "dequantize", "mul_mat_vec"]
|
|
| 20 |
# caller with more (prefill) dequantizes and uses an ordinary matmul.
|
| 21 |
MAX_GEMV_ROWS = 8
|
| 22 |
|
| 23 |
-
# ggml type ids `mul_mat_vec` implements
|
| 24 |
-
#
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
|
| 28 |
def dequantize(
|
|
|
|
| 20 |
# caller with more (prefill) dequantizes and uses an ordinary matmul.
|
| 21 |
MAX_GEMV_ROWS = 8
|
| 22 |
|
| 23 |
+
# ggml type ids `mul_mat_vec` implements, as this build reports them -- it is backend-specific, and
|
| 24 |
+
# a type routed into a gemv that has no kernel for it is a fault, not a fallback. CUDA covers
|
| 25 |
+
# Q4_0/Q4_1/Q5_0/Q5_1/Q8_0, the K quants, the IQ quants, MXFP4/NVFP4 and Q1_0/Q2_0; Metal is the
|
| 26 |
+
# same minus NVFP4/Q1_0/Q2_0, which its metallib has no kernels for. `dequantize` covers more, so
|
| 27 |
+
# check this before choosing the fused path.
|
| 28 |
+
try:
|
| 29 |
+
GEMV_TYPES = frozenset(ops.gemv_types())
|
| 30 |
+
except AttributeError:
|
| 31 |
+
# A build published before `gemv_types` existed; those are CUDA-only, so its list is theirs.
|
| 32 |
+
GEMV_TYPES = frozenset({2, 3, 6, 7, 8, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 29, 39, 40, 41, 42})
|
| 33 |
|
| 34 |
|
| 35 |
def dequantize(
|
build/{torch212-cxx11-cu130-x86_64-linux/_gguf_kernels_cuda_e4e2164.abi3.so → torch212-cxx11-cu132-x86_64-linux/_gguf_kernels_cuda_1df3b99.abi3.so}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:50a408d91abc14355e1b1666ac6aa591f61271f8333dc863f1e9395822f0b1a1
|
| 3 |
+
size 37415488
|
build/torch212-cxx11-cu132-x86_64-linux/_ops.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
import torch
|
| 2 |
-
from . import
|
| 3 |
-
ops = torch.ops.
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
-
return f"
|
|
|
|
| 1 |
import torch
|
| 2 |
+
from . import _gguf_kernels_cuda_1df3b99
|
| 3 |
+
ops = torch.ops._gguf_kernels_cuda_1df3b99
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
+
return f"_gguf_kernels_cuda_1df3b99::{op_name}"
|
build/torch212-cxx11-cu132-x86_64-linux/gguf_kernels/__init__.py
DELETED
|
@@ -1,26 +0,0 @@
|
|
| 1 |
-
import ctypes
|
| 2 |
-
import importlib.util
|
| 3 |
-
import sys
|
| 4 |
-
from pathlib import Path
|
| 5 |
-
from types import ModuleType
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
def _import_from_path(file_path: Path) -> ModuleType:
|
| 9 |
-
# We cannot use the module name as-is, after adding it to `sys.modules`,
|
| 10 |
-
# it would also be used for other imports. So, we make a module name that
|
| 11 |
-
# depends on the path for it to be unique using the hex-encoded hash of
|
| 12 |
-
# the path.
|
| 13 |
-
path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value)
|
| 14 |
-
module_name = path_hash
|
| 15 |
-
spec = importlib.util.spec_from_file_location(module_name, file_path)
|
| 16 |
-
if spec is None:
|
| 17 |
-
raise ImportError(f"Cannot load spec for {module_name} from {file_path}")
|
| 18 |
-
module = importlib.util.module_from_spec(spec)
|
| 19 |
-
if module is None:
|
| 20 |
-
raise ImportError(f"Cannot load module {module_name} from spec")
|
| 21 |
-
sys.modules[module_name] = module
|
| 22 |
-
spec.loader.exec_module(module) # type: ignore
|
| 23 |
-
return module
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py")))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch212-cxx11-cu132-x86_64-linux/metadata.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "gguf-kernels",
|
| 3 |
-
"id": "
|
| 4 |
"version": 1,
|
| 5 |
"license": "MIT",
|
| 6 |
"python-depends": [],
|
|
@@ -15,5 +15,24 @@
|
|
| 15 |
"8.9",
|
| 16 |
"9.0"
|
| 17 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
}
|
| 19 |
-
}
|
|
|
|
| 1 |
{
|
| 2 |
"name": "gguf-kernels",
|
| 3 |
+
"id": "_gguf_kernels_cuda_1df3b99",
|
| 4 |
"version": 1,
|
| 5 |
"license": "MIT",
|
| 6 |
"python-depends": [],
|
|
|
|
| 15 |
"8.9",
|
| 16 |
"9.0"
|
| 17 |
]
|
| 18 |
+
},
|
| 19 |
+
"digest": {
|
| 20 |
+
"algorithm": "sha256",
|
| 21 |
+
"files": {
|
| 22 |
+
"__init__.py": "GoFcHJbbJ9C8b40XNznMxsTcC+CV9kaFE8a1DP763kU=",
|
| 23 |
+
"_gguf_kernels_cuda_1df3b99.abi3.so": "UKQI2Rq8FDVeGxZmrGqlkfYScfgzPchj8ek5WCLwsaE=",
|
| 24 |
+
"_ops.py": "dRIZkil9x8IS6KhIwXlRzO6qzQoGYUQkGL87Z3gpEzY="
|
| 25 |
+
}
|
| 26 |
+
},
|
| 27 |
+
"provenance": {
|
| 28 |
+
"kernel-builder": {
|
| 29 |
+
"version": "0.17.0-dev0",
|
| 30 |
+
"sha": "81f55ea30fd8f819dcf93a3c934dd584c895bd2f",
|
| 31 |
+
"dirty": false
|
| 32 |
+
},
|
| 33 |
+
"kernel": {
|
| 34 |
+
"sha": "1df3b999686b77ef298ae13d066a39958503164c",
|
| 35 |
+
"dirty": false
|
| 36 |
+
}
|
| 37 |
}
|
| 38 |
+
}
|
build/torch212-metal-aarch64-darwin/_gguf_kernels_metal_0becb0a.abi3.so
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b15d061c06a3be61c1b7039d153b6a791d8bb2f7bc972a44fa33e575642ecbd0
|
| 3 |
+
size 132
|
build/torch213-cxx11-cu126-x86_64-linux/__init__.py
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Compute directly on the packed blocks of a GGUF checkpoint.
|
| 2 |
+
|
| 3 |
+
A GGUF weight is stored as blocks of 32 or 256 values sharing a scale. These kernels read that
|
| 4 |
+
layout as it is, so a quantized model can be loaded and run without ever materializing a dense
|
| 5 |
+
copy — which is the whole memory saving.
|
| 6 |
+
|
| 7 |
+
Ported from llama.cpp's ggml-cuda; `vendor/UPSTREAM` pins the revision. The ops are named for what
|
| 8 |
+
they do rather than for a backend: each backend registers its own implementation of the same
|
| 9 |
+
schema, so calls dispatch on the tensor's device.
|
| 10 |
+
"""
|
| 11 |
+
|
| 12 |
+
import torch
|
| 13 |
+
|
| 14 |
+
from ._ops import add_op_namespace_prefix, ops
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
__all__ = ["GEMV_TYPES", "MAX_GEMV_ROWS", "dequantize", "mul_mat_vec"]
|
| 18 |
+
|
| 19 |
+
# Upstream's MMVQ_MAX_BATCH_SIZE: `mul_mat_vec` has no implementation beyond this many rows, so a
|
| 20 |
+
# caller with more (prefill) dequantizes and uses an ordinary matmul.
|
| 21 |
+
MAX_GEMV_ROWS = 8
|
| 22 |
+
|
| 23 |
+
# ggml type ids `mul_mat_vec` implements, as this build reports them -- it is backend-specific, and
|
| 24 |
+
# a type routed into a gemv that has no kernel for it is a fault, not a fallback. CUDA covers
|
| 25 |
+
# Q4_0/Q4_1/Q5_0/Q5_1/Q8_0, the K quants, the IQ quants, MXFP4/NVFP4 and Q1_0/Q2_0; Metal is the
|
| 26 |
+
# same minus NVFP4/Q1_0/Q2_0, which its metallib has no kernels for. `dequantize` covers more, so
|
| 27 |
+
# check this before choosing the fused path.
|
| 28 |
+
try:
|
| 29 |
+
GEMV_TYPES = frozenset(ops.gemv_types())
|
| 30 |
+
except AttributeError:
|
| 31 |
+
# A build published before `gemv_types` existed; those are CUDA-only, so its list is theirs.
|
| 32 |
+
GEMV_TYPES = frozenset({2, 3, 6, 7, 8, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 29, 39, 40, 41, 42})
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def dequantize(
|
| 36 |
+
blocks: torch.Tensor, ggml_type: int, rows: int, cols: int, dtype: torch.dtype
|
| 37 |
+
) -> torch.Tensor:
|
| 38 |
+
"""`(rows, bytes_per_row)` uint8 blocks -> `(rows, cols)` values of `dtype`."""
|
| 39 |
+
return ops.dequantize(blocks, ggml_type, rows, cols, dtype)
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
def mul_mat_vec(
|
| 43 |
+
blocks: torch.Tensor, x: torch.Tensor, ggml_type: int, out_features: int
|
| 44 |
+
) -> torch.Tensor:
|
| 45 |
+
"""Fused dequantize-gemv: `x @ blocks.T` without unpacking `blocks`.
|
| 46 |
+
|
| 47 |
+
`x` is `(rows, in_features)` and `rows` must be at most `MAX_GEMV_ROWS`. The result is f32
|
| 48 |
+
whatever `x`'s dtype was, since the kernel writes an f32 destination; cast it at the call site,
|
| 49 |
+
where the cast can be fused into whatever consumes it.
|
| 50 |
+
"""
|
| 51 |
+
return ops.mul_mat_vec(blocks, x, ggml_type, out_features)
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
# Without these, torch.compile cannot trace the ops and breaks the graph at every call.
|
| 55 |
+
@torch.library.register_fake(add_op_namespace_prefix("dequantize"))
|
| 56 |
+
def _dequantize_fake(blocks, ggml_type, rows, cols, dtype):
|
| 57 |
+
return blocks.new_empty((rows, cols), dtype=dtype)
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
@torch.library.register_fake(add_op_namespace_prefix("mul_mat_vec"))
|
| 61 |
+
def _mul_mat_vec_fake(blocks, x, ggml_type, out_features):
|
| 62 |
+
return x.new_empty((x.shape[0], out_features), dtype=torch.float32)
|
build/torch213-cxx11-cu126-x86_64-linux/_gguf_kernels_cuda_1df3b99.abi3.so
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9a7b5651497660db8a6b4cbe857610fc5ac448d52c36ad44b16c6e199d0d09e6
|
| 3 |
+
size 24821896
|
build/torch213-cxx11-cu126-x86_64-linux/_ops.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
from . import _gguf_kernels_cuda_1df3b99
|
| 3 |
+
ops = torch.ops._gguf_kernels_cuda_1df3b99
|
| 4 |
+
|
| 5 |
+
def add_op_namespace_prefix(op_name: str):
|
| 6 |
+
"""
|
| 7 |
+
Prefix op by namespace.
|
| 8 |
+
"""
|
| 9 |
+
return f"_gguf_kernels_cuda_1df3b99::{op_name}"
|
build/torch213-cxx11-cu126-x86_64-linux/metadata.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "gguf-kernels",
|
| 3 |
+
"id": "_gguf_kernels_cuda_1df3b99",
|
| 4 |
+
"version": 1,
|
| 5 |
+
"license": "MIT",
|
| 6 |
+
"python-depends": [],
|
| 7 |
+
"backend": {
|
| 8 |
+
"type": "cuda",
|
| 9 |
+
"archs": [
|
| 10 |
+
"7.5",
|
| 11 |
+
"8.0",
|
| 12 |
+
"8.6",
|
| 13 |
+
"8.9",
|
| 14 |
+
"9.0"
|
| 15 |
+
]
|
| 16 |
+
},
|
| 17 |
+
"digest": {
|
| 18 |
+
"algorithm": "sha256",
|
| 19 |
+
"files": {
|
| 20 |
+
"__init__.py": "GoFcHJbbJ9C8b40XNznMxsTcC+CV9kaFE8a1DP763kU=",
|
| 21 |
+
"_gguf_kernels_cuda_1df3b99.abi3.so": "mntWUUl2YNuKa0y+hXYQ/FrESNUsNq1EsWxuGZ0NCeY=",
|
| 22 |
+
"_ops.py": "dRIZkil9x8IS6KhIwXlRzO6qzQoGYUQkGL87Z3gpEzY="
|
| 23 |
+
}
|
| 24 |
+
},
|
| 25 |
+
"provenance": {
|
| 26 |
+
"kernel-builder": {
|
| 27 |
+
"version": "0.17.0-dev0",
|
| 28 |
+
"sha": "81f55ea30fd8f819dcf93a3c934dd584c895bd2f",
|
| 29 |
+
"dirty": false
|
| 30 |
+
},
|
| 31 |
+
"kernel": {
|
| 32 |
+
"sha": "1df3b999686b77ef298ae13d066a39958503164c",
|
| 33 |
+
"dirty": false
|
| 34 |
+
}
|
| 35 |
+
}
|
| 36 |
+
}
|
build/torch213-cxx11-cu130-x86_64-linux/__init__.py
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Compute directly on the packed blocks of a GGUF checkpoint.
|
| 2 |
+
|
| 3 |
+
A GGUF weight is stored as blocks of 32 or 256 values sharing a scale. These kernels read that
|
| 4 |
+
layout as it is, so a quantized model can be loaded and run without ever materializing a dense
|
| 5 |
+
copy — which is the whole memory saving.
|
| 6 |
+
|
| 7 |
+
Ported from llama.cpp's ggml-cuda; `vendor/UPSTREAM` pins the revision. The ops are named for what
|
| 8 |
+
they do rather than for a backend: each backend registers its own implementation of the same
|
| 9 |
+
schema, so calls dispatch on the tensor's device.
|
| 10 |
+
"""
|
| 11 |
+
|
| 12 |
+
import torch
|
| 13 |
+
|
| 14 |
+
from ._ops import add_op_namespace_prefix, ops
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
__all__ = ["GEMV_TYPES", "MAX_GEMV_ROWS", "dequantize", "mul_mat_vec"]
|
| 18 |
+
|
| 19 |
+
# Upstream's MMVQ_MAX_BATCH_SIZE: `mul_mat_vec` has no implementation beyond this many rows, so a
|
| 20 |
+
# caller with more (prefill) dequantizes and uses an ordinary matmul.
|
| 21 |
+
MAX_GEMV_ROWS = 8
|
| 22 |
+
|
| 23 |
+
# ggml type ids `mul_mat_vec` implements, as this build reports them -- it is backend-specific, and
|
| 24 |
+
# a type routed into a gemv that has no kernel for it is a fault, not a fallback. CUDA covers
|
| 25 |
+
# Q4_0/Q4_1/Q5_0/Q5_1/Q8_0, the K quants, the IQ quants, MXFP4/NVFP4 and Q1_0/Q2_0; Metal is the
|
| 26 |
+
# same minus NVFP4/Q1_0/Q2_0, which its metallib has no kernels for. `dequantize` covers more, so
|
| 27 |
+
# check this before choosing the fused path.
|
| 28 |
+
try:
|
| 29 |
+
GEMV_TYPES = frozenset(ops.gemv_types())
|
| 30 |
+
except AttributeError:
|
| 31 |
+
# A build published before `gemv_types` existed; those are CUDA-only, so its list is theirs.
|
| 32 |
+
GEMV_TYPES = frozenset({2, 3, 6, 7, 8, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 29, 39, 40, 41, 42})
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def dequantize(
|
| 36 |
+
blocks: torch.Tensor, ggml_type: int, rows: int, cols: int, dtype: torch.dtype
|
| 37 |
+
) -> torch.Tensor:
|
| 38 |
+
"""`(rows, bytes_per_row)` uint8 blocks -> `(rows, cols)` values of `dtype`."""
|
| 39 |
+
return ops.dequantize(blocks, ggml_type, rows, cols, dtype)
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
def mul_mat_vec(
|
| 43 |
+
blocks: torch.Tensor, x: torch.Tensor, ggml_type: int, out_features: int
|
| 44 |
+
) -> torch.Tensor:
|
| 45 |
+
"""Fused dequantize-gemv: `x @ blocks.T` without unpacking `blocks`.
|
| 46 |
+
|
| 47 |
+
`x` is `(rows, in_features)` and `rows` must be at most `MAX_GEMV_ROWS`. The result is f32
|
| 48 |
+
whatever `x`'s dtype was, since the kernel writes an f32 destination; cast it at the call site,
|
| 49 |
+
where the cast can be fused into whatever consumes it.
|
| 50 |
+
"""
|
| 51 |
+
return ops.mul_mat_vec(blocks, x, ggml_type, out_features)
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
# Without these, torch.compile cannot trace the ops and breaks the graph at every call.
|
| 55 |
+
@torch.library.register_fake(add_op_namespace_prefix("dequantize"))
|
| 56 |
+
def _dequantize_fake(blocks, ggml_type, rows, cols, dtype):
|
| 57 |
+
return blocks.new_empty((rows, cols), dtype=dtype)
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
@torch.library.register_fake(add_op_namespace_prefix("mul_mat_vec"))
|
| 61 |
+
def _mul_mat_vec_fake(blocks, x, ggml_type, out_features):
|
| 62 |
+
return x.new_empty((x.shape[0], out_features), dtype=torch.float32)
|
build/torch213-cxx11-cu130-x86_64-linux/_gguf_kernels_cuda_1df3b99.abi3.so
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:aa7b02e5b0e1976c3d244e697710bf692943a598e9a56fee5c475cbd0d63015c
|
| 3 |
+
size 37396824
|
build/torch213-cxx11-cu130-x86_64-linux/_ops.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
from . import _gguf_kernels_cuda_1df3b99
|
| 3 |
+
ops = torch.ops._gguf_kernels_cuda_1df3b99
|
| 4 |
+
|
| 5 |
+
def add_op_namespace_prefix(op_name: str):
|
| 6 |
+
"""
|
| 7 |
+
Prefix op by namespace.
|
| 8 |
+
"""
|
| 9 |
+
return f"_gguf_kernels_cuda_1df3b99::{op_name}"
|
build/torch213-cxx11-cu130-x86_64-linux/metadata.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "gguf-kernels",
|
| 3 |
+
"id": "_gguf_kernels_cuda_1df3b99",
|
| 4 |
+
"version": 1,
|
| 5 |
+
"license": "MIT",
|
| 6 |
+
"python-depends": [],
|
| 7 |
+
"backend": {
|
| 8 |
+
"type": "cuda",
|
| 9 |
+
"archs": [
|
| 10 |
+
"10.0",
|
| 11 |
+
"12.0",
|
| 12 |
+
"7.5",
|
| 13 |
+
"8.0",
|
| 14 |
+
"8.6",
|
| 15 |
+
"8.9",
|
| 16 |
+
"9.0"
|
| 17 |
+
]
|
| 18 |
+
},
|
| 19 |
+
"digest": {
|
| 20 |
+
"algorithm": "sha256",
|
| 21 |
+
"files": {
|
| 22 |
+
"__init__.py": "GoFcHJbbJ9C8b40XNznMxsTcC+CV9kaFE8a1DP763kU=",
|
| 23 |
+
"_gguf_kernels_cuda_1df3b99.abi3.so": "qnsC5bDhl2w9JE5pdxC/aSlDpZjppW/uXEdcvQ1jAVw=",
|
| 24 |
+
"_ops.py": "dRIZkil9x8IS6KhIwXlRzO6qzQoGYUQkGL87Z3gpEzY="
|
| 25 |
+
}
|
| 26 |
+
},
|
| 27 |
+
"provenance": {
|
| 28 |
+
"kernel-builder": {
|
| 29 |
+
"version": "0.17.0-dev0",
|
| 30 |
+
"sha": "81f55ea30fd8f819dcf93a3c934dd584c895bd2f",
|
| 31 |
+
"dirty": false
|
| 32 |
+
},
|
| 33 |
+
"kernel": {
|
| 34 |
+
"sha": "1df3b999686b77ef298ae13d066a39958503164c",
|
| 35 |
+
"dirty": false
|
| 36 |
+
}
|
| 37 |
+
}
|
| 38 |
+
}
|
build/torch213-cxx11-cu132-x86_64-linux/__init__.py
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Compute directly on the packed blocks of a GGUF checkpoint.
|
| 2 |
+
|
| 3 |
+
A GGUF weight is stored as blocks of 32 or 256 values sharing a scale. These kernels read that
|
| 4 |
+
layout as it is, so a quantized model can be loaded and run without ever materializing a dense
|
| 5 |
+
copy — which is the whole memory saving.
|
| 6 |
+
|
| 7 |
+
Ported from llama.cpp's ggml-cuda; `vendor/UPSTREAM` pins the revision. The ops are named for what
|
| 8 |
+
they do rather than for a backend: each backend registers its own implementation of the same
|
| 9 |
+
schema, so calls dispatch on the tensor's device.
|
| 10 |
+
"""
|
| 11 |
+
|
| 12 |
+
import torch
|
| 13 |
+
|
| 14 |
+
from ._ops import add_op_namespace_prefix, ops
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
__all__ = ["GEMV_TYPES", "MAX_GEMV_ROWS", "dequantize", "mul_mat_vec"]
|
| 18 |
+
|
| 19 |
+
# Upstream's MMVQ_MAX_BATCH_SIZE: `mul_mat_vec` has no implementation beyond this many rows, so a
|
| 20 |
+
# caller with more (prefill) dequantizes and uses an ordinary matmul.
|
| 21 |
+
MAX_GEMV_ROWS = 8
|
| 22 |
+
|
| 23 |
+
# ggml type ids `mul_mat_vec` implements, as this build reports them -- it is backend-specific, and
|
| 24 |
+
# a type routed into a gemv that has no kernel for it is a fault, not a fallback. CUDA covers
|
| 25 |
+
# Q4_0/Q4_1/Q5_0/Q5_1/Q8_0, the K quants, the IQ quants, MXFP4/NVFP4 and Q1_0/Q2_0; Metal is the
|
| 26 |
+
# same minus NVFP4/Q1_0/Q2_0, which its metallib has no kernels for. `dequantize` covers more, so
|
| 27 |
+
# check this before choosing the fused path.
|
| 28 |
+
try:
|
| 29 |
+
GEMV_TYPES = frozenset(ops.gemv_types())
|
| 30 |
+
except AttributeError:
|
| 31 |
+
# A build published before `gemv_types` existed; those are CUDA-only, so its list is theirs.
|
| 32 |
+
GEMV_TYPES = frozenset({2, 3, 6, 7, 8, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 29, 39, 40, 41, 42})
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def dequantize(
|
| 36 |
+
blocks: torch.Tensor, ggml_type: int, rows: int, cols: int, dtype: torch.dtype
|
| 37 |
+
) -> torch.Tensor:
|
| 38 |
+
"""`(rows, bytes_per_row)` uint8 blocks -> `(rows, cols)` values of `dtype`."""
|
| 39 |
+
return ops.dequantize(blocks, ggml_type, rows, cols, dtype)
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
def mul_mat_vec(
|
| 43 |
+
blocks: torch.Tensor, x: torch.Tensor, ggml_type: int, out_features: int
|
| 44 |
+
) -> torch.Tensor:
|
| 45 |
+
"""Fused dequantize-gemv: `x @ blocks.T` without unpacking `blocks`.
|
| 46 |
+
|
| 47 |
+
`x` is `(rows, in_features)` and `rows` must be at most `MAX_GEMV_ROWS`. The result is f32
|
| 48 |
+
whatever `x`'s dtype was, since the kernel writes an f32 destination; cast it at the call site,
|
| 49 |
+
where the cast can be fused into whatever consumes it.
|
| 50 |
+
"""
|
| 51 |
+
return ops.mul_mat_vec(blocks, x, ggml_type, out_features)
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
# Without these, torch.compile cannot trace the ops and breaks the graph at every call.
|
| 55 |
+
@torch.library.register_fake(add_op_namespace_prefix("dequantize"))
|
| 56 |
+
def _dequantize_fake(blocks, ggml_type, rows, cols, dtype):
|
| 57 |
+
return blocks.new_empty((rows, cols), dtype=dtype)
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
@torch.library.register_fake(add_op_namespace_prefix("mul_mat_vec"))
|
| 61 |
+
def _mul_mat_vec_fake(blocks, x, ggml_type, out_features):
|
| 62 |
+
return x.new_empty((x.shape[0], out_features), dtype=torch.float32)
|
build/torch213-cxx11-cu132-x86_64-linux/_gguf_kernels_cuda_1df3b99.abi3.so
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:732504ad19d3eb0692fca0a1085cd27eeb838c068c6f27b657d9b8224504f629
|
| 3 |
+
size 37415328
|
build/torch213-cxx11-cu132-x86_64-linux/_ops.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
from . import _gguf_kernels_cuda_1df3b99
|
| 3 |
+
ops = torch.ops._gguf_kernels_cuda_1df3b99
|
| 4 |
+
|
| 5 |
+
def add_op_namespace_prefix(op_name: str):
|
| 6 |
+
"""
|
| 7 |
+
Prefix op by namespace.
|
| 8 |
+
"""
|
| 9 |
+
return f"_gguf_kernels_cuda_1df3b99::{op_name}"
|
build/torch213-cxx11-cu132-x86_64-linux/metadata.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "gguf-kernels",
|
| 3 |
+
"id": "_gguf_kernels_cuda_1df3b99",
|
| 4 |
+
"version": 1,
|
| 5 |
+
"license": "MIT",
|
| 6 |
+
"python-depends": [],
|
| 7 |
+
"backend": {
|
| 8 |
+
"type": "cuda",
|
| 9 |
+
"archs": [
|
| 10 |
+
"10.0",
|
| 11 |
+
"12.0",
|
| 12 |
+
"7.5",
|
| 13 |
+
"8.0",
|
| 14 |
+
"8.6",
|
| 15 |
+
"8.9",
|
| 16 |
+
"9.0"
|
| 17 |
+
]
|
| 18 |
+
},
|
| 19 |
+
"digest": {
|
| 20 |
+
"algorithm": "sha256",
|
| 21 |
+
"files": {
|
| 22 |
+
"__init__.py": "GoFcHJbbJ9C8b40XNznMxsTcC+CV9kaFE8a1DP763kU=",
|
| 23 |
+
"_gguf_kernels_cuda_1df3b99.abi3.so": "cyUErRnT6waS/KChCFzSfuuDjAaMbye2V9m4IkUE9ik=",
|
| 24 |
+
"_ops.py": "dRIZkil9x8IS6KhIwXlRzO6qzQoGYUQkGL87Z3gpEzY="
|
| 25 |
+
}
|
| 26 |
+
},
|
| 27 |
+
"provenance": {
|
| 28 |
+
"kernel-builder": {
|
| 29 |
+
"version": "0.17.0-dev0",
|
| 30 |
+
"sha": "81f55ea30fd8f819dcf93a3c934dd584c895bd2f",
|
| 31 |
+
"dirty": false
|
| 32 |
+
},
|
| 33 |
+
"kernel": {
|
| 34 |
+
"sha": "1df3b999686b77ef298ae13d066a39958503164c",
|
| 35 |
+
"dirty": false
|
| 36 |
+
}
|
| 37 |
+
}
|
| 38 |
+
}
|
build/torch213-metal-aarch64-darwin/_gguf_kernels_metal_0becb0a.abi3.so
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6346a66092b922568c84e4ed636157542f3b9b529d6b5680a03a79bc81e34712
|
| 3 |
+
size 132
|