Skip to content

Commit f1f9280

Browse files
authored
Update links to MLX packages in documentation (#277)
* Remove self-link to MLX in MLX docs * Remove links to self and deprecated frameworks in MLXNN docs * Remove links to self and deprecated frameworks in MLXOptimizers docs * Update MAINTENANCE.md
1 parent 6f58497 commit f1f9280

File tree

4 files changed

+20
-42
lines changed

4 files changed

+20
-42
lines changed

MAINTENANCE.md

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@
1212

1313
## Adding a New Package
1414

15-
Here is adding `MLXFFT`:
15+
Here is adding `MLXOptimizers`:
1616

1717
1. `Package.swift` add a new product (for anything that should be exported) and target:
1818

1919
```
2020
products: [
2121
...
22-
.library(name: "MLXFFT", targets: ["MLXFFT"]),
22+
.library(name: "MLXOptimizers", targets: ["MLXOptimizers"]),
2323
```
2424

2525
```
2626
targets: [
2727
...
2828
.target(
29-
name: "MLXFFT",
29+
name: "MLXOptimizers",
3030
dependencies: ["MLX"]
3131
),
3232
```
@@ -36,18 +36,17 @@ add to MLXTests:
3636
```
3737
.testTarget(
3838
name: "MLXTests",
39-
dependencies: ["MLX", "MLXRandom", "MLXNN", "MLXOptimizers", "MLXFFT"]
39+
dependencies: ["MLX", "MLXNN", "MLXOptimizers"]
4040
),
4141
```
4242

43-
4443
2. Update `CMakeLists`
45-
44+
4645
```
47-
# MLXFFT package
48-
file(GLOB MLXFFT-src ${CMAKE_CURRENT_LIST_DIR}/Source/MLXFFT/*.swift)
49-
add_library(MLXFFT STATIC ${MLXFFT-src})
50-
target_link_libraries(MLXFFT PRIVATE MLX)
46+
# MLXOptimizers package
47+
file(GLOB MLXOptimizers-src ${CMAKE_CURRENT_LIST_DIR}/Source/MLXOptimizers/*.swift)
48+
add_library(MLXOptimizers STATIC ${MLXOptimizers-src})
49+
target_link_libraries(MLXOptimizers PRIVATE MLX)
5150
```
5251

5352
3. Create directory in `Source`
@@ -56,18 +55,13 @@ target_link_libraries(MLXFFT PRIVATE MLX)
5655

5756
5. Add source files and documentation
5857

59-
6. Add linkage to the other documentation, e.g. in `MLXFFT.md`
58+
6. Add linkage to the other documentation, e.g. in `MLXOptimizers.md`
6059

6160
```
6261
## Other MLX Packages
6362
6463
- [MLX](mlx)
65-
- [MLXRandom](mlxrandom)
6664
- [MLXNN](mlxnn)
67-
- [MLXOptimizers](mlxoptimizers)
68-
- [MLXFFT](mlxfft)
69-
- [MLXLinalg](mlxlinalg)
70-
- [MLXFast](mlxfast)
7165
7266
- [Python `mlx`](https://ml-explore.github.io/mlx/build/html/index.html)
7367
```
@@ -78,27 +72,23 @@ target_link_libraries(MLXFFT PRIVATE MLX)
7872
## Other MLX Packages
7973
8074
...
81-
- [MLXFFT](../mlxfft/)
75+
- [MLXOptimizers](../mlxoptimizers/)
8276
```
8377

8478
8. Update README.md
8579

8680
```
8781
dependencies: [.product(name: "MLX", package: "mlx-swift"),
88-
.product(name: "MLXRandom", package: "mlx-swift"),
8982
.product(name: "MLXNN", package: "mlx-swift"),
90-
.product(name: "MLXOptimizers", package: "mlx-swift"),
91-
.product(name: "MLXFFT", package: "mlx-swift")]
83+
.product(name: "MLXOptimizers", package: "mlx-swift")]
9284
```
9385

9486
9. Update install.md
9587

9688
```
9789
dependencies: [.product(name: "MLX", package: "mlx-swift"),
98-
.product(name: "MLXRandom", package: "mlx-swift"),
9990
.product(name: "MLXNN", package: "mlx-swift"),
100-
.product(name: "MLXOptimizers", package: "mlx-swift"),
101-
.product(name: "MLXFFT", package: "mlx-swift")]
91+
.product(name: "MLXOptimizers", package: "mlx-swift")]
10292
```
10393

10494
10. Update `tools/generate_integration_tests.py` as needed
@@ -113,7 +103,7 @@ import MLXNN
113103
12. Update `tools/build-documentation.sh`
114104

115105
```
116-
for x in MLX MLXRandom MLXNN MLXOptimizers MLXFFT; do
106+
for x in MLX MLXNN MLXOptimizers; do
117107
```
118108

119109
13. Add to `.spi.yml` for swift package index
@@ -129,25 +119,24 @@ pre-commit run --all-files
129119
## Updating `mlx` and `mlx-c`
130120

131121
SwiftPM is able to fetch repositories from github and build them _if_ they have
132-
a `Package.swift` at the top level. It is unable to do this for repositories
133-
that do not have a `Package.swift`. For this reason `mlx-swift` uses
122+
a `Package.swift` at the top level. It is unable to do this for repositories
123+
that do not have a `Package.swift`. For this reason `mlx-swift` uses
134124
git submodules to include the `mlx` and `mlx-c` repositories.
135125

136126
When a new version of `mlx` and its equivalent `mlx-c` are to be used, there is a
137127
process to go through to update `mlx-swift`.
138128

139129
Additionally, SwiftPM supports plugins that can produce derived source for
140-
building, but this can only produce new swift source. It is possible to use
130+
building, but this can only produce new swift source. It is possible to use
141131
plugins to generate new source `.cpp` files and even compile them, but at
142132
best the `.o` is copied into the output as a resource, not linked.
143133
This is important because `mlx` has some build-time source generation
144-
(e.g. `make_compiled_preamble.sh`). This is handled in `mlx-swift` by
134+
(e.g. `make_compiled_preamble.sh`). This is handled in `mlx-swift` by
145135
pre-generating the source when updating the `mlx` version.
146136

147137
1. Update the `mlx` and `mlx-c` submodules via `git pull` or `git checkout ...`
148-
- `Source/Cmlx/mlx`
149-
- `Source/Cmlx/mlx-c`
150-
138+
- `Source/Cmlx/mlx`
139+
- `Source/Cmlx/mlx-c`
151140
2. Add any vendored dependencies as needed in `/vendor`
152141

153142
3. Regenerate any build-time source: `./tools/update-mlx.sh`

Source/MLX/Documentation.docc/MLX.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ are the CPU and GPU.
3535

3636
## Other MLX Packages
3737

38-
- [MLX](mlx)
3938
- [MLXNN](mlxnn)
4039
- [MLXOptimizers](mlxoptimizers)
4140

Source/MLXNN/Documentation.docc/MLXNN.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,7 @@ See <doc:training>
4444
## Other MLX Packages
4545

4646
- [MLX](mlx)
47-
- [MLXRandom](mlxrandom)
48-
- [MLXNN](mlxnn)
4947
- [MLXOptimizers](mlxoptimizers)
50-
- [MLXFFT](mlxfft)
51-
- [MLXLinalg](mlxlinalg)
52-
- [MLXFast](mlxfast)
5348

5449
- [Python `mlx`](https://ml-explore.github.io/mlx/build/html/index.html)
5550

Source/MLXOptimizers/Documentation.docc/MLXOptimizers.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,7 @@ for _ in 0 ..< epochs {
3232
## Other MLX Packages
3333

3434
- [MLX](mlx)
35-
- [MLXRandom](mlxrandom)
3635
- [MLXNN](mlxnn)
37-
- [MLXOptimizers](mlxoptimizers)
38-
- [MLXFFT](mlxfft)
39-
- [MLXLinalg](mlxlinalg)
40-
- [MLXFast](mlxfast)
4136

4237
- [Python `mlx`](https://ml-explore.github.io/mlx/build/html/index.html)
4338

0 commit comments

Comments
 (0)