From 0aad2797cabdd9dcdb64729272d262d9b84dff64 Mon Sep 17 00:00:00 2001
From: Benny Nottonson
Date: Mon, 1 Apr 2024 15:51:51 -0700
Subject: [PATCH 01/11] Create README.md
---
README.md | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
create mode 100644 README.md
diff --git a/README.md b/README.md
new file mode 100644
index 00000000..454fe7aa
--- /dev/null
+++ b/README.md
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
Basalt
+
+
+ A Machine Learning framework from scratch in Pure Mojo 🔥
+
+
+
+
+
+## About The Project
+
+...
+
+## License
+
+Distributed under the Apache 2.0 License. See [LICENSE](https://github.com/Basalt-Org/Basalt/blob/main/LICENSE) for more information.
+
+## Acknowledgements
+
+* [Modular](https://github.com/modularml)
+* [ImgShields](https://shields.io/)
From 10cd74a077f3a63e78d1029ea672e8de889fd723 Mon Sep 17 00:00:00 2001
From: StijnWoestenborghs
Date: Wed, 3 Apr 2024 23:46:03 +0200
Subject: [PATCH 02/11] update license
---
LICENSE | 75 +++++++++++++++++++++++++++++++++++++++----------------
README.md | 5 ++--
2 files changed, 56 insertions(+), 24 deletions(-)
diff --git a/LICENSE b/LICENSE
index 7a4a3ea2..791e2f59 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,11 +1,14 @@
+==============================================================================================
+The Basalt repository is licensed under the Apache License v2.0 with LLVM Exceptions:
+==============================================================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
- 1. Definitions.
+ 1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
@@ -64,14 +67,14 @@
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
- 2. Grant of Copyright License. Subject to the terms and conditions of
+ 2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
- 3. Grant of Patent License. Subject to the terms and conditions of
+ 3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
@@ -87,7 +90,7 @@
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
- 4. Redistribution. You may reproduce and distribute copies of the
+ 4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
@@ -128,7 +131,7 @@
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
- 5. Submission of Contributions. Unless You explicitly state otherwise,
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
@@ -136,12 +139,12 @@
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
- 6. Trademarks. This License does not grant permission to use the trade
+ 6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
- 7. Disclaimer of Warranty. Unless required by applicable law or
+ 7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
@@ -151,7 +154,7 @@
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
- 8. Limitation of Liability. In no event and under no legal theory,
+ 8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
@@ -163,7 +166,7 @@
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
- 9. Accepting Warranty or Additional Liability. While redistributing
+ 9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
@@ -174,9 +177,9 @@
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
- END OF TERMS AND CONDITIONS
+ END OF TERMS AND CONDITIONS
- APPENDIX: How to apply the Apache License to your work.
+ APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
@@ -187,16 +190,46 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
- Copyright [yyyy] [name of copyright owner]
+ Copyright [yyyy] [name of copyright owner]
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
\ No newline at end of file
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+---- LLVM Exceptions to the Apache 2.0 License ----
+
+As an exception, if, as a result of your compiling your source code, portions
+of this Software are embedded into an Object form of such source code, you
+may redistribute such embedded portions in such Object form without complying
+with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
+
+In addition, if you combine or link compiled forms of this Software with
+software that is licensed under the GPLv2 ("Combined Software") and if a
+court of competent jurisdiction determines that the patent provision (Section
+3), the indemnity provision (Section 9) or other Section of the License
+conflicts with the conditions of the GPLv2, you may retroactively and
+prospectively choose to deem waived or otherwise exclude such Section(s) of
+the License, but only in their entirety and only with respect to the Combined
+Software.
+
+==============================================================================
+Software from third parties included in the LLVM Project:
+==============================================================================
+
+The LLVM Project contains third party software which is under different license
+terms. All such code will be identified clearly using at least one of two
+mechanisms:
+
+1) It will be in a separate directory tree with its own `LICENSE.txt` or
+ `LICENSE` file at the top containing the specific license and restrictions
+ which apply to that software, or
+2) It will contain specific license and restriction terms at the top of every
+ file.
diff --git a/README.md b/README.md
index 454fe7aa..305aff51 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,13 @@
-
+
Basalt
- A Machine Learning framework from scratch in Pure Mojo 🔥
+ A Machine Learning framework from scratch in pure Mojo 🔥
@@ -28,4 +28,3 @@ Distributed under the Apache 2.0 License. See [LICENSE](https://github.com/Basal
## Acknowledgements
* [Modular](https://github.com/modularml)
-* [ImgShields](https://shields.io/)
From fe3a553bdc28dc12fafb1e1b155c6b29fb93515d Mon Sep 17 00:00:00 2001
From: StijnWoestenborghs
Date: Thu, 4 Apr 2024 00:45:46 +0200
Subject: [PATCH 03/11] contributer guide
---
README.md | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 305aff51..682f649f 100644
--- a/README.md
+++ b/README.md
@@ -21,10 +21,31 @@
...
+## Contributing
+
+Basalt is built by community efforts and relies on your expertise and enthousiasm!
+Small fixes and improvements are much appreciated. If you are considering larger contributions, feel free to contact us for a smoother communication channel on Discord.
+
+* If you find a bug or have an idea for a feature, please use our issue tracker. Before creating a new issue, please:
+* Check if the issue already exists. If an issue is already reported, you can contribute by commenting on the existing issue.
+* If not, create a new issue and include all the necessary details to understand/recreate the problem or feature request.
+
+### Creating A Pull Request
+
+1. Fork the Project
+2. Create your Feature Branch
+3. Commit your Changes
+4. Push to the Branch
+5. Open a Pull Request
+> Once your changes are pushed, navigate to your fork on GitHub. And create a pull request against the original basalt-org/basalt repository.
+> - Before creating a PR make sure it doesn't break any of the unit-tests. Introducing new big features require a test.
+> - In the pull request, provide a detailed description of the changes and why they're needed. Link any relevant issues.
+> - If there are any specific instructions for testing or validating your changes, include those as well.
+
## License
-Distributed under the Apache 2.0 License. See [LICENSE](https://github.com/Basalt-Org/Basalt/blob/main/LICENSE) for more information.
+Distributed under the Apache 2.0 License with LLVM Exceptions. See [LICENSE](https://github.com/Basalt-Org/Basalt/blob/main/LICENSE) and the LLVM [License](https://llvm.org/LICENSE.txt) for more information.
## Acknowledgements
-* [Modular](https://github.com/modularml)
+* Build with [Mojo](https://github.com/modularml/mojo) created by [Modular](https://github.com/modularml)
From 0fcc80d180bfdc64cf90e9d518bc5dc3d8821322 Mon Sep 17 00:00:00 2001
From: StijnWoestenborghs
Date: Thu, 4 Apr 2024 00:58:50 +0200
Subject: [PATCH 04/11] quick start guide
---
README.md | 29 +++++++++++++++++++++++++----
1 file changed, 25 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 682f649f..fc375db4 100644
--- a/README.md
+++ b/README.md
@@ -21,12 +21,33 @@
...
-## Contributing
+## Quick Start
+
+Tryout the benchmarks yourself:
+
+```
+mojo -I . examples/housing.mojo
+```
+```
+mojo -I . examples/sin_estimate.mojo
+```
+```
+mojo -I . examples/mnist.mojo
+```
-Basalt is built by community efforts and relies on your expertise and enthousiasm!
-Small fixes and improvements are much appreciated. If you are considering larger contributions, feel free to contact us for a smoother communication channel on Discord.
+Compare to an alternative PyTorch implementation:
+Make sure to install the requirements in `python-requirements.txt` in your python environment.
+
+```
+python examples/housing.py
+python examples/sin_estimate.py
+python examples/mnist.py
+```
+
+## Contributing
-* If you find a bug or have an idea for a feature, please use our issue tracker. Before creating a new issue, please:
+Basalt is built by community efforts and relies on your expertise and enthousiasm!
+Small fixes and improvements are much appreciated. If you are considering larger contributions, feel free to contact us for a smoother communication channel on Discord. If you find a bug or have an idea for a feature, please use our issue tracker. Before creating a new issue, please:
* Check if the issue already exists. If an issue is already reported, you can contribute by commenting on the existing issue.
* If not, create a new issue and include all the necessary details to understand/recreate the problem or feature request.
From 0805f6b260e76c15202b5d90a706857b6e729963 Mon Sep 17 00:00:00 2001
From: Stijn Woestenborghs
<46826967+StijnWoestenborghs@users.noreply.github.com>
Date: Thu, 4 Apr 2024 23:06:40 +0200
Subject: [PATCH 05/11] Add benchmark
---
README.md | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index fc375db4..55545ac5 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
-
+
Basalt
@@ -17,10 +17,14 @@
+
## About The Project
...
+![basalt_benchmark](https://github.com/basalt-org/basalt/assets/46826967/83037770-a9e3-440d-bdca-f51af0aebee0)
+
+
## Quick Start
Tryout the benchmarks yourself:
From c2f0abc17a6cf131dc1ce6bf093bbfaa5a82ed14 Mon Sep 17 00:00:00 2001
From: StijnWoestenborghs
Date: Thu, 4 Apr 2024 23:38:58 +0200
Subject: [PATCH 06/11] include benchmark
---
README.md | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index 55545ac5..1713b152 100644
--- a/README.md
+++ b/README.md
@@ -20,14 +20,16 @@
## About The Project
-...
+Basalt is a young machine learning framework that leverages the power of Mojo. As [discussed](https://docs.modular.com/mojo/why-mojo) by Modular, Mojo is a language for the future of AI development. Built on top of MLIR technology, rather than existing GCC and LLVM approaches, Mojo looks and feels like Python code, yet performs much closer to languages like Rust or C++. Parametric functions and compile time parameters allow for the graph to statically compiled. Having the static graph allows for much harder performance optimizations.
+
+Basalt, while still in its infancy, is able to achieve speeds comparable to well established frameworks like Pytorch. Note that the project right now is mainly limited to models using Linear and Convolutional layers. Below a benchmark of the current status. But keep posted, there is much more room for improvement and we are upgrading the project on a daily basis.
![basalt_benchmark](https://github.com/basalt-org/basalt/assets/46826967/83037770-a9e3-440d-bdca-f51af0aebee0)
## Quick Start
-Tryout the benchmarks yourself:
+Try out the benchmarks yourself:
```
mojo -I . examples/housing.mojo
@@ -39,7 +41,7 @@ mojo -I . examples/sin_estimate.mojo
mojo -I . examples/mnist.mojo
```
-Compare to an alternative PyTorch implementation:
+Compare to the alternative PyTorch implementation:
Make sure to install the requirements in `python-requirements.txt` in your python environment.
```
@@ -63,7 +65,8 @@ Small fixes and improvements are much appreciated. If you are considering larger
4. Push to the Branch
5. Open a Pull Request
> Once your changes are pushed, navigate to your fork on GitHub. And create a pull request against the original basalt-org/basalt repository.
-> - Before creating a PR make sure it doesn't break any of the unit-tests. Introducing new big features require a test.
+> - Before creating a PR make sure it doesn't break any of the unit-tests. (e.g. `mojo run -I . test/test_ops.mojo`)
+> - Introducing new big features require a new test!
> - In the pull request, provide a detailed description of the changes and why they're needed. Link any relevant issues.
> - If there are any specific instructions for testing or validating your changes, include those as well.
@@ -73,4 +76,4 @@ Distributed under the Apache 2.0 License with LLVM Exceptions. See [LICENSE](htt
## Acknowledgements
-* Build with [Mojo](https://github.com/modularml/mojo) created by [Modular](https://github.com/modularml)
+* Built with [Mojo](https://github.com/modularml/mojo) created by [Modular](https://github.com/modularml)
From f0bcf443d438a4a654bf78fdf8eb71c760c7a833 Mon Sep 17 00:00:00 2001
From: Benny Nottonson
Date: Thu, 4 Apr 2024 14:40:55 -0700
Subject: [PATCH 07/11] Update LICENSE
added year and name
---
LICENSE | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/LICENSE b/LICENSE
index 791e2f59..312b9dea 100644
--- a/LICENSE
+++ b/LICENSE
@@ -190,7 +190,7 @@ The Basalt repository is licensed under the Apache License v2.0 with LLVM Except
same "printed page" as the copyright notice for easier
identification within third-party archives.
- Copyright [yyyy] [name of copyright owner]
+ Copyright 2024 Basalt-Org
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
From beb65b7576bca3b167e60d752d2658d438dfb7f7 Mon Sep 17 00:00:00 2001
From: StijnWoestenborghs
Date: Thu, 4 Apr 2024 23:54:32 +0200
Subject: [PATCH 08/11] include roadmap
---
README.md | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 1713b152..3c06c1f0 100644
--- a/README.md
+++ b/README.md
@@ -20,7 +20,9 @@
## About The Project
-Basalt is a young machine learning framework that leverages the power of Mojo. As [discussed](https://docs.modular.com/mojo/why-mojo) by Modular, Mojo is a language for the future of AI development. Built on top of MLIR technology, rather than existing GCC and LLVM approaches, Mojo looks and feels like Python code, yet performs much closer to languages like Rust or C++. Parametric functions and compile time parameters allow for the graph to statically compiled. Having the static graph allows for much harder performance optimizations.
+Basalt is a stand-alone machine learning framework that leverages the power of Mojo.
+
+As [discussed](https://docs.modular.com/mojo/why-mojo) by Modular, Mojo is a language for the future of AI development. Built on top of MLIR technology, rather than existing GCC and LLVM approaches, Mojo looks and feels like Python code, yet performs much closer to languages like Rust or C++. Parametric functions and compile time parameters allow for the graph to statically compiled. Having the static graph allows for much harder performance optimizations.
Basalt, while still in its infancy, is able to achieve speeds comparable to well established frameworks like Pytorch. Note that the project right now is mainly limited to models using Linear and Convolutional layers. Below a benchmark of the current status. But keep posted, there is much more room for improvement and we are upgrading the project on a daily basis.
@@ -50,6 +52,29 @@ python examples/sin_estimate.py
python examples/mnist.py
```
+## Roadmap
+
+### v0.1.0 [x]
+- [x] Improve matrix multiplication and convolution kernels
+- [x] Switch to custom Tensor and TensorShape implementations
+- [x] Improve benchmarks and overall model execution performance
+- [x] Add profiling and additional performance tests
+
+### v0.2.0 (WIP)
+- [ ] Add additional operators: Slice, (Un)Squeeze, Concat, Clip, Gather, Split, FMA ...
+- [ ] Better layer support and more activation functions
+- [ ] Graph submodules & graph concatenation
+- [ ] Computer vision benchmark.
+
+### Long-Term
+- [ ] Better parallelization
+- [ ] GPU support
+- [ ] Reworked Dataloader
+- [ ] Autotuning and related features
+- [ ] Graph compilation optimizations
+- [ ] Operator fusion
+- [ ] ONNX / Max compatibility
+
## Contributing
Basalt is built by community efforts and relies on your expertise and enthousiasm!
From 9e19065f9f1611d72a78d3b484df7301868a40d4 Mon Sep 17 00:00:00 2001
From: StijnWoestenborghs
Date: Thu, 4 Apr 2024 23:56:39 +0200
Subject: [PATCH 09/11] checkmark
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 3c06c1f0..1798cccb 100644
--- a/README.md
+++ b/README.md
@@ -54,7 +54,7 @@ python examples/mnist.py
## Roadmap
-### v0.1.0 [x]
+### v0.1.0 ✅
- [x] Improve matrix multiplication and convolution kernels
- [x] Switch to custom Tensor and TensorShape implementations
- [x] Improve benchmarks and overall model execution performance
From edfed98ee4409fb5ebc3553202ec234b48832730 Mon Sep 17 00:00:00 2001
From: StijnWoestenborghs
Date: Thu, 4 Apr 2024 23:59:51 +0200
Subject: [PATCH 10/11] update readme
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 1798cccb..c0ed377f 100644
--- a/README.md
+++ b/README.md
@@ -24,7 +24,7 @@ Basalt is a stand-alone machine learning framework that leverages the power of M
As [discussed](https://docs.modular.com/mojo/why-mojo) by Modular, Mojo is a language for the future of AI development. Built on top of MLIR technology, rather than existing GCC and LLVM approaches, Mojo looks and feels like Python code, yet performs much closer to languages like Rust or C++. Parametric functions and compile time parameters allow for the graph to statically compiled. Having the static graph allows for much harder performance optimizations.
-Basalt, while still in its infancy, is able to achieve speeds comparable to well established frameworks like Pytorch. Note that the project right now is mainly limited to models using Linear and Convolutional layers. Below a benchmark of the current status. But keep posted, there is much more room for improvement and we are upgrading the project on a daily basis.
+Basalt, while still in its infancy, is able to achieve speeds comparable to well established frameworks like Pytorch. Below a snapshot of the current benchmarks. But keep posted, there is much more room for improvement and we are upgrading the project on a daily basis.
![basalt_benchmark](https://github.com/basalt-org/basalt/assets/46826967/83037770-a9e3-440d-bdca-f51af0aebee0)
From 61f070987a7f81cf7cc9f8b2d97451b3e65e8102 Mon Sep 17 00:00:00 2001
From: StijnWoestenborghs
Date: Fri, 5 Apr 2024 00:14:04 +0200
Subject: [PATCH 11/11] fix typo
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index c0ed377f..9564171f 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
-
+
Basalt
@@ -91,7 +91,7 @@ Small fixes and improvements are much appreciated. If you are considering larger
5. Open a Pull Request
> Once your changes are pushed, navigate to your fork on GitHub. And create a pull request against the original basalt-org/basalt repository.
> - Before creating a PR make sure it doesn't break any of the unit-tests. (e.g. `mojo run -I . test/test_ops.mojo`)
-> - Introducing new big features require a new test!
+> - Introducing new big features requires a new test!
> - In the pull request, provide a detailed description of the changes and why they're needed. Link any relevant issues.
> - If there are any specific instructions for testing or validating your changes, include those as well.