Instructions to use kernels-community/fp8-fbgemm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Kernels
How to use kernels-community/fp8-fbgemm with Kernels:
# !pip install kernels from kernels import get_kernel kernel = get_kernel("kernels-community/fp8-fbgemm") - Notebooks
- Google Colab
- Kaggle
Build uploaded using `kernels`.
Browse files
build/torch-rocm/_ops.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
import torch
|
| 2 |
-
ops = torch.ops.
|
| 3 |
|
| 4 |
def add_op_namespace_prefix(op_name: str):
|
| 5 |
"""
|
| 6 |
Prefix op by namespace.
|
| 7 |
"""
|
| 8 |
-
return f"
|
|
|
|
| 1 |
import torch
|
| 2 |
+
ops = torch.ops._fp8_fbgemm_ed29ab1
|
| 3 |
|
| 4 |
def add_op_namespace_prefix(op_name: str):
|
| 5 |
"""
|
| 6 |
Prefix op by namespace.
|
| 7 |
"""
|
| 8 |
+
return f"_fp8_fbgemm_ed29ab1::{op_name}"
|
build/torch-rocm/fp8_fbgemm/__init__.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
import ctypes
|
|
|
|
| 2 |
import sys
|
| 3 |
-
|
| 4 |
-
import importlib
|
| 5 |
from pathlib import Path
|
| 6 |
from types import ModuleType
|
| 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
|
|
|
|
| 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
|
build/torch-rocm/metadata.json
CHANGED
|
@@ -1,4 +1,8 @@
|
|
| 1 |
{
|
| 2 |
"version": 1,
|
| 3 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"version": 1,
|
| 3 |
+
"license": "BSD-3-Clause",
|
| 4 |
+
"python-depends": [],
|
| 5 |
+
"backend": {
|
| 6 |
+
"type": "rocm"
|
| 7 |
+
}
|
| 8 |
}
|
build/torch-xpu/_ops.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
import torch
|
| 2 |
-
ops = torch.ops.
|
| 3 |
|
| 4 |
def add_op_namespace_prefix(op_name: str):
|
| 5 |
"""
|
| 6 |
Prefix op by namespace.
|
| 7 |
"""
|
| 8 |
-
return f"
|
|
|
|
| 1 |
import torch
|
| 2 |
+
ops = torch.ops._fp8_fbgemm_ed29ab1
|
| 3 |
|
| 4 |
def add_op_namespace_prefix(op_name: str):
|
| 5 |
"""
|
| 6 |
Prefix op by namespace.
|
| 7 |
"""
|
| 8 |
+
return f"_fp8_fbgemm_ed29ab1::{op_name}"
|
build/torch-xpu/fp8_fbgemm/__init__.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
import ctypes
|
|
|
|
| 2 |
import sys
|
| 3 |
-
|
| 4 |
-
import importlib
|
| 5 |
from pathlib import Path
|
| 6 |
from types import ModuleType
|
| 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
|
|
|
|
| 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
|
build/torch-xpu/metadata.json
CHANGED
|
@@ -1,4 +1,8 @@
|
|
| 1 |
{
|
| 2 |
"version": 1,
|
| 3 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"version": 1,
|
| 3 |
+
"license": "BSD-3-Clause",
|
| 4 |
+
"python-depends": [],
|
| 5 |
+
"backend": {
|
| 6 |
+
"type": "xpu"
|
| 7 |
+
}
|
| 8 |
}
|