Skip to content
This repository was archived by the owner on Mar 2, 2025. It is now read-only.

Commit 2fe6467

Browse files
Merge pull request #39 from basalt-org/readme
Create README.md
2 parents 5e3281f + 61f0709 commit 2fe6467

File tree

2 files changed

+158
-21
lines changed

2 files changed

+158
-21
lines changed

LICENSE

Lines changed: 54 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
==============================================================================================
2+
The Basalt repository is licensed under the Apache License v2.0 with LLVM Exceptions:
3+
==============================================================================================
14

25
Apache License
36
Version 2.0, January 2004
47
http://www.apache.org/licenses/
58

6-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
9+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
710

8-
1. Definitions.
11+
1. Definitions.
912

1013
"License" shall mean the terms and conditions for use, reproduction,
1114
and distribution as defined by Sections 1 through 9 of this document.
@@ -64,14 +67,14 @@
6467
on behalf of whom a Contribution has been received by Licensor and
6568
subsequently incorporated within the Work.
6669

67-
2. Grant of Copyright License. Subject to the terms and conditions of
70+
2. Grant of Copyright License. Subject to the terms and conditions of
6871
this License, each Contributor hereby grants to You a perpetual,
6972
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
7073
copyright license to reproduce, prepare Derivative Works of,
7174
publicly display, publicly perform, sublicense, and distribute the
7275
Work and such Derivative Works in Source or Object form.
7376

74-
3. Grant of Patent License. Subject to the terms and conditions of
77+
3. Grant of Patent License. Subject to the terms and conditions of
7578
this License, each Contributor hereby grants to You a perpetual,
7679
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
7780
(except as stated in this section) patent license to make, have made,
@@ -87,7 +90,7 @@
8790
granted to You under this License for that Work shall terminate
8891
as of the date such litigation is filed.
8992

90-
4. Redistribution. You may reproduce and distribute copies of the
93+
4. Redistribution. You may reproduce and distribute copies of the
9194
Work or Derivative Works thereof in any medium, with or without
9295
modifications, and in Source or Object form, provided that You
9396
meet the following conditions:
@@ -128,20 +131,20 @@
128131
reproduction, and distribution of the Work otherwise complies with
129132
the conditions stated in this License.
130133

131-
5. Submission of Contributions. Unless You explicitly state otherwise,
134+
5. Submission of Contributions. Unless You explicitly state otherwise,
132135
any Contribution intentionally submitted for inclusion in the Work
133136
by You to the Licensor shall be under the terms and conditions of
134137
this License, without any additional terms or conditions.
135138
Notwithstanding the above, nothing herein shall supersede or modify
136139
the terms of any separate license agreement you may have executed
137140
with Licensor regarding such Contributions.
138141

139-
6. Trademarks. This License does not grant permission to use the trade
142+
6. Trademarks. This License does not grant permission to use the trade
140143
names, trademarks, service marks, or product names of the Licensor,
141144
except as required for reasonable and customary use in describing the
142145
origin of the Work and reproducing the content of the NOTICE file.
143146

144-
7. Disclaimer of Warranty. Unless required by applicable law or
147+
7. Disclaimer of Warranty. Unless required by applicable law or
145148
agreed to in writing, Licensor provides the Work (and each
146149
Contributor provides its Contributions) on an "AS IS" BASIS,
147150
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
@@ -151,7 +154,7 @@
151154
appropriateness of using or redistributing the Work and assume any
152155
risks associated with Your exercise of permissions under this License.
153156

154-
8. Limitation of Liability. In no event and under no legal theory,
157+
8. Limitation of Liability. In no event and under no legal theory,
155158
whether in tort (including negligence), contract, or otherwise,
156159
unless required by applicable law (such as deliberate and grossly
157160
negligent acts) or agreed to in writing, shall any Contributor be
@@ -163,7 +166,7 @@
163166
other commercial damages or losses), even if such Contributor
164167
has been advised of the possibility of such damages.
165168

166-
9. Accepting Warranty or Additional Liability. While redistributing
169+
9. Accepting Warranty or Additional Liability. While redistributing
167170
the Work or Derivative Works thereof, You may choose to offer,
168171
and charge a fee for, acceptance of support, warranty, indemnity,
169172
or other liability obligations and/or rights consistent with this
@@ -174,9 +177,9 @@
174177
incurred by, or claims asserted against, such Contributor by reason
175178
of your accepting any such warranty or additional liability.
176179

177-
END OF TERMS AND CONDITIONS
180+
END OF TERMS AND CONDITIONS
178181

179-
APPENDIX: How to apply the Apache License to your work.
182+
APPENDIX: How to apply the Apache License to your work.
180183

181184
To apply the Apache License to your work, attach the following
182185
boilerplate notice, with the fields enclosed by brackets "[]"
@@ -187,16 +190,46 @@
187190
same "printed page" as the copyright notice for easier
188191
identification within third-party archives.
189192

190-
Copyright [yyyy] [name of copyright owner]
193+
Copyright 2024 Basalt-Org
191194

192-
Licensed under the Apache License, Version 2.0 (the "License");
193-
you may not use this file except in compliance with the License.
194-
You may obtain a copy of the License at
195+
Licensed under the Apache License, Version 2.0 (the "License");
196+
you may not use this file except in compliance with the License.
197+
You may obtain a copy of the License at
195198

196199
http://www.apache.org/licenses/LICENSE-2.0
197200

