mlx-cluster 0.0.3__tar.gz → 0.0.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. {mlx_cluster-0.0.3/mlx_cluster.egg-info → mlx_cluster-0.0.4}/PKG-INFO +5 -3
  2. {mlx_cluster-0.0.3 → mlx_cluster-0.0.4}/mlx_cluster/_ext.cpython-311-darwin.so +0 -0
  3. mlx_cluster-0.0.4/mlx_cluster/libmlx_cluster.dylib +0 -0
  4. {mlx_cluster-0.0.3 → mlx_cluster-0.0.4/mlx_cluster.egg-info}/PKG-INFO +5 -3
  5. mlx_cluster-0.0.4/mlx_cluster.egg-info/requires.txt +9 -0
  6. {mlx_cluster-0.0.3 → mlx_cluster-0.0.4}/pyproject.toml +7 -5
  7. {mlx_cluster-0.0.3 → mlx_cluster-0.0.4}/random_walks/RandomWalk.cpp +1 -0
  8. {mlx_cluster-0.0.3 → mlx_cluster-0.0.4}/setup.py +2 -9
  9. {mlx_cluster-0.0.3 → mlx_cluster-0.0.4}/tests/test_random_walk.py +3 -0
  10. {mlx_cluster-0.0.3 → mlx_cluster-0.0.4}/tests/test_rejection_sampling.py +4 -3
  11. mlx_cluster-0.0.3/mlx_cluster/libmlx_cluster.dylib +0 -0
  12. mlx_cluster-0.0.3/mlx_cluster.egg-info/requires.txt +0 -7
  13. {mlx_cluster-0.0.3 → mlx_cluster-0.0.4}/CMakeLists.txt +0 -0
  14. {mlx_cluster-0.0.3 → mlx_cluster-0.0.4}/LICENSE +0 -0
  15. {mlx_cluster-0.0.3 → mlx_cluster-0.0.4}/MANIFEST.in +0 -0
  16. {mlx_cluster-0.0.3 → mlx_cluster-0.0.4}/README.md +0 -0
  17. {mlx_cluster-0.0.3 → mlx_cluster-0.0.4}/bindings.cpp +0 -0
  18. {mlx_cluster-0.0.3 → mlx_cluster-0.0.4}/mlx_cluster/__init__.py +0 -0
  19. {mlx_cluster-0.0.3 → mlx_cluster-0.0.4}/mlx_cluster/libmlx.dylib +0 -0
  20. {mlx_cluster-0.0.3 → mlx_cluster-0.0.4}/mlx_cluster/mlx_cluster.metallib +0 -0
  21. {mlx_cluster-0.0.3 → mlx_cluster-0.0.4}/mlx_cluster.egg-info/SOURCES.txt +0 -0
  22. {mlx_cluster-0.0.3 → mlx_cluster-0.0.4}/mlx_cluster.egg-info/dependency_links.txt +0 -0
  23. {mlx_cluster-0.0.3 → mlx_cluster-0.0.4}/mlx_cluster.egg-info/not-zip-safe +0 -0
  24. {mlx_cluster-0.0.3 → mlx_cluster-0.0.4}/mlx_cluster.egg-info/top_level.txt +0 -0
  25. {mlx_cluster-0.0.3 → mlx_cluster-0.0.4}/random_walks/BiasedRandomWalk.cpp +0 -0
  26. {mlx_cluster-0.0.3 → mlx_cluster-0.0.4}/random_walks/BiasedRandomWalk.h +0 -0
  27. {mlx_cluster-0.0.3 → mlx_cluster-0.0.4}/random_walks/RandomWalk.h +0 -0
  28. {mlx_cluster-0.0.3 → mlx_cluster-0.0.4}/random_walks/random_walk.metal +0 -0
  29. {mlx_cluster-0.0.3 → mlx_cluster-0.0.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mlx_cluster
3
- Version: 0.0.3
3
+ Version: 0.0.4
4
4
  Summary: C++ and Metal extensions for MLX CTC Loss
5
5
  Author-email: Vinay Pandya <vinayharshadpandya27@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/vinayhpandya/mlx_cluster
@@ -15,9 +15,11 @@ Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
16
  Provides-Extra: dev
17
17
  Provides-Extra: test
18
+ Requires-Dist: mlx_graphs==0.0.7; extra == "test"
19
+ Requires-Dist: torch==2.2.0; extra == "test"
20
+ Requires-Dist: mlx>=0.17.0; extra == "test"
18
21
  Requires-Dist: pytest==7.4.4; extra == "test"
19
- Requires-Dist: torch; extra == "test"
20
- Requires-Dist: mlx_graphs; extra == "test"
22
+ Requires-Dist: scipy==1.12.0; extra == "test"
21
23
 
22
24
  # mlx_cluster
23
25
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mlx_cluster
3
- Version: 0.0.3
3
+ Version: 0.0.4
4
4
  Summary: C++ and Metal extensions for MLX CTC Loss
5
5
  Author-email: Vinay Pandya <vinayharshadpandya27@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/vinayhpandya/mlx_cluster
@@ -15,9 +15,11 @@ Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
16
  Provides-Extra: dev
17
17
  Provides-Extra: test
18
+ Requires-Dist: mlx_graphs==0.0.7; extra == "test"
19
+ Requires-Dist: torch==2.2.0; extra == "test"
20
+ Requires-Dist: mlx>=0.17.0; extra == "test"
18
21
  Requires-Dist: pytest==7.4.4; extra == "test"
19
- Requires-Dist: torch; extra == "test"
20
- Requires-Dist: mlx_graphs; extra == "test"
22
+ Requires-Dist: scipy==1.12.0; extra == "test"
21
23
 
22
24
  # mlx_cluster
23
25
 
@@ -0,0 +1,9 @@
1
+
2
+ [dev]
3
+
4
+ [test]
5
+ mlx_graphs==0.0.7
6
+ torch==2.2.0
7
+ mlx>=0.17.0
8
+ pytest==7.4.4
9
+ scipy==1.12.0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mlx_cluster"
3
- version = "0.0.3"
3
+ version = "0.0.4"
4
4
  authors = [
5
5
  { name = "Vinay Pandya", email = "vinayharshadpandya27@gmail.com" },
6
6
  ]
@@ -18,9 +18,11 @@ classifiers = [
18
18
  [project.optional-dependencies]
19
19
  dev = []
20
20
  test = [
21
+ "mlx_graphs==0.0.7",
22
+ "torch==2.2.0",
23
+ "mlx>=0.17.0",
21
24
  "pytest==7.4.4",
22
- "torch",
23
- "mlx_graphs",
25
+ "scipy==1.12.0",
24
26
  ]
25
27
  [project.urls]
26
28
  Homepage = "https://github.com/vinayhpandya/mlx_cluster"
@@ -31,9 +33,9 @@ Issues = "https://github.com/vinayhpandya/mlx_cluster/Issues"
31
33
  requires = [
32
34
  "setuptools>=42",
33
35
  "cmake>=3.24",
34
- "mlx>=0.17.0",
36
+ "mlx==0.18.0",
35
37
  "nanobind@git+https://github.com/wjakob/nanobind.git@2f04eac452a6d9142dedb957701bdb20125561e4",
36
38
  ]
37
39
 
38
40
 
39
- build-backend = "setuptools.build_meta"
41
+ build-backend = "setuptools.build_meta"
@@ -137,6 +137,7 @@ std::vector<std::vector<int>> RandomWalk::output_shapes(const std::vector<array>
137
137
 
138
138
  array random_walk(const array& rowptr, const array& col, const array& start, const array& rand, int walk_length, StreamOrDevice s)
139
139
  {
140
+ std::cout<<"Inside random walk"<<std::endl;
140
141
  int nodes = start.size();
141
142
  auto primitive = std::make_shared<RandomWalk>(walk_length, to_stream(s));
142
143
  return array::make_arrays({{nodes,walk_length+1},{nodes, walk_length}},
@@ -4,20 +4,13 @@ from mlx import extension
4
4
  if __name__ == "__main__":
5
5
  setup(
6
6
  name="mlx_cluster",
7
- version="0.0.3",
7
+ version="0.0.4",
8
8
  description="Sample C++ and Metal extensions for MLX primitives.",
9
9
  ext_modules=[extension.CMakeExtension("mlx_cluster._ext")],
10
10
  cmdclass={"build_ext": extension.CMakeBuild},
11
11
  packages=["mlx_cluster"],
12
12
  package_data={"mlx_cluster": ["*.so", "*.dylib", "*.metallib"]},
13
- extras_require={
14
- "dev": [],
15
- "test": [
16
- "mlx_graphs",
17
- "torch",
18
- "pytest",
19
- ],
20
- },
13
+ extras_require={"dev": []},
21
14
  zip_safe=False,
22
15
  python_requires=">=3.8",
23
16
  )
@@ -3,11 +3,13 @@ import numpy as np
3
3
  import time
4
4
 
5
5
  # Torch dataset
6
+ import torch
6
7
  from torch.utils.data import DataLoader
7
8
 
8
9
  loader = DataLoader(range(2708), batch_size=2000)
9
10
  start_indices = next(iter(loader))
10
11
 
12
+
11
13
  from mlx_graphs.datasets import PlanetoidDataset
12
14
  from mlx_graphs.utils.sorting import sort_edge_index
13
15
  from torch.utils.data import DataLoader
@@ -16,6 +18,7 @@ from mlx_cluster import random_walk
16
18
  cora_dataset = PlanetoidDataset(name="cora", base_dir="~")
17
19
  # For some reason int_64t and int_32t are not compatible
18
20
  edge_index = cora_dataset.graphs[0].edge_index.astype(mx.int64)
21
+
19
22
  # Convert edge index into a CSR matrix
20
23
  sorted_edge_index = sort_edge_index(edge_index=edge_index)
21
24
  row_mlx = sorted_edge_index[0][0]
@@ -2,10 +2,10 @@ import mlx.core as mx
2
2
  import numpy as np
3
3
  import time
4
4
 
5
- # Torch dataloader
5
+ # Torch dataset
6
+ import torch
6
7
  from torch.utils.data import DataLoader
7
8
 
8
-
9
9
  loader = DataLoader(range(2708), batch_size=2000)
10
10
  start_indices = next(iter(loader))
11
11
  # random_walks = torch.ops.torch_cluster.random_walk(
@@ -14,6 +14,7 @@ start_indices = next(iter(loader))
14
14
 
15
15
  from mlx_graphs.datasets import PlanetoidDataset
16
16
  from mlx_graphs.utils.sorting import sort_edge_index
17
+ from torch.utils.data import DataLoader
17
18
  from mlx_cluster import rejection_sampling
18
19
 
19
20
  cora_dataset = PlanetoidDataset(name="cora", base_dir="~")
@@ -30,5 +31,5 @@ start_time = time.time()
30
31
  node_sequence = rejection_sampling(
31
32
  row_ptr_mlx, col_mlx, start_indices, 5, 1.0, 3.0, stream=mx.cpu
32
33
  )
33
- print("Time taken to complete random walks : ", time.time() - start_time)
34
+ print("Time taken to complete 1000 random walks : ", time.time() - start_time)
34
35
  print(node_sequence)
@@ -1,7 +0,0 @@
1
-
2
- [dev]
3
-
4
- [test]
5
- pytest==7.4.4
6
- torch
7
- mlx_graphs
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes