diff --git a/.gitattributes b/.gitattributes index d7488dabea182fdd8599d2869738811993d3cb51..c60d90ccc6e061acb93c4deeabe3fd821589cb5d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -51,3 +51,12 @@ build/torch28-cxx11-cu129-x86_64-linux/mra/_mra_9e0f4db.abi3.so filter=lfs diff= build/torch29-cxx11-cu126-x86_64-linux/mra/_mra_9e0f4db.abi3.so filter=lfs diff=lfs merge=lfs -text build/torch29-cxx11-cu128-x86_64-linux/mra/_mra_9e0f4db.abi3.so filter=lfs diff=lfs merge=lfs -text build/torch29-cxx11-cu130-x86_64-linux/mra/_mra_9e0f4db.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch210-cxx11-cu126-x86_64-linux/_mra_b91b835.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch210-cxx11-cu128-x86_64-linux/_mra_b91b835.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch210-cxx11-cu130-x86_64-linux/_mra_b91b835.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch28-cxx11-cu126-x86_64-linux/_mra_b91b835.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch28-cxx11-cu128-x86_64-linux/_mra_b91b835.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch28-cxx11-cu129-x86_64-linux/_mra_b91b835.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch29-cxx11-cu126-x86_64-linux/_mra_b91b835.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch29-cxx11-cu128-x86_64-linux/_mra_b91b835.abi3.so filter=lfs diff=lfs merge=lfs -text +build/torch29-cxx11-cu130-x86_64-linux/_mra_b91b835.abi3.so filter=lfs diff=lfs merge=lfs -text diff --git a/build/torch210-cxx11-cu126-x86_64-linux/__init__.py b/build/torch210-cxx11-cu126-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..86daaf874c808b8b828b43b4ee8a6b292323d336 --- /dev/null +++ b/build/torch210-cxx11-cu126-x86_64-linux/__init__.py @@ -0,0 +1,25 @@ +from ._ops import ops +import torch + +def index_max(index_vals: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): + return ops.index_max(index_vals, indices, A_num_block, B_num_block) + +def mm_to_sparse(dense_A: torch.Tensor, dense_B: torch.Tensor, indices: torch.Tensor): + return ops.mm_to_sparse(dense_A, dense_B, indices) + +def sparse_dense_mm(sparse_A: torch.Tensor, indices: torch.Tensor, dense_B: torch.Tensor, A_num_block: int): + return ops.sparse_dense_mm(sparse_A, indices, dense_B, A_num_block) + +def reduce_sum(sparse_A: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): + return ops.reduce_sum(sparse_A, indices, A_num_block, B_num_block) + +def scatter(dense_A: torch.Tensor, indices: torch.Tensor, B_num_block: int): + return ops.scatter(dense_A, indices, B_num_block) + +__all__ = [ + "index_max", + "mm_to_sparse", + "sparse_dense_mm", + "reduce_sum", + "scatter", +] \ No newline at end of file diff --git a/build/torch210-cxx11-cu126-x86_64-linux/_mra_b91b835.abi3.so b/build/torch210-cxx11-cu126-x86_64-linux/_mra_b91b835.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..626543779acdd197fe59fe612d85068c558b19c5 --- /dev/null +++ b/build/torch210-cxx11-cu126-x86_64-linux/_mra_b91b835.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb5be144697731fba4406b4ed16232dca9b2c05cb7715646efe3679e7b6343b0 +size 2451456 diff --git a/build/torch28-cxx11-cu128-x86_64-linux/mra/_ops.py b/build/torch210-cxx11-cu126-x86_64-linux/_ops.py similarity index 52% rename from build/torch28-cxx11-cu128-x86_64-linux/mra/_ops.py rename to build/torch210-cxx11-cu126-x86_64-linux/_ops.py index fd6050d31c8fe3317a842e237acda7577b15f1e9..3fa96943fdd89f679c76d57eee7f67d9971b84f2 100644 --- a/build/torch28-cxx11-cu128-x86_64-linux/mra/_ops.py +++ b/build/torch210-cxx11-cu126-x86_64-linux/_ops.py @@ -1,9 +1,9 @@ import torch -from . import _mra_9e0f4db -ops = torch.ops._mra_9e0f4db +from . import _mra_b91b835 +ops = torch.ops._mra_b91b835 def add_op_namespace_prefix(op_name: str): """ Prefix op by namespace. """ - return f"_mra_9e0f4db::{op_name}" \ No newline at end of file + return f"_mra_b91b835::{op_name}" \ No newline at end of file diff --git a/build/torch210-cxx11-cu126-x86_64-linux/metadata.json b/build/torch210-cxx11-cu126-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch210-cxx11-cu126-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch210-cxx11-cu126-x86_64-linux/mra/__init__.py b/build/torch210-cxx11-cu126-x86_64-linux/mra/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..03dbc1afe1cf156661a2b1b22003cd5f599a0309 --- /dev/null +++ b/build/torch210-cxx11-cu126-x86_64-linux/mra/__init__.py @@ -0,0 +1,26 @@ +import ctypes +import sys + +import importlib +from pathlib import Path +from types import ModuleType + +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module + + +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch210-cxx11-cu128-x86_64-linux/__init__.py b/build/torch210-cxx11-cu128-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..86daaf874c808b8b828b43b4ee8a6b292323d336 --- /dev/null +++ b/build/torch210-cxx11-cu128-x86_64-linux/__init__.py @@ -0,0 +1,25 @@ +from ._ops import ops +import torch + +def index_max(index_vals: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): + return ops.index_max(index_vals, indices, A_num_block, B_num_block) + +def mm_to_sparse(dense_A: torch.Tensor, dense_B: torch.Tensor, indices: torch.Tensor): + return ops.mm_to_sparse(dense_A, dense_B, indices) + +def sparse_dense_mm(sparse_A: torch.Tensor, indices: torch.Tensor, dense_B: torch.Tensor, A_num_block: int): + return ops.sparse_dense_mm(sparse_A, indices, dense_B, A_num_block) + +def reduce_sum(sparse_A: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): + return ops.reduce_sum(sparse_A, indices, A_num_block, B_num_block) + +def scatter(dense_A: torch.Tensor, indices: torch.Tensor, B_num_block: int): + return ops.scatter(dense_A, indices, B_num_block) + +__all__ = [ + "index_max", + "mm_to_sparse", + "sparse_dense_mm", + "reduce_sum", + "scatter", +] \ No newline at end of file diff --git a/build/torch210-cxx11-cu128-x86_64-linux/_mra_b91b835.abi3.so b/build/torch210-cxx11-cu128-x86_64-linux/_mra_b91b835.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..7a8e831dc34f0a9b1a45927a6d8549ccdc24af37 --- /dev/null +++ b/build/torch210-cxx11-cu128-x86_64-linux/_mra_b91b835.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2719092133c64747d7527e90b18e4bf88616787205bc49ca513544b8d93b7db3 +size 2719824 diff --git a/build/torch28-cxx11-cu129-x86_64-linux/mra/_ops.py b/build/torch210-cxx11-cu128-x86_64-linux/_ops.py similarity index 52% rename from build/torch28-cxx11-cu129-x86_64-linux/mra/_ops.py rename to build/torch210-cxx11-cu128-x86_64-linux/_ops.py index fd6050d31c8fe3317a842e237acda7577b15f1e9..3fa96943fdd89f679c76d57eee7f67d9971b84f2 100644 --- a/build/torch28-cxx11-cu129-x86_64-linux/mra/_ops.py +++ b/build/torch210-cxx11-cu128-x86_64-linux/_ops.py @@ -1,9 +1,9 @@ import torch -from . import _mra_9e0f4db -ops = torch.ops._mra_9e0f4db +from . import _mra_b91b835 +ops = torch.ops._mra_b91b835 def add_op_namespace_prefix(op_name: str): """ Prefix op by namespace. """ - return f"_mra_9e0f4db::{op_name}" \ No newline at end of file + return f"_mra_b91b835::{op_name}" \ No newline at end of file diff --git a/build/torch210-cxx11-cu128-x86_64-linux/metadata.json b/build/torch210-cxx11-cu128-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch210-cxx11-cu128-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch210-cxx11-cu128-x86_64-linux/mra/__init__.py b/build/torch210-cxx11-cu128-x86_64-linux/mra/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..03dbc1afe1cf156661a2b1b22003cd5f599a0309 --- /dev/null +++ b/build/torch210-cxx11-cu128-x86_64-linux/mra/__init__.py @@ -0,0 +1,26 @@ +import ctypes +import sys + +import importlib +from pathlib import Path +from types import ModuleType + +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module + + +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch210-cxx11-cu130-x86_64-linux/__init__.py b/build/torch210-cxx11-cu130-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..86daaf874c808b8b828b43b4ee8a6b292323d336 --- /dev/null +++ b/build/torch210-cxx11-cu130-x86_64-linux/__init__.py @@ -0,0 +1,25 @@ +from ._ops import ops +import torch + +def index_max(index_vals: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): + return ops.index_max(index_vals, indices, A_num_block, B_num_block) + +def mm_to_sparse(dense_A: torch.Tensor, dense_B: torch.Tensor, indices: torch.Tensor): + return ops.mm_to_sparse(dense_A, dense_B, indices) + +def sparse_dense_mm(sparse_A: torch.Tensor, indices: torch.Tensor, dense_B: torch.Tensor, A_num_block: int): + return ops.sparse_dense_mm(sparse_A, indices, dense_B, A_num_block) + +def reduce_sum(sparse_A: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): + return ops.reduce_sum(sparse_A, indices, A_num_block, B_num_block) + +def scatter(dense_A: torch.Tensor, indices: torch.Tensor, B_num_block: int): + return ops.scatter(dense_A, indices, B_num_block) + +__all__ = [ + "index_max", + "mm_to_sparse", + "sparse_dense_mm", + "reduce_sum", + "scatter", +] \ No newline at end of file diff --git a/build/torch210-cxx11-cu130-x86_64-linux/_mra_b91b835.abi3.so b/build/torch210-cxx11-cu130-x86_64-linux/_mra_b91b835.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..d2fb72195c117e6a5557d64dc61904a8873170a4 --- /dev/null +++ b/build/torch210-cxx11-cu130-x86_64-linux/_mra_b91b835.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e562370de6b1e766e9fa49f731fc4516ec726643cdbb0a57d6a291359ea5954 +size 2641336 diff --git a/build/torch29-cxx11-cu126-x86_64-linux/mra/_ops.py b/build/torch210-cxx11-cu130-x86_64-linux/_ops.py similarity index 52% rename from build/torch29-cxx11-cu126-x86_64-linux/mra/_ops.py rename to build/torch210-cxx11-cu130-x86_64-linux/_ops.py index fd6050d31c8fe3317a842e237acda7577b15f1e9..3fa96943fdd89f679c76d57eee7f67d9971b84f2 100644 --- a/build/torch29-cxx11-cu126-x86_64-linux/mra/_ops.py +++ b/build/torch210-cxx11-cu130-x86_64-linux/_ops.py @@ -1,9 +1,9 @@ import torch -from . import _mra_9e0f4db -ops = torch.ops._mra_9e0f4db +from . import _mra_b91b835 +ops = torch.ops._mra_b91b835 def add_op_namespace_prefix(op_name: str): """ Prefix op by namespace. """ - return f"_mra_9e0f4db::{op_name}" \ No newline at end of file + return f"_mra_b91b835::{op_name}" \ No newline at end of file diff --git a/build/torch210-cxx11-cu130-x86_64-linux/metadata.json b/build/torch210-cxx11-cu130-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch210-cxx11-cu130-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch210-cxx11-cu130-x86_64-linux/mra/__init__.py b/build/torch210-cxx11-cu130-x86_64-linux/mra/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..03dbc1afe1cf156661a2b1b22003cd5f599a0309 --- /dev/null +++ b/build/torch210-cxx11-cu130-x86_64-linux/mra/__init__.py @@ -0,0 +1,26 @@ +import ctypes +import sys + +import importlib +from pathlib import Path +from types import ModuleType + +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module + + +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch28-cxx11-cu126-x86_64-linux/__init__.py b/build/torch28-cxx11-cu126-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..86daaf874c808b8b828b43b4ee8a6b292323d336 --- /dev/null +++ b/build/torch28-cxx11-cu126-x86_64-linux/__init__.py @@ -0,0 +1,25 @@ +from ._ops import ops +import torch + +def index_max(index_vals: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): + return ops.index_max(index_vals, indices, A_num_block, B_num_block) + +def mm_to_sparse(dense_A: torch.Tensor, dense_B: torch.Tensor, indices: torch.Tensor): + return ops.mm_to_sparse(dense_A, dense_B, indices) + +def sparse_dense_mm(sparse_A: torch.Tensor, indices: torch.Tensor, dense_B: torch.Tensor, A_num_block: int): + return ops.sparse_dense_mm(sparse_A, indices, dense_B, A_num_block) + +def reduce_sum(sparse_A: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): + return ops.reduce_sum(sparse_A, indices, A_num_block, B_num_block) + +def scatter(dense_A: torch.Tensor, indices: torch.Tensor, B_num_block: int): + return ops.scatter(dense_A, indices, B_num_block) + +__all__ = [ + "index_max", + "mm_to_sparse", + "sparse_dense_mm", + "reduce_sum", + "scatter", +] \ No newline at end of file diff --git a/build/torch28-cxx11-cu126-x86_64-linux/_mra_b91b835.abi3.so b/build/torch28-cxx11-cu126-x86_64-linux/_mra_b91b835.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..360680506026560b356c1f5338b83964052b8a4a --- /dev/null +++ b/build/torch28-cxx11-cu126-x86_64-linux/_mra_b91b835.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66023954635a31836ddef4a3d072796477d2df17611a3b0acadc83e4b9d644ad +size 2446064 diff --git a/build/torch28-cxx11-cu126-x86_64-linux/mra/_ops.py b/build/torch28-cxx11-cu126-x86_64-linux/_ops.py similarity index 52% rename from build/torch28-cxx11-cu126-x86_64-linux/mra/_ops.py rename to build/torch28-cxx11-cu126-x86_64-linux/_ops.py index fd6050d31c8fe3317a842e237acda7577b15f1e9..3fa96943fdd89f679c76d57eee7f67d9971b84f2 100644 --- a/build/torch28-cxx11-cu126-x86_64-linux/mra/_ops.py +++ b/build/torch28-cxx11-cu126-x86_64-linux/_ops.py @@ -1,9 +1,9 @@ import torch -from . import _mra_9e0f4db -ops = torch.ops._mra_9e0f4db +from . import _mra_b91b835 +ops = torch.ops._mra_b91b835 def add_op_namespace_prefix(op_name: str): """ Prefix op by namespace. """ - return f"_mra_9e0f4db::{op_name}" \ No newline at end of file + return f"_mra_b91b835::{op_name}" \ No newline at end of file diff --git a/build/torch28-cxx11-cu126-x86_64-linux/metadata.json b/build/torch28-cxx11-cu126-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch28-cxx11-cu126-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch28-cxx11-cu126-x86_64-linux/mra/__init__.py b/build/torch28-cxx11-cu126-x86_64-linux/mra/__init__.py index 86daaf874c808b8b828b43b4ee8a6b292323d336..03dbc1afe1cf156661a2b1b22003cd5f599a0309 100644 --- a/build/torch28-cxx11-cu126-x86_64-linux/mra/__init__.py +++ b/build/torch28-cxx11-cu126-x86_64-linux/mra/__init__.py @@ -1,25 +1,26 @@ -from ._ops import ops -import torch +import ctypes +import sys -def index_max(index_vals: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): - return ops.index_max(index_vals, indices, A_num_block, B_num_block) +import importlib +from pathlib import Path +from types import ModuleType -def mm_to_sparse(dense_A: torch.Tensor, dense_B: torch.Tensor, indices: torch.Tensor): - return ops.mm_to_sparse(dense_A, dense_B, indices) +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module -def sparse_dense_mm(sparse_A: torch.Tensor, indices: torch.Tensor, dense_B: torch.Tensor, A_num_block: int): - return ops.sparse_dense_mm(sparse_A, indices, dense_B, A_num_block) -def reduce_sum(sparse_A: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): - return ops.reduce_sum(sparse_A, indices, A_num_block, B_num_block) - -def scatter(dense_A: torch.Tensor, indices: torch.Tensor, B_num_block: int): - return ops.scatter(dense_A, indices, B_num_block) - -__all__ = [ - "index_max", - "mm_to_sparse", - "sparse_dense_mm", - "reduce_sum", - "scatter", -] \ No newline at end of file +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch28-cxx11-cu126-x86_64-linux/mra/__pycache__/__init__.cpython-313.pyc b/build/torch28-cxx11-cu126-x86_64-linux/mra/__pycache__/__init__.cpython-313.pyc deleted file mode 100644 index d6e8da9da837dc14d801e016d460051af24e394c..0000000000000000000000000000000000000000 Binary files a/build/torch28-cxx11-cu126-x86_64-linux/mra/__pycache__/__init__.cpython-313.pyc and /dev/null differ diff --git a/build/torch28-cxx11-cu126-x86_64-linux/mra/__pycache__/_ops.cpython-313.pyc b/build/torch28-cxx11-cu126-x86_64-linux/mra/__pycache__/_ops.cpython-313.pyc deleted file mode 100644 index dff6ae3abee9b3a5fed803dda10d46e6dbf58c4c..0000000000000000000000000000000000000000 Binary files a/build/torch28-cxx11-cu126-x86_64-linux/mra/__pycache__/_ops.cpython-313.pyc and /dev/null differ diff --git a/build/torch28-cxx11-cu126-x86_64-linux/mra/_mra_9e0f4db.abi3.so b/build/torch28-cxx11-cu126-x86_64-linux/mra/_mra_9e0f4db.abi3.so deleted file mode 100644 index 9c854a7623deb902e0014a114e0427737eee2bce..0000000000000000000000000000000000000000 --- a/build/torch28-cxx11-cu126-x86_64-linux/mra/_mra_9e0f4db.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:16b83b6d735eb5a16132b29c3ee6594379a132c812ffbbc668bdbe7b28aa4d23 -size 2334488 diff --git a/build/torch28-cxx11-cu128-x86_64-linux/__init__.py b/build/torch28-cxx11-cu128-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..86daaf874c808b8b828b43b4ee8a6b292323d336 --- /dev/null +++ b/build/torch28-cxx11-cu128-x86_64-linux/__init__.py @@ -0,0 +1,25 @@ +from ._ops import ops +import torch + +def index_max(index_vals: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): + return ops.index_max(index_vals, indices, A_num_block, B_num_block) + +def mm_to_sparse(dense_A: torch.Tensor, dense_B: torch.Tensor, indices: torch.Tensor): + return ops.mm_to_sparse(dense_A, dense_B, indices) + +def sparse_dense_mm(sparse_A: torch.Tensor, indices: torch.Tensor, dense_B: torch.Tensor, A_num_block: int): + return ops.sparse_dense_mm(sparse_A, indices, dense_B, A_num_block) + +def reduce_sum(sparse_A: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): + return ops.reduce_sum(sparse_A, indices, A_num_block, B_num_block) + +def scatter(dense_A: torch.Tensor, indices: torch.Tensor, B_num_block: int): + return ops.scatter(dense_A, indices, B_num_block) + +__all__ = [ + "index_max", + "mm_to_sparse", + "sparse_dense_mm", + "reduce_sum", + "scatter", +] \ No newline at end of file diff --git a/build/torch28-cxx11-cu128-x86_64-linux/_mra_b91b835.abi3.so b/build/torch28-cxx11-cu128-x86_64-linux/_mra_b91b835.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..898b1e4f10aa1c2ef56699c4ba77ca8091cba640 --- /dev/null +++ b/build/torch28-cxx11-cu128-x86_64-linux/_mra_b91b835.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:daaac316543e2c585eb477e8c494ee342f46e292048e6ac0d3637fce1577bf68 +size 2714440 diff --git a/build/torch28-cxx11-cu128-x86_64-linux/_ops.py b/build/torch28-cxx11-cu128-x86_64-linux/_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..3fa96943fdd89f679c76d57eee7f67d9971b84f2 --- /dev/null +++ b/build/torch28-cxx11-cu128-x86_64-linux/_ops.py @@ -0,0 +1,9 @@ +import torch +from . import _mra_b91b835 +ops = torch.ops._mra_b91b835 + +def add_op_namespace_prefix(op_name: str): + """ + Prefix op by namespace. + """ + return f"_mra_b91b835::{op_name}" \ No newline at end of file diff --git a/build/torch28-cxx11-cu128-x86_64-linux/metadata.json b/build/torch28-cxx11-cu128-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch28-cxx11-cu128-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch28-cxx11-cu128-x86_64-linux/mra/__init__.py b/build/torch28-cxx11-cu128-x86_64-linux/mra/__init__.py index 86daaf874c808b8b828b43b4ee8a6b292323d336..03dbc1afe1cf156661a2b1b22003cd5f599a0309 100644 --- a/build/torch28-cxx11-cu128-x86_64-linux/mra/__init__.py +++ b/build/torch28-cxx11-cu128-x86_64-linux/mra/__init__.py @@ -1,25 +1,26 @@ -from ._ops import ops -import torch +import ctypes +import sys -def index_max(index_vals: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): - return ops.index_max(index_vals, indices, A_num_block, B_num_block) +import importlib +from pathlib import Path +from types import ModuleType -def mm_to_sparse(dense_A: torch.Tensor, dense_B: torch.Tensor, indices: torch.Tensor): - return ops.mm_to_sparse(dense_A, dense_B, indices) +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module -def sparse_dense_mm(sparse_A: torch.Tensor, indices: torch.Tensor, dense_B: torch.Tensor, A_num_block: int): - return ops.sparse_dense_mm(sparse_A, indices, dense_B, A_num_block) -def reduce_sum(sparse_A: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): - return ops.reduce_sum(sparse_A, indices, A_num_block, B_num_block) - -def scatter(dense_A: torch.Tensor, indices: torch.Tensor, B_num_block: int): - return ops.scatter(dense_A, indices, B_num_block) - -__all__ = [ - "index_max", - "mm_to_sparse", - "sparse_dense_mm", - "reduce_sum", - "scatter", -] \ No newline at end of file +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch28-cxx11-cu128-x86_64-linux/mra/__pycache__/__init__.cpython-313.pyc b/build/torch28-cxx11-cu128-x86_64-linux/mra/__pycache__/__init__.cpython-313.pyc deleted file mode 100644 index 8199e76e76111bb77e897e5c183ef7ca4f6eb407..0000000000000000000000000000000000000000 Binary files a/build/torch28-cxx11-cu128-x86_64-linux/mra/__pycache__/__init__.cpython-313.pyc and /dev/null differ diff --git a/build/torch28-cxx11-cu128-x86_64-linux/mra/__pycache__/_ops.cpython-313.pyc b/build/torch28-cxx11-cu128-x86_64-linux/mra/__pycache__/_ops.cpython-313.pyc deleted file mode 100644 index 7a0681fd99ee2a22a262a34e496eb479f706970b..0000000000000000000000000000000000000000 Binary files a/build/torch28-cxx11-cu128-x86_64-linux/mra/__pycache__/_ops.cpython-313.pyc and /dev/null differ diff --git a/build/torch28-cxx11-cu128-x86_64-linux/mra/_mra_9e0f4db.abi3.so b/build/torch28-cxx11-cu128-x86_64-linux/mra/_mra_9e0f4db.abi3.so deleted file mode 100644 index 5a9d16904d667ebbb67495b55b8c401117e83ac6..0000000000000000000000000000000000000000 --- a/build/torch28-cxx11-cu128-x86_64-linux/mra/_mra_9e0f4db.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dffa76035f51278977f311ed5acc0ad772b78ccec8dc376a672ca89e2f28d024 -size 2602848 diff --git a/build/torch28-cxx11-cu129-x86_64-linux/__init__.py b/build/torch28-cxx11-cu129-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..86daaf874c808b8b828b43b4ee8a6b292323d336 --- /dev/null +++ b/build/torch28-cxx11-cu129-x86_64-linux/__init__.py @@ -0,0 +1,25 @@ +from ._ops import ops +import torch + +def index_max(index_vals: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): + return ops.index_max(index_vals, indices, A_num_block, B_num_block) + +def mm_to_sparse(dense_A: torch.Tensor, dense_B: torch.Tensor, indices: torch.Tensor): + return ops.mm_to_sparse(dense_A, dense_B, indices) + +def sparse_dense_mm(sparse_A: torch.Tensor, indices: torch.Tensor, dense_B: torch.Tensor, A_num_block: int): + return ops.sparse_dense_mm(sparse_A, indices, dense_B, A_num_block) + +def reduce_sum(sparse_A: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): + return ops.reduce_sum(sparse_A, indices, A_num_block, B_num_block) + +def scatter(dense_A: torch.Tensor, indices: torch.Tensor, B_num_block: int): + return ops.scatter(dense_A, indices, B_num_block) + +__all__ = [ + "index_max", + "mm_to_sparse", + "sparse_dense_mm", + "reduce_sum", + "scatter", +] \ No newline at end of file diff --git a/build/torch28-cxx11-cu129-x86_64-linux/_mra_b91b835.abi3.so b/build/torch28-cxx11-cu129-x86_64-linux/_mra_b91b835.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..b9ac1c454640b71260aa6cffebe4bbcd4ced288d --- /dev/null +++ b/build/torch28-cxx11-cu129-x86_64-linux/_mra_b91b835.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9438df3b497af7e80e214b74bf4b9e789d3cd1f856105dc251c5de6ba750bdb4 +size 2748224 diff --git a/build/torch28-cxx11-cu129-x86_64-linux/_ops.py b/build/torch28-cxx11-cu129-x86_64-linux/_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..3fa96943fdd89f679c76d57eee7f67d9971b84f2 --- /dev/null +++ b/build/torch28-cxx11-cu129-x86_64-linux/_ops.py @@ -0,0 +1,9 @@ +import torch +from . import _mra_b91b835 +ops = torch.ops._mra_b91b835 + +def add_op_namespace_prefix(op_name: str): + """ + Prefix op by namespace. + """ + return f"_mra_b91b835::{op_name}" \ No newline at end of file diff --git a/build/torch28-cxx11-cu129-x86_64-linux/metadata.json b/build/torch28-cxx11-cu129-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch28-cxx11-cu129-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch28-cxx11-cu129-x86_64-linux/mra/__init__.py b/build/torch28-cxx11-cu129-x86_64-linux/mra/__init__.py index 86daaf874c808b8b828b43b4ee8a6b292323d336..03dbc1afe1cf156661a2b1b22003cd5f599a0309 100644 --- a/build/torch28-cxx11-cu129-x86_64-linux/mra/__init__.py +++ b/build/torch28-cxx11-cu129-x86_64-linux/mra/__init__.py @@ -1,25 +1,26 @@ -from ._ops import ops -import torch +import ctypes +import sys -def index_max(index_vals: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): - return ops.index_max(index_vals, indices, A_num_block, B_num_block) +import importlib +from pathlib import Path +from types import ModuleType -def mm_to_sparse(dense_A: torch.Tensor, dense_B: torch.Tensor, indices: torch.Tensor): - return ops.mm_to_sparse(dense_A, dense_B, indices) +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module -def sparse_dense_mm(sparse_A: torch.Tensor, indices: torch.Tensor, dense_B: torch.Tensor, A_num_block: int): - return ops.sparse_dense_mm(sparse_A, indices, dense_B, A_num_block) -def reduce_sum(sparse_A: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): - return ops.reduce_sum(sparse_A, indices, A_num_block, B_num_block) - -def scatter(dense_A: torch.Tensor, indices: torch.Tensor, B_num_block: int): - return ops.scatter(dense_A, indices, B_num_block) - -__all__ = [ - "index_max", - "mm_to_sparse", - "sparse_dense_mm", - "reduce_sum", - "scatter", -] \ No newline at end of file +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch28-cxx11-cu129-x86_64-linux/mra/__pycache__/__init__.cpython-313.pyc b/build/torch28-cxx11-cu129-x86_64-linux/mra/__pycache__/__init__.cpython-313.pyc deleted file mode 100644 index 9e1f4e01190397f8203af513e4f8ae6ca03d0b7d..0000000000000000000000000000000000000000 Binary files a/build/torch28-cxx11-cu129-x86_64-linux/mra/__pycache__/__init__.cpython-313.pyc and /dev/null differ diff --git a/build/torch28-cxx11-cu129-x86_64-linux/mra/__pycache__/_ops.cpython-313.pyc b/build/torch28-cxx11-cu129-x86_64-linux/mra/__pycache__/_ops.cpython-313.pyc deleted file mode 100644 index c875282846532e05154aa5d1dafdc24d9b76e16f..0000000000000000000000000000000000000000 Binary files a/build/torch28-cxx11-cu129-x86_64-linux/mra/__pycache__/_ops.cpython-313.pyc and /dev/null differ diff --git a/build/torch28-cxx11-cu129-x86_64-linux/mra/_mra_9e0f4db.abi3.so b/build/torch28-cxx11-cu129-x86_64-linux/mra/_mra_9e0f4db.abi3.so deleted file mode 100644 index 567f2f27373ffed8774c5afe4b657c83a7c2825e..0000000000000000000000000000000000000000 --- a/build/torch28-cxx11-cu129-x86_64-linux/mra/_mra_9e0f4db.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6f6fd347cc0a80dcca1709760e4ec6495fc2b6a7bf89070b1a37b772bc2d79a0 -size 2632536 diff --git a/build/torch29-cxx11-cu126-x86_64-linux/__init__.py b/build/torch29-cxx11-cu126-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..86daaf874c808b8b828b43b4ee8a6b292323d336 --- /dev/null +++ b/build/torch29-cxx11-cu126-x86_64-linux/__init__.py @@ -0,0 +1,25 @@ +from ._ops import ops +import torch + +def index_max(index_vals: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): + return ops.index_max(index_vals, indices, A_num_block, B_num_block) + +def mm_to_sparse(dense_A: torch.Tensor, dense_B: torch.Tensor, indices: torch.Tensor): + return ops.mm_to_sparse(dense_A, dense_B, indices) + +def sparse_dense_mm(sparse_A: torch.Tensor, indices: torch.Tensor, dense_B: torch.Tensor, A_num_block: int): + return ops.sparse_dense_mm(sparse_A, indices, dense_B, A_num_block) + +def reduce_sum(sparse_A: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): + return ops.reduce_sum(sparse_A, indices, A_num_block, B_num_block) + +def scatter(dense_A: torch.Tensor, indices: torch.Tensor, B_num_block: int): + return ops.scatter(dense_A, indices, B_num_block) + +__all__ = [ + "index_max", + "mm_to_sparse", + "sparse_dense_mm", + "reduce_sum", + "scatter", +] \ No newline at end of file diff --git a/build/torch29-cxx11-cu126-x86_64-linux/_mra_b91b835.abi3.so b/build/torch29-cxx11-cu126-x86_64-linux/_mra_b91b835.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..7a607d0e1ef939311804ab9063a4bf7a256528d7 --- /dev/null +++ b/build/torch29-cxx11-cu126-x86_64-linux/_mra_b91b835.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eafd95e7fa0334563e9b39d8381fa91af8f65d9d654185ffcf63a07e9be1b6e3 +size 2446040 diff --git a/build/torch29-cxx11-cu126-x86_64-linux/_ops.py b/build/torch29-cxx11-cu126-x86_64-linux/_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..3fa96943fdd89f679c76d57eee7f67d9971b84f2 --- /dev/null +++ b/build/torch29-cxx11-cu126-x86_64-linux/_ops.py @@ -0,0 +1,9 @@ +import torch +from . import _mra_b91b835 +ops = torch.ops._mra_b91b835 + +def add_op_namespace_prefix(op_name: str): + """ + Prefix op by namespace. + """ + return f"_mra_b91b835::{op_name}" \ No newline at end of file diff --git a/build/torch29-cxx11-cu126-x86_64-linux/metadata.json b/build/torch29-cxx11-cu126-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch29-cxx11-cu126-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch29-cxx11-cu126-x86_64-linux/mra/__init__.py b/build/torch29-cxx11-cu126-x86_64-linux/mra/__init__.py index 86daaf874c808b8b828b43b4ee8a6b292323d336..03dbc1afe1cf156661a2b1b22003cd5f599a0309 100644 --- a/build/torch29-cxx11-cu126-x86_64-linux/mra/__init__.py +++ b/build/torch29-cxx11-cu126-x86_64-linux/mra/__init__.py @@ -1,25 +1,26 @@ -from ._ops import ops -import torch +import ctypes +import sys -def index_max(index_vals: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): - return ops.index_max(index_vals, indices, A_num_block, B_num_block) +import importlib +from pathlib import Path +from types import ModuleType -def mm_to_sparse(dense_A: torch.Tensor, dense_B: torch.Tensor, indices: torch.Tensor): - return ops.mm_to_sparse(dense_A, dense_B, indices) +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module -def sparse_dense_mm(sparse_A: torch.Tensor, indices: torch.Tensor, dense_B: torch.Tensor, A_num_block: int): - return ops.sparse_dense_mm(sparse_A, indices, dense_B, A_num_block) -def reduce_sum(sparse_A: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): - return ops.reduce_sum(sparse_A, indices, A_num_block, B_num_block) - -def scatter(dense_A: torch.Tensor, indices: torch.Tensor, B_num_block: int): - return ops.scatter(dense_A, indices, B_num_block) - -__all__ = [ - "index_max", - "mm_to_sparse", - "sparse_dense_mm", - "reduce_sum", - "scatter", -] \ No newline at end of file +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch29-cxx11-cu126-x86_64-linux/mra/__pycache__/__init__.cpython-313.pyc b/build/torch29-cxx11-cu126-x86_64-linux/mra/__pycache__/__init__.cpython-313.pyc deleted file mode 100644 index 6aafa7f0b3b4b18dbb65d44b9acf18c35cb46845..0000000000000000000000000000000000000000 Binary files a/build/torch29-cxx11-cu126-x86_64-linux/mra/__pycache__/__init__.cpython-313.pyc and /dev/null differ diff --git a/build/torch29-cxx11-cu126-x86_64-linux/mra/__pycache__/_ops.cpython-313.pyc b/build/torch29-cxx11-cu126-x86_64-linux/mra/__pycache__/_ops.cpython-313.pyc deleted file mode 100644 index 55e89196f841b1a5341d57cb17a1019d80f55764..0000000000000000000000000000000000000000 Binary files a/build/torch29-cxx11-cu126-x86_64-linux/mra/__pycache__/_ops.cpython-313.pyc and /dev/null differ diff --git a/build/torch29-cxx11-cu126-x86_64-linux/mra/_mra_9e0f4db.abi3.so b/build/torch29-cxx11-cu126-x86_64-linux/mra/_mra_9e0f4db.abi3.so deleted file mode 100644 index 546a28b8a23e5c9408af9cd137d1988021973189..0000000000000000000000000000000000000000 --- a/build/torch29-cxx11-cu126-x86_64-linux/mra/_mra_9e0f4db.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b54153235319a97ed3a32d8938b70823e3204bfff9503c7efe881228014d6339 -size 2334464 diff --git a/build/torch29-cxx11-cu128-x86_64-linux/__init__.py b/build/torch29-cxx11-cu128-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..86daaf874c808b8b828b43b4ee8a6b292323d336 --- /dev/null +++ b/build/torch29-cxx11-cu128-x86_64-linux/__init__.py @@ -0,0 +1,25 @@ +from ._ops import ops +import torch + +def index_max(index_vals: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): + return ops.index_max(index_vals, indices, A_num_block, B_num_block) + +def mm_to_sparse(dense_A: torch.Tensor, dense_B: torch.Tensor, indices: torch.Tensor): + return ops.mm_to_sparse(dense_A, dense_B, indices) + +def sparse_dense_mm(sparse_A: torch.Tensor, indices: torch.Tensor, dense_B: torch.Tensor, A_num_block: int): + return ops.sparse_dense_mm(sparse_A, indices, dense_B, A_num_block) + +def reduce_sum(sparse_A: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): + return ops.reduce_sum(sparse_A, indices, A_num_block, B_num_block) + +def scatter(dense_A: torch.Tensor, indices: torch.Tensor, B_num_block: int): + return ops.scatter(dense_A, indices, B_num_block) + +__all__ = [ + "index_max", + "mm_to_sparse", + "sparse_dense_mm", + "reduce_sum", + "scatter", +] \ No newline at end of file diff --git a/build/torch29-cxx11-cu128-x86_64-linux/_mra_b91b835.abi3.so b/build/torch29-cxx11-cu128-x86_64-linux/_mra_b91b835.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..4e485f70f4f2d5e8c8473774c9bc23c579c33575 --- /dev/null +++ b/build/torch29-cxx11-cu128-x86_64-linux/_mra_b91b835.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b3c5b1dc0d06c9c9bd4813ef6617a3d61d7fe8785be8b000c69a7ecf800572d6 +size 2714408 diff --git a/build/torch29-cxx11-cu128-x86_64-linux/_ops.py b/build/torch29-cxx11-cu128-x86_64-linux/_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..3fa96943fdd89f679c76d57eee7f67d9971b84f2 --- /dev/null +++ b/build/torch29-cxx11-cu128-x86_64-linux/_ops.py @@ -0,0 +1,9 @@ +import torch +from . import _mra_b91b835 +ops = torch.ops._mra_b91b835 + +def add_op_namespace_prefix(op_name: str): + """ + Prefix op by namespace. + """ + return f"_mra_b91b835::{op_name}" \ No newline at end of file diff --git a/build/torch29-cxx11-cu128-x86_64-linux/metadata.json b/build/torch29-cxx11-cu128-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch29-cxx11-cu128-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch29-cxx11-cu128-x86_64-linux/mra/__init__.py b/build/torch29-cxx11-cu128-x86_64-linux/mra/__init__.py index 86daaf874c808b8b828b43b4ee8a6b292323d336..03dbc1afe1cf156661a2b1b22003cd5f599a0309 100644 --- a/build/torch29-cxx11-cu128-x86_64-linux/mra/__init__.py +++ b/build/torch29-cxx11-cu128-x86_64-linux/mra/__init__.py @@ -1,25 +1,26 @@ -from ._ops import ops -import torch +import ctypes +import sys -def index_max(index_vals: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): - return ops.index_max(index_vals, indices, A_num_block, B_num_block) +import importlib +from pathlib import Path +from types import ModuleType -def mm_to_sparse(dense_A: torch.Tensor, dense_B: torch.Tensor, indices: torch.Tensor): - return ops.mm_to_sparse(dense_A, dense_B, indices) +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module -def sparse_dense_mm(sparse_A: torch.Tensor, indices: torch.Tensor, dense_B: torch.Tensor, A_num_block: int): - return ops.sparse_dense_mm(sparse_A, indices, dense_B, A_num_block) -def reduce_sum(sparse_A: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): - return ops.reduce_sum(sparse_A, indices, A_num_block, B_num_block) - -def scatter(dense_A: torch.Tensor, indices: torch.Tensor, B_num_block: int): - return ops.scatter(dense_A, indices, B_num_block) - -__all__ = [ - "index_max", - "mm_to_sparse", - "sparse_dense_mm", - "reduce_sum", - "scatter", -] \ No newline at end of file +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch29-cxx11-cu128-x86_64-linux/mra/__pycache__/__init__.cpython-313.pyc b/build/torch29-cxx11-cu128-x86_64-linux/mra/__pycache__/__init__.cpython-313.pyc deleted file mode 100644 index b7d840c0ab9fc6632bf63e74b566df57f0ccabd2..0000000000000000000000000000000000000000 Binary files a/build/torch29-cxx11-cu128-x86_64-linux/mra/__pycache__/__init__.cpython-313.pyc and /dev/null differ diff --git a/build/torch29-cxx11-cu128-x86_64-linux/mra/__pycache__/_ops.cpython-313.pyc b/build/torch29-cxx11-cu128-x86_64-linux/mra/__pycache__/_ops.cpython-313.pyc deleted file mode 100644 index 210191864148898f7a12046120c13b6570c29e1e..0000000000000000000000000000000000000000 Binary files a/build/torch29-cxx11-cu128-x86_64-linux/mra/__pycache__/_ops.cpython-313.pyc and /dev/null differ diff --git a/build/torch29-cxx11-cu128-x86_64-linux/mra/_mra_9e0f4db.abi3.so b/build/torch29-cxx11-cu128-x86_64-linux/mra/_mra_9e0f4db.abi3.so deleted file mode 100644 index 6e0590235753d7a40964cefda9517fcd9d5f82be..0000000000000000000000000000000000000000 --- a/build/torch29-cxx11-cu128-x86_64-linux/mra/_mra_9e0f4db.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:715cc6a4c8663da81c7a0f95c83dba66afeadf5053e1994387a485c5300f1cb4 -size 2606920 diff --git a/build/torch29-cxx11-cu128-x86_64-linux/mra/_ops.py b/build/torch29-cxx11-cu128-x86_64-linux/mra/_ops.py deleted file mode 100644 index fd6050d31c8fe3317a842e237acda7577b15f1e9..0000000000000000000000000000000000000000 --- a/build/torch29-cxx11-cu128-x86_64-linux/mra/_ops.py +++ /dev/null @@ -1,9 +0,0 @@ -import torch -from . import _mra_9e0f4db -ops = torch.ops._mra_9e0f4db - -def add_op_namespace_prefix(op_name: str): - """ - Prefix op by namespace. - """ - return f"_mra_9e0f4db::{op_name}" \ No newline at end of file diff --git a/build/torch29-cxx11-cu130-x86_64-linux/__init__.py b/build/torch29-cxx11-cu130-x86_64-linux/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..86daaf874c808b8b828b43b4ee8a6b292323d336 --- /dev/null +++ b/build/torch29-cxx11-cu130-x86_64-linux/__init__.py @@ -0,0 +1,25 @@ +from ._ops import ops +import torch + +def index_max(index_vals: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): + return ops.index_max(index_vals, indices, A_num_block, B_num_block) + +def mm_to_sparse(dense_A: torch.Tensor, dense_B: torch.Tensor, indices: torch.Tensor): + return ops.mm_to_sparse(dense_A, dense_B, indices) + +def sparse_dense_mm(sparse_A: torch.Tensor, indices: torch.Tensor, dense_B: torch.Tensor, A_num_block: int): + return ops.sparse_dense_mm(sparse_A, indices, dense_B, A_num_block) + +def reduce_sum(sparse_A: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): + return ops.reduce_sum(sparse_A, indices, A_num_block, B_num_block) + +def scatter(dense_A: torch.Tensor, indices: torch.Tensor, B_num_block: int): + return ops.scatter(dense_A, indices, B_num_block) + +__all__ = [ + "index_max", + "mm_to_sparse", + "sparse_dense_mm", + "reduce_sum", + "scatter", +] \ No newline at end of file diff --git a/build/torch29-cxx11-cu130-x86_64-linux/_mra_b91b835.abi3.so b/build/torch29-cxx11-cu130-x86_64-linux/_mra_b91b835.abi3.so new file mode 100644 index 0000000000000000000000000000000000000000..640dcd175ab4466bfab525227115b127e28a5a0f --- /dev/null +++ b/build/torch29-cxx11-cu130-x86_64-linux/_mra_b91b835.abi3.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:95a3d441fa857456fbadde43ecf651976f4aa76f1e886e2327fe794e6e214897 +size 2640024 diff --git a/build/torch29-cxx11-cu130-x86_64-linux/_ops.py b/build/torch29-cxx11-cu130-x86_64-linux/_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..3fa96943fdd89f679c76d57eee7f67d9971b84f2 --- /dev/null +++ b/build/torch29-cxx11-cu130-x86_64-linux/_ops.py @@ -0,0 +1,9 @@ +import torch +from . import _mra_b91b835 +ops = torch.ops._mra_b91b835 + +def add_op_namespace_prefix(op_name: str): + """ + Prefix op by namespace. + """ + return f"_mra_b91b835::{op_name}" \ No newline at end of file diff --git a/build/torch29-cxx11-cu130-x86_64-linux/metadata.json b/build/torch29-cxx11-cu130-x86_64-linux/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..76bafa5f33b6818aa6bb4cab04be811b87519b44 --- /dev/null +++ b/build/torch29-cxx11-cu130-x86_64-linux/metadata.json @@ -0,0 +1 @@ +{"python-depends":[]} \ No newline at end of file diff --git a/build/torch29-cxx11-cu130-x86_64-linux/mra/__init__.py b/build/torch29-cxx11-cu130-x86_64-linux/mra/__init__.py index 86daaf874c808b8b828b43b4ee8a6b292323d336..03dbc1afe1cf156661a2b1b22003cd5f599a0309 100644 --- a/build/torch29-cxx11-cu130-x86_64-linux/mra/__init__.py +++ b/build/torch29-cxx11-cu130-x86_64-linux/mra/__init__.py @@ -1,25 +1,26 @@ -from ._ops import ops -import torch +import ctypes +import sys -def index_max(index_vals: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): - return ops.index_max(index_vals, indices, A_num_block, B_num_block) +import importlib +from pathlib import Path +from types import ModuleType -def mm_to_sparse(dense_A: torch.Tensor, dense_B: torch.Tensor, indices: torch.Tensor): - return ops.mm_to_sparse(dense_A, dense_B, indices) +def _import_from_path(file_path: Path) -> ModuleType: + # We cannot use the module name as-is, after adding it to `sys.modules`, + # it would also be used for other imports. So, we make a module name that + # depends on the path for it to be unique using the hex-encoded hash of + # the path. + path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value) + module_name = path_hash + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec is None: + raise ImportError(f"Cannot load spec for {module_name} from {file_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Cannot load module {module_name} from spec") + sys.modules[module_name] = module + spec.loader.exec_module(module) # type: ignore + return module -def sparse_dense_mm(sparse_A: torch.Tensor, indices: torch.Tensor, dense_B: torch.Tensor, A_num_block: int): - return ops.sparse_dense_mm(sparse_A, indices, dense_B, A_num_block) -def reduce_sum(sparse_A: torch.Tensor, indices: torch.Tensor, A_num_block: int, B_num_block: int): - return ops.reduce_sum(sparse_A, indices, A_num_block, B_num_block) - -def scatter(dense_A: torch.Tensor, indices: torch.Tensor, B_num_block: int): - return ops.scatter(dense_A, indices, B_num_block) - -__all__ = [ - "index_max", - "mm_to_sparse", - "sparse_dense_mm", - "reduce_sum", - "scatter", -] \ No newline at end of file +globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py"))) diff --git a/build/torch29-cxx11-cu130-x86_64-linux/mra/__pycache__/__init__.cpython-313.pyc b/build/torch29-cxx11-cu130-x86_64-linux/mra/__pycache__/__init__.cpython-313.pyc deleted file mode 100644 index ea3f5f8ed49baece5ecd2071ca41c9c52d460f1c..0000000000000000000000000000000000000000 Binary files a/build/torch29-cxx11-cu130-x86_64-linux/mra/__pycache__/__init__.cpython-313.pyc and /dev/null differ diff --git a/build/torch29-cxx11-cu130-x86_64-linux/mra/__pycache__/_ops.cpython-313.pyc b/build/torch29-cxx11-cu130-x86_64-linux/mra/__pycache__/_ops.cpython-313.pyc deleted file mode 100644 index fe93d14289dde38de8104edb7c1e46ab24b88fcf..0000000000000000000000000000000000000000 Binary files a/build/torch29-cxx11-cu130-x86_64-linux/mra/__pycache__/_ops.cpython-313.pyc and /dev/null differ diff --git a/build/torch29-cxx11-cu130-x86_64-linux/mra/_mra_9e0f4db.abi3.so b/build/torch29-cxx11-cu130-x86_64-linux/mra/_mra_9e0f4db.abi3.so deleted file mode 100644 index 62fcf6495cf7722a55ab67791fc11e9ea7985c01..0000000000000000000000000000000000000000 --- a/build/torch29-cxx11-cu130-x86_64-linux/mra/_mra_9e0f4db.abi3.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f8335d5b18ef7d1ab9a8be1b54c45c54a922d341c65139896bfb1adb4fc3db46 -size 2569680 diff --git a/build/torch29-cxx11-cu130-x86_64-linux/mra/_ops.py b/build/torch29-cxx11-cu130-x86_64-linux/mra/_ops.py deleted file mode 100644 index fd6050d31c8fe3317a842e237acda7577b15f1e9..0000000000000000000000000000000000000000 --- a/build/torch29-cxx11-cu130-x86_64-linux/mra/_ops.py +++ /dev/null @@ -1,9 +0,0 @@ -import torch -from . import _mra_9e0f4db -ops = torch.ops._mra_9e0f4db - -def add_op_namespace_prefix(op_name: str): - """ - Prefix op by namespace. - """ - return f"_mra_9e0f4db::{op_name}" \ No newline at end of file