198-
Unless required by applicable law or agreed to in writing, software
199-
distributed under the License is distributed on an "AS IS" BASIS,
200-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201-
See the License for the specific language governing permissions and
202-
limitations under the License.
201+
Unless required by applicable law or agreed to in writing, software
202+
distributed under the License is distributed on an "AS IS" BASIS,
203+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
204+
See the License for the specific language governing permissions and
205+
limitations under the License.
206+
207+
---- LLVM Exceptions to the Apache 2.0 License ----
208+
209+
As an exception, if, as a result of your compiling your source code, portions
210+
of this Software are embedded into an Object form of such source code, you
211+
may redistribute such embedded portions in such Object form without complying
212+
with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
213+
214+
In addition, if you combine or link compiled forms of this Software with
215+
software that is licensed under the GPLv2 ("Combined Software") and if a
216+
court of competent jurisdiction determines that the patent provision (Section
217+
3), the indemnity provision (Section 9) or other Section of the License
218+
conflicts with the conditions of the GPLv2, you may retroactively and
219+
prospectively choose to deem waived or otherwise exclude such Section(s) of
220+
the License, but only in their entirety and only with respect to the Combined
221+
Software.
222+
223+
==============================================================================
224+
Software from third parties included in the LLVM Project:
225+
==============================================================================
226+
227+
The LLVM Project contains third party software which is under different license
228+
terms. All such code will be identified clearly using at least one of two
229+
mechanisms:
230+
231+
1) It will be in a separate directory tree with its own `LICENSE.txt` or
232+
`LICENSE` file at the top containing the specific license and restrictions
233+
which apply to that software, or
234+
2) It will contain specific license and restriction terms at the top of every
235+
file.

README.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<br/>
2+
<p align="center">
3+
<a href="https://github.com/Basalt-Org/Basalt">
4+
<img src="https://github.com/basalt-org/basalt/assets/46826967/4873806c-ff61-4903-bf3d-874d6acba3e8" alt="Logo" width="200" height="200">
5+
</a>
6+
7+
<h1 align="center">Basalt</h1>
8+
9+
<p align="center">
10+
A Machine Learning framework from scratch in pure Mojo 🔥
11+
</p>
12+
</p>
13+
14+
<div align="center">
15+
<img src="https://img.shields.io/github/contributors/Basalt-Org/Basalt?color=dark-green" />
16+
<img src="https://img.shields.io/github/issues/Basalt-Org/Basalt?color=dark-green" />
17+
<img src="https://img.shields.io/github/license/Basalt-Org/Basalt?color=dark-green" />
18+
</div>
19+
20+
21+
## About The Project
22+
23+
Basalt is a stand-alone machine learning framework that leverages the power of Mojo.
24+
25+
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.
26+
27+
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.
28+
29+
![basalt_benchmark](https://github.com/basalt-org/basalt/assets/46826967/83037770-a9e3-440d-bdca-f51af0aebee0)
30+
31+
32+
## Quick Start
33+
34+
Try out the benchmarks yourself:
35+
36+
```
37+
mojo -I . examples/housing.mojo
38+
```
39+
```
40+
mojo -I . examples/sin_estimate.mojo
41+
```
42+
```
43+
mojo -I . examples/mnist.mojo
44+
```
45+
46+
Compare to the alternative PyTorch implementation:
47+
Make sure to install the requirements in `python-requirements.txt` in your python environment.
48+
49+
```
50+
python examples/housing.py
51+
python examples/sin_estimate.py
52+
python examples/mnist.py
53+
```
54+
55+
## Roadmap
56+
57+
### v0.1.0 ✅
58+
- [x] Improve matrix multiplication and convolution kernels
59+
- [x] Switch to custom Tensor and TensorShape implementations
60+
- [x] Improve benchmarks and overall model execution performance
61+
- [x] Add profiling and additional performance tests
62+
63+
### v0.2.0 (WIP)
64+
- [ ] Add additional operators: Slice, (Un)Squeeze, Concat, Clip, Gather, Split, FMA ...
65+
- [ ] Better layer support and more activation functions
66+
- [ ] Graph submodules & graph concatenation
67+
- [ ] Computer vision benchmark.
68+
69+
### Long-Term
70+
- [ ] Better parallelization
71+
- [ ] GPU support
72+
- [ ] Reworked Dataloader
73+
- [ ] Autotuning and related features
74+
- [ ] Graph compilation optimizations
75+
- [ ] Operator fusion
76+
- [ ] ONNX / Max compatibility
77+
78+
## Contributing
79+
80+
Basalt is built by community efforts and relies on your expertise and enthousiasm!
81+
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:
82+
* Check if the issue already exists. If an issue is already reported, you can contribute by commenting on the existing issue.
83+
* If not, create a new issue and include all the necessary details to understand/recreate the problem or feature request.
84+
85+
### Creating A Pull Request
86+
87+
1. Fork the Project
88+
2. Create your Feature Branch
89+
3. Commit your Changes
90+
4. Push to the Branch
91+
5. Open a Pull Request
92+
> Once your changes are pushed, navigate to your fork on GitHub. And create a pull request against the original basalt-org/basalt repository.
93+
> - Before creating a PR make sure it doesn't break any of the unit-tests. (e.g. `mojo run -I . test/test_ops.mojo`)
94+
> - Introducing new big features requires a new test!
95+
> - In the pull request, provide a detailed description of the changes and why they're needed. Link any relevant issues.
96+
> - If there are any specific instructions for testing or validating your changes, include those as well.
97+
98+
## License
99+
100+
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.
101+
102+
## Acknowledgements
103+
104+
* Built with [Mojo](https://github.com/modularml/mojo) created by [Modular](https://github.com/modularml)

0 commit comments

Comments
 (0)