Uploaded using `kernel-builder`.
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._liger_kernels_bfc6569
|
| 3 |
|
| 4 |
def add_op_namespace_prefix(op_name: str):
|
| 5 |
"""
|
| 6 |
Prefix op by namespace.
|
| 7 |
"""
|
| 8 |
+
return f"_liger_kernels_bfc6569::{op_name}"
|
build/torch-rocm/liger_kernels/__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-2-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._liger_kernels_bfc6569
|
| 3 |
|
| 4 |
def add_op_namespace_prefix(op_name: str):
|
| 5 |
"""
|
| 6 |
Prefix op by namespace.
|
| 7 |
"""
|
| 8 |
+
return f"_liger_kernels_bfc6569::{op_name}"
|
build/torch-xpu/liger_kernels/__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-2-Clause",
|
| 4 |
+
"python-depends": [],
|
| 5 |
+
"backend": {
|
| 6 |
+
"type": "xpu"
|
| 7 |
+
}
|
| 8 |
}
|