mirror of
https://github.com/MLSysBook/TinyTorch.git
synced 2026-03-09 15:02:25 -05:00
📚 Break Complex Modules into Digestible Sub-Components While Maintaining Module Unity #3
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @profvjreddi on GitHub (Jul 18, 2025).
📚 Break Complex Modules into Digestible Sub-Components While Maintaining Module Unity
📚 Educational Problem
Several TinyTorch modules have grown quite large (1000+ lines), making them difficult for students to navigate, understand, and debug. While the modules work well as cohesive educational units, the individual development files can be overwhelming.
Current Complex Modules:
02_tensor/tensor_dev.py: 1,578 lines15_mlops/mlops_dev.py: 1,667 lines13_kernels/kernels_dev.py: 1,381 lines05_dense/dense_dev.py: 907 lines🎯 Proposed Solution
Break each complex module into smaller, focused sub-components while maintaining the module structure and educational flow. Think "bite-sized pieces that still work as a whole."
Example: Breaking Down
02_tensorModuleCurrent Structure:
Proposed Structure:
Example: Breaking Down
15_mlopsModuleCurrent Structure:
Proposed Structure:
🏗️ Implementation Strategy
1. Maintain Module Unity
{module}_dev.pyfile as the primary entry point2. Logical Decomposition
3. Educational Benefits
4. Technical Implementation
🎓 Educational Advantages
🔧 Implementation Notes
📋 Success Criteria
🎯 Priority Modules for Migration
02_tensor(1,578 lines) - Foundation module, affects all others15_mlops(1,667 lines) - Complex capstone module13_kernels(1,381 lines) - Performance engineering module11_training(estimated 1,000+ lines) - Core training pipelineThis enhancement will make TinyTorch more student-friendly while maintaining its educational integrity and systematic learning progression.
Labels:
enhancement,education,architecture,modules@HasarinduPerera commented on GitHub (Sep 19, 2025):
Do you still need help with this? I'd love to collaborate on this project in some way.
@profvjreddi commented on GitHub (Sep 19, 2025):
Hey @HasarinduPerera, Thanks so much for dropping me a note. I've been working on this feverishly over the past couple of days, so let me get that completed to a stable state, and I will release. Been cranking on a version of a tiny GPT engine. But it's not really working yet, so I need to close it off a bit. So give me a few days and I will drop you a note. Sound good?
@Zappandy commented on GitHub (Oct 12, 2025):
@profvjreddi first of all thank you for your work! I recently started going over the modules and was refactoring the tensor module myself based on the structure you provided. I know you were already working on this, but let me know if you'd be interested in either contributions to the tensor module or otherwise.
I do wanna mention that to proper contribute to module refactoring, I also went over the
tito/commands/export.py, so when I make a contribution I can export the module and test it. I noticed the common mappings from the dev branch are still pointing at the paths defined in main instead of the ones in dev (line ~306)l:Mind you the
MODULE_TO_CHECKPOINTis properly defined, this is just something else that stood out to me. I'm wondering whether this should be updated too in the dev branch so as we make contributions, we can properly test them while adhering to tito's existing functionalities.Side note, in regards to refactoring complex modules, I reckon long term the setup module will be removed, correct?
@profvjreddi commented on GitHub (Oct 12, 2025):
Hi there! This project is still a work in progress, and I have quite a few
local commits that haven’t been pushed yet. Thanks so much for trying it
out! Give me another month or two, and I should have the first Alpha
release ready. But in the meantime totally welcome feedback and thoughts!
Thanks 😊
Vijay Janapa Reddi, Ph.D.
Gordon McKay Professor of Electrical Engineering
John A. Paulson School of Engineering and Applied Sciences
Harvard University
📍 150 Western Ave, Room 5.305,
Boston, MA 02134, USA (Google Maps
https://maps.app.goo.gl/ixd9WAgDbCGBwymC6)
🌐 Homepage https://vijay.seas.harvard.edu | 📚 Research
https://profvjreddi.github.io/homepage/research | 📕 Teaching
https://mlsysbook.org/ | 💻 GitHub https://github.com/profvjreddi | 📅
Calendar https://profvjreddi.github.io/homepage/contact | 🧑💼 Assistant
https://profvjreddi.github.io/homepage/contact#contact-methods
On Sun, Oct 12, 2025 at 12:22 PM, Andres Gonzalez Gongora <
@.***> wrote:
@Zappandy commented on GitHub (Oct 18, 2025):
Hi @profvjreddi, thank you so much for your reply! In the meantime, I'll keep going through the modules of the current publicly available dev version and write down things if they have not been addressed by the alpha release!
Feel free to block the MR I made as well, because I don't think multiple virtual env management should be an option until TinyTorch is in alpha.
@profvjreddi commented on GitHub (Oct 20, 2025):
👍 I just pushed updates to the website which should reflect more of what I am putting together.