drbh commited on
Commit
a602080
·
unverified ·
0 Parent(s):

Migrated from kernels-community/yoso

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +107 -0
  2. README.md +15 -0
  3. benchmarks/benchmark.py +239 -0
  4. build.toml +32 -0
  5. build/torch210-cu128-x86_64-windows/__init__.py +11 -0
  6. build/torch210-cu128-x86_64-windows/_ops.py +9 -0
  7. build/torch210-cu128-x86_64-windows/_yoso_cuda_400d834.pyd +3 -0
  8. build/torch210-cu128-x86_64-windows/metadata.json +14 -0
  9. build/torch210-cu128-x86_64-windows/yoso/__init__.py +26 -0
  10. build/torch210-cxx11-cu126-aarch64-linux/__init__.py +11 -0
  11. build/torch210-cxx11-cu126-aarch64-linux/_ops.py +9 -0
  12. build/torch210-cxx11-cu126-aarch64-linux/_yoso_cuda_4218a9a.abi3.so +3 -0
  13. build/torch210-cxx11-cu126-aarch64-linux/metadata.json +12 -0
  14. build/torch210-cxx11-cu126-aarch64-linux/yoso/__init__.py +26 -0
  15. build/torch210-cxx11-cu126-x86_64-linux/__init__.py +11 -0
  16. build/torch210-cxx11-cu126-x86_64-linux/_ops.py +9 -0
  17. build/torch210-cxx11-cu126-x86_64-linux/_yoso_cuda_4218a9a.abi3.so +3 -0
  18. build/torch210-cxx11-cu126-x86_64-linux/metadata.json +12 -0
  19. build/torch210-cxx11-cu126-x86_64-linux/yoso/__init__.py +26 -0
  20. build/torch210-cxx11-cu128-aarch64-linux/__init__.py +11 -0
  21. build/torch210-cxx11-cu128-aarch64-linux/_ops.py +9 -0
  22. build/torch210-cxx11-cu128-aarch64-linux/_yoso_cuda_4218a9a.abi3.so +3 -0
  23. build/torch210-cxx11-cu128-aarch64-linux/metadata.json +14 -0
  24. build/torch210-cxx11-cu128-aarch64-linux/yoso/__init__.py +26 -0
  25. build/torch210-cxx11-cu128-x86_64-linux/__init__.py +11 -0
  26. build/torch210-cxx11-cu128-x86_64-linux/_ops.py +9 -0
  27. build/torch210-cxx11-cu128-x86_64-linux/_yoso_cuda_4218a9a.abi3.so +3 -0
  28. build/torch210-cxx11-cu128-x86_64-linux/metadata.json +14 -0
  29. build/torch210-cxx11-cu128-x86_64-linux/yoso/__init__.py +26 -0
  30. build/torch210-cxx11-cu130-aarch64-linux/__init__.py +11 -0
  31. build/torch210-cxx11-cu130-aarch64-linux/_ops.py +9 -0
  32. build/torch210-cxx11-cu130-aarch64-linux/_yoso_cuda_4218a9a.abi3.so +3 -0
  33. build/torch210-cxx11-cu130-aarch64-linux/metadata.json +14 -0
  34. build/torch210-cxx11-cu130-aarch64-linux/yoso/__init__.py +26 -0
  35. build/torch210-cxx11-cu130-x86_64-linux/__init__.py +11 -0
  36. build/torch210-cxx11-cu130-x86_64-linux/_ops.py +9 -0
  37. build/torch210-cxx11-cu130-x86_64-linux/_yoso_cuda_4218a9a.abi3.so +3 -0
  38. build/torch210-cxx11-cu130-x86_64-linux/metadata.json +14 -0
  39. build/torch210-cxx11-cu130-x86_64-linux/yoso/__init__.py +26 -0
  40. build/torch211-cxx11-cu126-aarch64-linux/__init__.py +11 -0
  41. build/torch211-cxx11-cu126-aarch64-linux/_ops.py +9 -0
  42. build/torch211-cxx11-cu126-aarch64-linux/_yoso_cuda_4218a9a.abi3.so +3 -0
  43. build/torch211-cxx11-cu126-aarch64-linux/metadata.json +12 -0
  44. build/torch211-cxx11-cu126-aarch64-linux/yoso/__init__.py +26 -0
  45. build/torch211-cxx11-cu126-x86_64-linux/__init__.py +11 -0
  46. build/torch211-cxx11-cu126-x86_64-linux/_ops.py +9 -0
  47. build/torch211-cxx11-cu126-x86_64-linux/_yoso_cuda_4218a9a.abi3.so +3 -0
  48. build/torch211-cxx11-cu126-x86_64-linux/metadata.json +12 -0
  49. build/torch211-cxx11-cu126-x86_64-linux/yoso/__init__.py +26 -0
  50. build/torch211-cxx11-cu128-aarch64-linux/__init__.py +11 -0
