Upload folder using huggingface_hub
Browse files
labs/autoresearch/mojo/pixi.lock
CHANGED
|
Binary files a/labs/autoresearch/mojo/pixi.lock and b/labs/autoresearch/mojo/pixi.lock differ
|
|
|
labs/autoresearch/mojo/pixi.toml
CHANGED
|
@@ -9,3 +9,4 @@ version = "0.1.0"
|
|
| 9 |
|
| 10 |
[dependencies]
|
| 11 |
mojo = ">=0.26.2.0,<0.27"
|
|
|
|
|
|
| 9 |
|
| 10 |
[dependencies]
|
| 11 |
mojo = ">=0.26.2.0,<0.27"
|
| 12 |
+
max = ">=26.2.0,<27"
|
labs/autoresearch/mojo/train.mojo
CHANGED
|
@@ -3,6 +3,8 @@ Autoresearch Pretraining Script - Mojo Port
|
|
| 3 |
Translating the nano-GPT PyTorch implementation to Mojo.
|
| 4 |
"""
|
| 5 |
|
|
|
|
|
|
|
| 6 |
# Define the model configuration as a strict Mojo struct
|
| 7 |
struct GPTConfig:
|
| 8 |
var sequence_len: Int
|
|
@@ -21,9 +23,17 @@ struct GPTConfig:
|
|
| 21 |
self.n_embd = 768
|
| 22 |
|
| 23 |
fn main():
|
| 24 |
-
print("🚀 Initializing Mojo Autoresearch Port...")
|
| 25 |
|
| 26 |
var config = GPTConfig()
|
| 27 |
print("Model Configured. Sequence Length:", config.sequence_len)
|
|
|
|
|
|
|
| 28 |
|
| 29 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
Translating the nano-GPT PyTorch implementation to Mojo.
|
| 4 |
"""
|
| 5 |
|
| 6 |
+
from std.collections import List
|
| 7 |
+
|
| 8 |
# Define the model configuration as a strict Mojo struct
|
| 9 |
struct GPTConfig:
|
| 10 |
var sequence_len: Int
|
|
|
|
| 23 |
self.n_embd = 768
|
| 24 |
|
| 25 |
fn main():
|
| 26 |
+
print("🚀 Initializing Mojo Autoresearch Port via Modular MAX...")
|
| 27 |
|
| 28 |
var config = GPTConfig()
|
| 29 |
print("Model Configured. Sequence Length:", config.sequence_len)
|
| 30 |
+
print("Vocab Size:", config.vocab_size)
|
| 31 |
+
print("Embedding Dim:", config.n_embd)
|
| 32 |
|
| 33 |
+
# Initialize a dummy sequence
|
| 34 |
+
var seq = List[Int]()
|
| 35 |
+
for i in range(config.sequence_len):
|
| 36 |
+
seq.append(i % config.vocab_size)
|
| 37 |
+
|
| 38 |
+
print("Successfully initialized input sequence of length:", len(seq))
|
| 39 |
+
print("Ready to implement CausalSelfAttention via SIMD!")
|