.gitattributes ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ build/torch27-cxx11-cu118-x86_64-linux/yoso/_yoso_3173620_dirty.abi3.so filter=lfs diff=lfs merge=lfs -text
37
+ build/torch27-cxx11-cu126-x86_64-linux/yoso/_yoso_3173620_dirty.abi3.so filter=lfs diff=lfs merge=lfs -text
38
+ build/torch27-cxx11-cu128-x86_64-linux/yoso/_yoso_3173620_dirty.abi3.so filter=lfs diff=lfs merge=lfs -text
39
+ build/torch28-cxx11-cu126-x86_64-linux/yoso/_yoso_3173620_dirty.abi3.so filter=lfs diff=lfs merge=lfs -text
40
+ build/torch28-cxx11-cu128-x86_64-linux/yoso/_yoso_3173620_dirty.abi3.so filter=lfs diff=lfs merge=lfs -text
41
+ build/torch28-cxx11-cu129-x86_64-linux/yoso/_yoso_3173620_dirty.abi3.so filter=lfs diff=lfs merge=lfs -text
42
+ build/torch29-cxx11-cu126-x86_64-linux/yoso/_yoso_3173620_dirty.abi3.so filter=lfs diff=lfs merge=lfs -text
43
+ build/torch29-cxx11-cu128-x86_64-linux/yoso/_yoso_3173620_dirty.abi3.so filter=lfs diff=lfs merge=lfs -text
44
+ build/torch29-cxx11-cu130-x86_64-linux/yoso/_yoso_3173620_dirty.abi3.so filter=lfs diff=lfs merge=lfs -text
45
+ build/torch210-cxx11-cu126-x86_64-linux/_yoso_ea085fb.abi3.so filter=lfs diff=lfs merge=lfs -text
46
+ build/torch210-cxx11-cu128-x86_64-linux/_yoso_ea085fb.abi3.so filter=lfs diff=lfs merge=lfs -text
47
+ build/torch210-cxx11-cu130-x86_64-linux/_yoso_ea085fb.abi3.so filter=lfs diff=lfs merge=lfs -text
48
+ build/torch28-cxx11-cu126-x86_64-linux/_yoso_ea085fb.abi3.so filter=lfs diff=lfs merge=lfs -text
49
+ build/torch28-cxx11-cu128-x86_64-linux/_yoso_ea085fb.abi3.so filter=lfs diff=lfs merge=lfs -text
50
+ build/torch28-cxx11-cu129-x86_64-linux/_yoso_ea085fb.abi3.so filter=lfs diff=lfs merge=lfs -text
51
+ build/torch29-cxx11-cu126-x86_64-linux/_yoso_ea085fb.abi3.so filter=lfs diff=lfs merge=lfs -text
52
+ build/torch29-cxx11-cu128-x86_64-linux/_yoso_ea085fb.abi3.so filter=lfs diff=lfs merge=lfs -text
53
+ build/torch29-cxx11-cu130-x86_64-linux/_yoso_ea085fb.abi3.so filter=lfs diff=lfs merge=lfs -text
54
+ build/torch210-cxx11-cu126-x86_64-linux/_yoso_fc1f972.abi3.so filter=lfs diff=lfs merge=lfs -text
55
+ build/torch210-cxx11-cu128-x86_64-linux/_yoso_fc1f972.abi3.so filter=lfs diff=lfs merge=lfs -text
56
+ build/torch210-cxx11-cu130-x86_64-linux/_yoso_fc1f972.abi3.so filter=lfs diff=lfs merge=lfs -text
57
+ build/torch28-cxx11-cu126-x86_64-linux/_yoso_fc1f972.abi3.so filter=lfs diff=lfs merge=lfs -text
58
+ build/torch28-cxx11-cu128-x86_64-linux/_yoso_fc1f972.abi3.so filter=lfs diff=lfs merge=lfs -text
59
+ build/torch28-cxx11-cu129-x86_64-linux/_yoso_fc1f972.abi3.so filter=lfs diff=lfs merge=lfs -text
60
+ build/torch29-cxx11-cu126-x86_64-linux/_yoso_fc1f972.abi3.so filter=lfs diff=lfs merge=lfs -text
61
+ build/torch29-cxx11-cu128-x86_64-linux/_yoso_fc1f972.abi3.so filter=lfs diff=lfs merge=lfs -text
62
+ build/torch29-cxx11-cu130-x86_64-linux/_yoso_fc1f972.abi3.so filter=lfs diff=lfs merge=lfs -text
63
+ build/torch210-cxx11-cu126-x86_64-linux/_yoso_c11288f.abi3.so filter=lfs diff=lfs merge=lfs -text
64
+ build/torch210-cxx11-cu128-x86_64-linux/_yoso_c11288f.abi3.so filter=lfs diff=lfs merge=lfs -text
65
+ build/torch210-cxx11-cu130-x86_64-linux/_yoso_c11288f.abi3.so filter=lfs diff=lfs merge=lfs -text
66
+ build/torch28-cxx11-cu126-x86_64-linux/_yoso_c11288f.abi3.so filter=lfs diff=lfs merge=lfs -text
67
+ build/torch28-cxx11-cu128-x86_64-linux/_yoso_c11288f.abi3.so filter=lfs diff=lfs merge=lfs -text
68
+ build/torch28-cxx11-cu129-x86_64-linux/_yoso_c11288f.abi3.so filter=lfs diff=lfs merge=lfs -text
69
+ build/torch29-cxx11-cu126-x86_64-linux/_yoso_c11288f.abi3.so filter=lfs diff=lfs merge=lfs -text
70
+ build/torch29-cxx11-cu128-x86_64-linux/_yoso_c11288f.abi3.so filter=lfs diff=lfs merge=lfs -text
71
+ build/torch29-cxx11-cu130-x86_64-linux/_yoso_c11288f.abi3.so filter=lfs diff=lfs merge=lfs -text
72
+ build/torch210-cxx11-cu126-x86_64-linux/_yoso_dd38bd3.abi3.so filter=lfs diff=lfs merge=lfs -text
73
+ build/torch210-cxx11-cu128-x86_64-linux/_yoso_dd38bd3.abi3.so filter=lfs diff=lfs merge=lfs -text
74
+ build/torch210-cxx11-cu130-x86_64-linux/_yoso_dd38bd3.abi3.so filter=lfs diff=lfs merge=lfs -text
75
+ build/torch28-cxx11-cu126-x86_64-linux/_yoso_dd38bd3.abi3.so filter=lfs diff=lfs merge=lfs -text
76
+ build/torch28-cxx11-cu128-x86_64-linux/_yoso_dd38bd3.abi3.so filter=lfs diff=lfs merge=lfs -text
77
+ build/torch28-cxx11-cu129-x86_64-linux/_yoso_dd38bd3.abi3.so filter=lfs diff=lfs merge=lfs -text
78
+ build/torch29-cxx11-cu126-x86_64-linux/_yoso_dd38bd3.abi3.so filter=lfs diff=lfs merge=lfs -text
79
+ build/torch29-cxx11-cu128-x86_64-linux/_yoso_dd38bd3.abi3.so filter=lfs diff=lfs merge=lfs -text
80
+ build/torch29-cxx11-cu130-x86_64-linux/_yoso_dd38bd3.abi3.so filter=lfs diff=lfs merge=lfs -text
81
+ build/torch210-cxx11-cu126-x86_64-linux/_yoso_cuda_c42e4a3.abi3.so filter=lfs diff=lfs merge=lfs -text
82
+ build/torch210-cxx11-cu128-x86_64-linux/_yoso_cuda_c42e4a3.abi3.so filter=lfs diff=lfs merge=lfs -text
83
+ build/torch210-cxx11-cu130-x86_64-linux/_yoso_cuda_c42e4a3.abi3.so filter=lfs diff=lfs merge=lfs -text
84
+ build/torch29-cxx11-cu126-x86_64-linux/_yoso_cuda_c42e4a3.abi3.so filter=lfs diff=lfs merge=lfs -text
85
+ build/torch29-cxx11-cu128-x86_64-linux/_yoso_cuda_c42e4a3.abi3.so filter=lfs diff=lfs merge=lfs -text
86
+ build/torch29-cxx11-cu130-x86_64-linux/_yoso_cuda_c42e4a3.abi3.so filter=lfs diff=lfs merge=lfs -text
87
+ build/torch210-cxx11-cu126-aarch64-linux/_yoso_cuda_c42e4a3.abi3.so filter=lfs diff=lfs merge=lfs -text
88
+ build/torch210-cxx11-cu128-aarch64-linux/_yoso_cuda_c42e4a3.abi3.so filter=lfs diff=lfs merge=lfs -text
89
+ build/torch210-cxx11-cu130-aarch64-linux/_yoso_cuda_c42e4a3.abi3.so filter=lfs diff=lfs merge=lfs -text
90
+ build/torch29-cxx11-cu126-aarch64-linux/_yoso_cuda_c42e4a3.abi3.so filter=lfs diff=lfs merge=lfs -text
91
+ build/torch29-cxx11-cu128-aarch64-linux/_yoso_cuda_c42e4a3.abi3.so filter=lfs diff=lfs merge=lfs -text
92
+ build/torch29-cxx11-cu130-aarch64-linux/_yoso_cuda_c42e4a3.abi3.so filter=lfs diff=lfs merge=lfs -text
93
+ build/torch210-cu128-x86_64-windows/_yoso_cuda_400d834.pyd filter=lfs diff=lfs merge=lfs -text
94
+ build/torch210-cxx11-cu126-aarch64-linux/_yoso_cuda_4218a9a.abi3.so filter=lfs diff=lfs merge=lfs -text
95
+ build/torch210-cxx11-cu128-aarch64-linux/_yoso_cuda_4218a9a.abi3.so filter=lfs diff=lfs merge=lfs -text
96
+ build/torch210-cxx11-cu130-aarch64-linux/_yoso_cuda_4218a9a.abi3.so filter=lfs diff=lfs merge=lfs -text
97
+ build/torch211-cxx11-cu126-aarch64-linux/_yoso_cuda_4218a9a.abi3.so filter=lfs diff=lfs merge=lfs -text
98
+ build/torch211-cxx11-cu128-aarch64-linux/_yoso_cuda_4218a9a.abi3.so filter=lfs diff=lfs merge=lfs -text
99
+ build/torch211-cxx11-cu130-aarch64-linux/_yoso_cuda_4218a9a.abi3.so filter=lfs diff=lfs merge=lfs -text
100
+ build/torch29-cxx11-cu129-aarch64-linux/_yoso_cuda_4218a9a.abi3.so filter=lfs diff=lfs merge=lfs -text
101
+ build/torch210-cxx11-cu126-x86_64-linux/_yoso_cuda_4218a9a.abi3.so filter=lfs diff=lfs merge=lfs -text
102
+ build/torch210-cxx11-cu128-x86_64-linux/_yoso_cuda_4218a9a.abi3.so filter=lfs diff=lfs merge=lfs -text
103
+ build/torch210-cxx11-cu130-x86_64-linux/_yoso_cuda_4218a9a.abi3.so filter=lfs diff=lfs merge=lfs -text
104
+ build/torch211-cxx11-cu126-x86_64-linux/_yoso_cuda_4218a9a.abi3.so filter=lfs diff=lfs merge=lfs -text
105
+ build/torch211-cxx11-cu128-x86_64-linux/_yoso_cuda_4218a9a.abi3.so filter=lfs diff=lfs merge=lfs -text
106
+ build/torch211-cxx11-cu130-x86_64-linux/_yoso_cuda_4218a9a.abi3.so filter=lfs diff=lfs merge=lfs -text
107
+ build/torch29-cxx11-cu129-x86_64-linux/_yoso_cuda_4218a9a.abi3.so filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - kernels
4
+ - cuda
5
+ ---
6
+ ### Performance
7
+
8
+ <img class="dark:hidden border border-gray-200 dark:border-gray-700 rounded-lg" src="media/benches_light_animation.svg" />
9
+ <img class="hidden dark:block border border-gray-200 dark:border-gray-700 rounded-lg" src="media/benches_dark_animation.svg" />
10
+
11
+ <img class="dark:hidden border border-gray-200 dark:border-gray-700 rounded-lg" src="media/benches_light_latency.svg" />
12
+ <img class="hidden dark:block border border-gray-200 dark:border-gray-700 rounded-lg" src="media/benches_dark_latency.svg" />
13
+
14
+ <img class="dark:hidden border border-gray-200 dark:border-gray-700 rounded-lg" src="media/benches_light_throughput.svg" />
15
+ <img class="hidden dark:block border border-gray-200 dark:border-gray-700 rounded-lg" src="media/benches_dark_throughput.svg" />
benchmarks/benchmark.py ADDED
@@ -0,0 +1,239 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+
3
+ from kernels.benchmark import Benchmark
4
+
5
+
6
+ def lsh_weighted_cumulation_reference(
7
+ query_mask: torch.Tensor,
8
+ query_hash_code: torch.Tensor,
9
+ query_weight: torch.Tensor,
10
+ key_mask: torch.Tensor,
11
+ key_hash_code: torch.Tensor,
12
+ key_weight: torch.Tensor,
13
+ value: torch.Tensor,
14
+ hashtable_capacity: int,
15
+ ) -> torch.Tensor:
16
+ batch_size, num_query, num_hash_f = query_hash_code.shape
17
+ _, num_key, value_dim = value.shape
18
+ weight_dim = query_weight.shape[2]
19
+ device = value.device
20
+ dtype = value.dtype
21
+
22
+ output = torch.zeros(batch_size, num_query, value_dim, device=device, dtype=dtype)
23
+
24
+ for b in range(batch_size):
25
+ for weight_idx in range(weight_dim):
26
+ # Build hashtables for all hash functions
27
+ hashtables = torch.zeros(
28
+ num_hash_f, hashtable_capacity, value_dim, device=device, dtype=dtype
29
+ )
30
+
31
+ k_mask = key_mask[b, :].float() # [num_key]
32
+ k_weight_val = key_weight[b, :, weight_idx] # [num_key]
33
+
34
+ for h in range(num_hash_f):
35
+ k_hash = key_hash_code[b, :, h].long() # [num_key]
36
+ # Weighted values: [num_key, value_dim]
37
+ weighted_values = (
38
+ k_mask.unsqueeze(-1) * k_weight_val.unsqueeze(-1) * value[b]
39
+ )
40
+ k_hash_expanded = k_hash.unsqueeze(-1).expand(-1, value_dim)
41
+ hashtables[h].scatter_add_(0, k_hash_expanded, weighted_values)
42
+
43
+ # Query: sum over all hash functions
44
+ q_mask = query_mask[b, :].float() # [num_query]
45
+ q_weight_val = query_weight[b, :, weight_idx] # [num_query]
46
+
47
+ sum_val = torch.zeros(num_query, value_dim, device=device, dtype=dtype)
48
+ for h in range(num_hash_f):
49
+ q_hash = query_hash_code[b, :, h].long() # [num_query]
50
+ gathered = hashtables[h][q_hash] # [num_query, value_dim]
51
+ sum_val += gathered
52
+
53
+ # Apply query weight and divide by num_hash_f
54
+ output[b] += (
55
+ q_mask.unsqueeze(-1) * q_weight_val.unsqueeze(-1) * sum_val / num_hash_f
56
+ )
57
+
58
+ return output
59
+
60
+
61
+ class YosoBenchmark(Benchmark):
62
+ seed: int = 42
63
+
64
+ def setup(self):
65
+ batch_size = 2
66
+ num_query = 128
67
+ num_key = 128
68
+ dim = 64
69
+ self.num_hash_f = 32
70
+ self.hash_code_len = 9
71
+ self.weight_dim = self.num_hash_f
72
+ self.value_dim = dim
73
+ self.hashtable_capacity = 1 << self.hash_code_len
74
+
75
+ self.query_mask = torch.ones(
76
+ batch_size, num_query, device=self.device, dtype=torch.int32
77
+ )
78
+ self.query_vector = torch.randn(
79
+ batch_size, num_query, dim, device=self.device, dtype=torch.float32
80
+ )
81
+ self.key_mask = torch.ones(
82
+ batch_size, num_key, device=self.device, dtype=torch.int32
83
+ )
84
+ self.key_vector = torch.randn(
85
+ batch_size, num_key, dim, device=self.device, dtype=torch.float32
86
+ )
87
+ self.value = torch.randn(
88
+ batch_size, num_key, self.value_dim, device=self.device, dtype=torch.float32
89
+ )
90
+ self.query_weight = torch.randn(
91
+ batch_size,
92
+ num_query,
93
+ self.weight_dim,
94
+ device=self.device,
95
+ dtype=torch.float32,
96
+ )
97
+ self.key_weight = torch.randn(
98
+ batch_size,
99
+ num_key,
100
+ self.weight_dim,
101
+ device=self.device,
102
+ dtype=torch.float32,
103
+ )
104
+
105
+ # Pre-compute hash codes for cumulation benchmarks
106
+ hash_result = self.kernel.fast_hash(
107
+ self.query_mask,
108
+ self.query_vector,
109
+ self.key_mask,
110
+ self.key_vector,
111
+ self.num_hash_f,
112
+ self.hash_code_len,
113
+ True,
114
+ 1,
115
+ )
116
+ self.query_hash_code = hash_result[0]
117
+ self.key_hash_code = hash_result[1]
118
+
119
+ self.out = torch.empty(
120
+ batch_size,
121
+ num_query,
122
+ self.value_dim,
123
+ device=self.device,
124
+ dtype=torch.float32,
125
+ )
126
+
127
+ def benchmark_base(self):
128
+ self.out = self.kernel.lsh_weighted_cumulation(
129
+ self.query_mask,
130
+ self.query_hash_code,
131
+ self.query_weight,
132
+ self.key_mask,
133
+ self.key_hash_code,
134
+ self.key_weight,
135
+ self.value,
136
+ self.hashtable_capacity,
137
+ True,
138
+ 1,
139
+ )
140
+
141
+ def verify_base(self) -> torch.Tensor:
142
+ return lsh_weighted_cumulation_reference(
143
+ self.query_mask,
144
+ self.query_hash_code,
145
+ self.query_weight,
146
+ self.key_mask,
147
+ self.key_hash_code,
148
+ self.key_weight,
149
+ self.value,
150
+ self.hashtable_capacity,
151
+ )
152
+
153
+ def setup_large(self):
154
+ batch_size = 4
155
+ num_query = 512
156
+ num_key = 512
157
+ dim = 128
158
+ self.num_hash_f = 32
159
+ self.hash_code_len = 9
160
+ self.weight_dim = self.num_hash_f
161
+ self.value_dim = dim
162
+ self.hashtable_capacity = 1 << self.hash_code_len
163
+
164
+ self.query_mask = torch.ones(
165
+ batch_size, num_query, device=self.device, dtype=torch.int32
166
+ )
167
+ self.query_vector = torch.randn(
168
+ batch_size, num_query, dim, device=self.device, dtype=torch.float32
169
+ )
170
+ self.key_mask = torch.ones(
171
+ batch_size, num_key, device=self.device, dtype=torch.int32
172
+ )
173
+ self.key_vector = torch.randn(
174
+ batch_size, num_key, dim, device=self.device, dtype=torch.float32
175
+ )
176
+ self.value = torch.randn(
177
+ batch_size, num_key, self.value_dim, device=self.device, dtype=torch.float32
178
+ )
179
+ self.query_weight = torch.randn(
180
+ batch_size,
181
+ num_query,
182
+ self.weight_dim,
183
+ device=self.device,
184
+ dtype=torch.float32,
185
+ )
186
+ self.key_weight = torch.randn(
187
+ batch_size,
188
+ num_key,
189
+ self.weight_dim,
190
+ device=self.device,
191
+ dtype=torch.float32,
192
+ )
193
+
194
+ hash_result = self.kernel.fast_hash(
195
+ self.query_mask,
196
+ self.query_vector,
197
+ self.key_mask,
198
+ self.key_vector,
199
+ self.num_hash_f,
200
+ self.hash_code_len,
201
+ True,
202
+ 1,
203
+ )
204
+ self.query_hash_code = hash_result[0]
205
+ self.key_hash_code = hash_result[1]
206
+
207
+ self.out = torch.empty(
208
+ batch_size,
209
+ num_query,
210
+ self.value_dim,
211
+ device=self.device,
212
+ dtype=torch.float32,
213
+ )
214
+
215
+ def benchmark_large(self):
216
+ self.out = self.kernel.lsh_weighted_cumulation(
217
+ self.query_mask,
218
+ self.query_hash_code,
219
+ self.query_weight,
220
+ self.key_mask,
221
+ self.key_hash_code,
222
+ self.key_weight,
223
+ self.value,
224
+ self.hashtable_capacity,
225
+ True,
226
+ 1,
227
+ )
228
+
229
+ def verify_large(self) -> torch.Tensor:
230
+ return lsh_weighted_cumulation_reference(
231
+ self.query_mask,
232
+ self.query_hash_code,
233
+ self.query_weight,
234
+ self.key_mask,
235
+ self.key_hash_code,
236
+ self.key_weight,
237
+ self.value,
238
+ self.hashtable_capacity,
239
+ )
build.toml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [general]
2
+ name = "yoso"
3
+ universal = false
4
+
5
+ [torch]
6
+ src = [
7
+ "torch-ext/torch_binding.cpp",
8
+ "torch-ext/torch_binding.h",
9
+ ]
10
+
11
+ [kernel.yoso]
12
+ depends = ["torch"]
13
+ backend = "cuda"
14
+ cuda-capabilities = [
15
+ "8.0",
16
+ "8.9",
17
+ "9.0",
18
+ "10.0",
19
+ "12.0",
20
+ ]
21
+ include = ["."]
22
+ src = [
23
+ "yoso/fast_lsh_cumulation_cuda.cu",
24
+ "yoso/fast_lsh_cumulation_cuda.h",
25
+ "yoso/fast_lsh_cumulation_torch.cpp",
26
+ "yoso/fast_lsh_cumulation.h",
27
+ "yoso/fast_lsh_cumulation.cu",
28
+ "yoso/common_cuda.h",
29
+ "yoso/common.h",
30
+ "yoso/common_cuda_device.h",
31
+ ]
32
+
build/torch210-cu128-x86_64-windows/__init__.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from ._ops import ops
2
+
3
+ fast_hash = ops.fast_hash
4
+ lsh_cumulation = ops.lsh_cumulation
5
+ lsh_weighted_cumulation = ops.lsh_weighted_cumulation
6
+
7
+ __all__ = [
8
+ "fast_hash",
9
+ "lsh_cumulation",
10
+ "lsh_weighted_cumulation",
11
+ ]
build/torch210-cu128-x86_64-windows/_ops.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from . import _yoso_cuda_400d834
3
+ ops = torch.ops._yoso_cuda_400d834
4
+
5
+ def add_op_namespace_prefix(op_name: str):
6
+ """
7
+ Prefix op by namespace.
8
+ """
9
+ return f"_yoso_cuda_400d834::{op_name}"
build/torch210-cu128-x86_64-windows/_yoso_cuda_400d834.pyd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:698d4c7581229298f15ebcdcbf056ef8331d7e50fc3d510a3b1a9a6a9fdf22ca
3
+ size 1112576
build/torch210-cu128-x86_64-windows/metadata.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": 1,
3
+ "python-depends": [],
4
+ "backend": {
5
+ "type": "cuda",
6
+ "archs": [
7
+ "10.0",
8
+ "12.0",
9
+ "8.0",
10
+ "8.9",
11
+ "9.0"
12
+ ]
13
+ }
14
+ }
build/torch210-cu128-x86_64-windows/yoso/__init__.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
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/torch210-cxx11-cu126-aarch64-linux/__init__.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from ._ops import ops
2
+
3
+ fast_hash = ops.fast_hash
4
+ lsh_cumulation = ops.lsh_cumulation
5
+ lsh_weighted_cumulation = ops.lsh_weighted_cumulation
6
+
7
+ __all__ = [
8
+ "fast_hash",
9
+ "lsh_cumulation",
10
+ "lsh_weighted_cumulation",
11
+ ]
build/torch210-cxx11-cu126-aarch64-linux/_ops.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from . import _yoso_cuda_4218a9a
3
+ ops = torch.ops._yoso_cuda_4218a9a
4
+
5
+ def add_op_namespace_prefix(op_name: str):
6
+ """
7
+ Prefix op by namespace.
8
+ """
9
+ return f"_yoso_cuda_4218a9a::{op_name}"
build/torch210-cxx11-cu126-aarch64-linux/_yoso_cuda_4218a9a.abi3.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2bb09bdc0593bb01cea62105e034943212b28cee89082a44c7412adc87943215
3
+ size 2569064
build/torch210-cxx11-cu126-aarch64-linux/metadata.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": 1,
3
+ "python-depends": [],
4
+ "backend": {
5
+ "type": "cuda",
6
+ "archs": [
7
+ "8.0",
8
+ "8.9",
9
+ "9.0"
10
+ ]
11
+ }
12
+ }
build/torch210-cxx11-cu126-aarch64-linux/yoso/__init__.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/torch210-cxx11-cu126-x86_64-linux/__init__.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from ._ops import ops
2
+
3
+ fast_hash = ops.fast_hash
4
+ lsh_cumulation = ops.lsh_cumulation
5
+ lsh_weighted_cumulation = ops.lsh_weighted_cumulation
6
+
7
+ __all__ = [
8
+ "fast_hash",
9
+ "lsh_cumulation",
10
+ "lsh_weighted_cumulation",
11
+ ]
build/torch210-cxx11-cu126-x86_64-linux/_ops.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from . import _yoso_cuda_4218a9a
3
+ ops = torch.ops._yoso_cuda_4218a9a
4
+
5
+ def add_op_namespace_prefix(op_name: str):
6
+ """
7
+ Prefix op by namespace.
8
+ """
9
+ return f"_yoso_cuda_4218a9a::{op_name}"
build/torch210-cxx11-cu126-x86_64-linux/_yoso_cuda_4218a9a.abi3.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:02ce77a1a0e640f167c2542c3902706d15891b05c813b38d4435cf12088e4771
3
+ size 2498248
build/torch210-cxx11-cu126-x86_64-linux/metadata.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": 1,
3
+ "python-depends": [],
4
+ "backend": {
5
+ "type": "cuda",
6
+ "archs": [
7
+ "8.0",
8
+ "8.9",
9
+ "9.0"
10
+ ]
11
+ }
12
+ }
build/torch210-cxx11-cu126-x86_64-linux/yoso/__init__.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/torch210-cxx11-cu128-aarch64-linux/__init__.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from ._ops import ops
2
+
3
+ fast_hash = ops.fast_hash
4
+ lsh_cumulation = ops.lsh_cumulation
5
+ lsh_weighted_cumulation = ops.lsh_weighted_cumulation
6
+
7
+ __all__ = [
8
+ "fast_hash",
9
+ "lsh_cumulation",
10
+ "lsh_weighted_cumulation",
11
+ ]
build/torch210-cxx11-cu128-aarch64-linux/_ops.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from . import _yoso_cuda_4218a9a
3
+ ops = torch.ops._yoso_cuda_4218a9a
4
+
5
+ def add_op_namespace_prefix(op_name: str):
6
+ """
7
+ Prefix op by namespace.
8
+ """
9
+ return f"_yoso_cuda_4218a9a::{op_name}"
build/torch210-cxx11-cu128-aarch64-linux/_yoso_cuda_4218a9a.abi3.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:91b0d7b3accfb6b76ab9dfbe11942158cf8648fd3ad6f7915b15eb3dc2add36f
3
+ size 3159096
build/torch210-cxx11-cu128-aarch64-linux/metadata.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": 1,
3
+ "python-depends": [],
4
+ "backend": {
5
+ "type": "cuda",
6
+ "archs": [
7
+ "10.0",
8
+ "12.0",
9
+ "8.0",
10
+ "8.9",
11
+ "9.0"
12
+ ]
13
+ }
14
+ }
build/torch210-cxx11-cu128-aarch64-linux/yoso/__init__.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/torch210-cxx11-cu128-x86_64-linux/__init__.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from ._ops import ops
2
+
3
+ fast_hash = ops.fast_hash
4
+ lsh_cumulation = ops.lsh_cumulation
5
+ lsh_weighted_cumulation = ops.lsh_weighted_cumulation
6
+
7
+ __all__ = [
8
+ "fast_hash",
9
+ "lsh_cumulation",
10
+ "lsh_weighted_cumulation",
11
+ ]
build/torch210-cxx11-cu128-x86_64-linux/_ops.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from . import _yoso_cuda_4218a9a
3
+ ops = torch.ops._yoso_cuda_4218a9a
4
+
5
+ def add_op_namespace_prefix(op_name: str):
6
+ """
7
+ Prefix op by namespace.
8
+ """
9
+ return f"_yoso_cuda_4218a9a::{op_name}"
build/torch210-cxx11-cu128-x86_64-linux/_yoso_cuda_4218a9a.abi3.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:65e95d52be57053b7f09b0880484c5debf4e542ac257cb3683105305df39d839
3
+ size 3040824
build/torch210-cxx11-cu128-x86_64-linux/metadata.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": 1,
3
+ "python-depends": [],
4
+ "backend": {
5
+ "type": "cuda",
6
+ "archs": [
7
+ "10.0",
8
+ "12.0",
9
+ "8.0",
10
+ "8.9",
11
+ "9.0"
12
+ ]
13
+ }
14
+ }
build/torch210-cxx11-cu128-x86_64-linux/yoso/__init__.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/torch210-cxx11-cu130-aarch64-linux/__init__.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from ._ops import ops
2
+
3
+ fast_hash = ops.fast_hash
4
+ lsh_cumulation = ops.lsh_cumulation
5
+ lsh_weighted_cumulation = ops.lsh_weighted_cumulation
6
+
7
+ __all__ = [
8
+ "fast_hash",
9
+ "lsh_cumulation",
10
+ "lsh_weighted_cumulation",
11
+ ]
build/torch210-cxx11-cu130-aarch64-linux/_ops.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from . import _yoso_cuda_4218a9a
3
+ ops = torch.ops._yoso_cuda_4218a9a
4
+
5
+ def add_op_namespace_prefix(op_name: str):
6
+ """
7
+ Prefix op by namespace.
8
+ """
9
+ return f"_yoso_cuda_4218a9a::{op_name}"
build/torch210-cxx11-cu130-aarch64-linux/_yoso_cuda_4218a9a.abi3.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:18a1cbf153beac65c36a3fcf2fdb16d6c22e8e962ebb3e4b91e7c3a927c98315
3
+ size 3230640
build/torch210-cxx11-cu130-aarch64-linux/metadata.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": 1,
3
+ "python-depends": [],
4
+ "backend": {
5
+ "type": "cuda",
6
+ "archs": [
7
+ "10.0",
8
+ "12.0",
9
+ "8.0",
10
+ "8.9",
11
+ "9.0"
12
+ ]
13
+ }
14
+ }
build/torch210-cxx11-cu130-aarch64-linux/yoso/__init__.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/torch210-cxx11-cu130-x86_64-linux/__init__.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from ._ops import ops
2
+
3
+ fast_hash = ops.fast_hash
4
+ lsh_cumulation = ops.lsh_cumulation
5
+ lsh_weighted_cumulation = ops.lsh_weighted_cumulation
6
+
7
+ __all__ = [
8
+ "fast_hash",
9
+ "lsh_cumulation",
10
+ "lsh_weighted_cumulation",
11
+ ]
build/torch210-cxx11-cu130-x86_64-linux/_ops.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from . import _yoso_cuda_4218a9a
3
+ ops = torch.ops._yoso_cuda_4218a9a
4
+
5
+ def add_op_namespace_prefix(op_name: str):
6
+ """
7
+ Prefix op by namespace.
8
+ """
9
+ return f"_yoso_cuda_4218a9a::{op_name}"
build/torch210-cxx11-cu130-x86_64-linux/_yoso_cuda_4218a9a.abi3.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7a4d07f13664724f51505edd45c4656f658f5d3ed8240f70d896214a8f15cac1
3
+ size 3102168
build/torch210-cxx11-cu130-x86_64-linux/metadata.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": 1,
3
+ "python-depends": [],
4
+ "backend": {
5
+ "type": "cuda",
6
+ "archs": [
7
+ "10.0",
8
+ "12.0",
9
+ "8.0",
10
+ "8.9",
11
+ "9.0"
12
+ ]
13
+ }
14
+ }
build/torch210-cxx11-cu130-x86_64-linux/yoso/__init__.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/torch211-cxx11-cu126-aarch64-linux/__init__.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from ._ops import ops
2
+
3
+ fast_hash = ops.fast_hash
4
+ lsh_cumulation = ops.lsh_cumulation
5
+ lsh_weighted_cumulation = ops.lsh_weighted_cumulation
6
+
7
+ __all__ = [
8
+ "fast_hash",
9
+ "lsh_cumulation",
10
+ "lsh_weighted_cumulation",
11
+ ]
build/torch211-cxx11-cu126-aarch64-linux/_ops.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from . import _yoso_cuda_4218a9a
3
+ ops = torch.ops._yoso_cuda_4218a9a
4
+
5
+ def add_op_namespace_prefix(op_name: str):
6
+ """
7
+ Prefix op by namespace.
8
+ """
9
+ return f"_yoso_cuda_4218a9a::{op_name}"
build/torch211-cxx11-cu126-aarch64-linux/_yoso_cuda_4218a9a.abi3.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:17de742590f0b9c20b51ad23d0fdc7a8d2c6b4d8c5238aeadce31631ac1d8c12
3
+ size 2569064
build/torch211-cxx11-cu126-aarch64-linux/metadata.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": 1,
3
+ "python-depends": [],
4
+ "backend": {
5
+ "type": "cuda",
6
+ "archs": [
7
+ "8.0",
8
+ "8.9",
9
+ "9.0"
10
+ ]
11
+ }
12
+ }
build/torch211-cxx11-cu126-aarch64-linux/yoso/__init__.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/torch211-cxx11-cu126-x86_64-linux/__init__.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from ._ops import ops
2
+
3
+ fast_hash = ops.fast_hash
4
+ lsh_cumulation = ops.lsh_cumulation
5
+ lsh_weighted_cumulation = ops.lsh_weighted_cumulation
6
+
7
+ __all__ = [
8
+ "fast_hash",
9
+ "lsh_cumulation",
10
+ "lsh_weighted_cumulation",
11
+ ]
build/torch211-cxx11-cu126-x86_64-linux/_ops.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from . import _yoso_cuda_4218a9a
3
+ ops = torch.ops._yoso_cuda_4218a9a
4
+
5
+ def add_op_namespace_prefix(op_name: str):
6
+ """
7
+ Prefix op by namespace.
8
+ """
9
+ return f"_yoso_cuda_4218a9a::{op_name}"
build/torch211-cxx11-cu126-x86_64-linux/_yoso_cuda_4218a9a.abi3.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1567356a387001e1b7c487e2eb191443b9bb46f9e593455609215970c6d96f60
3
+ size 2498248
build/torch211-cxx11-cu126-x86_64-linux/metadata.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": 1,
3
+ "python-depends": [],
4
+ "backend": {
5
+ "type": "cuda",
6
+ "archs": [
7
+ "8.0",
8
+ "8.9",
9
+ "9.0"
10
+ ]
11
+ }
12
+ }
build/torch211-cxx11-cu126-x86_64-linux/yoso/__init__.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/torch211-cxx11-cu128-aarch64-linux/__init__.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from ._ops import ops
2
+
3
+ fast_hash = ops.fast_hash
4
+ lsh_cumulation = ops.lsh_cumulation
5
+ lsh_weighted_cumulation = ops.lsh_weighted_cumulation
6
+
7
+ __all__ = [
8
+ "fast_hash",
9
+ "lsh_cumulation",
10
+ "lsh_weighted_cumulation",
11
+ ]