mirror of
https://github.com/MLSysBook/TinyTorch.git
synced 2026-03-09 13:42:01 -05:00
- Implement tito benchmark baseline and capstone commands - Add SPEC-style normalization for baseline benchmarks - Implement tito community join, update, leave, stats, profile commands - Use project-local storage (.tinytorch/) for user data - Add privacy-by-design with explicit consent prompts - Update site documentation for community and benchmark features - Add Marimo integration for online notebooks - Clean up redundant milestone setup exploration docs - Finalize baseline design: fast setup validation (~1 second) with normalized results
3.8 KiB
3.8 KiB
Community Configuration Setup
Storage Location
All community data is stored project-locally in .tinytorch/ directory (not in home directory):
.tinytorch/
├── config.json # Configuration (website URLs, settings)
├── community/
│ └── profile.json # User's community profile
└── submissions/ # Benchmark submissions (ready for website)
Configuration File (.tinytorch/config.json)
The configuration file is automatically created on first use with these defaults:
{
"website": {
"base_url": "https://tinytorch.ai",
"community_map_url": "https://tinytorch.ai/community",
"api_url": null,
"enabled": false
},
"local": {
"enabled": true,
"auto_sync": false
}
}
Configuration Fields
Website Settings:
base_url: Base URL for TinyTorch websitecommunity_map_url: URL to community map pageapi_url: API endpoint URL (set when API is ready)enabled: Enable website integration (set totruewhen ready)
Local Settings:
enabled: Alwaystrue- local storage is always enabledauto_sync: Auto-sync to website when enabled (future feature)
Website Integration Stubs
All commands have stubs for website integration that are currently disabled:
Join Command
def _notify_website_join(self, profile: Dict[str, Any]) -> None:
"""Stub: Notify website when user joins."""
config = self._get_config()
if not config.get("website", {}).get("enabled", False):
return
api_url = config.get("website", {}).get("api_url")
if api_url:
# TODO: Implement API call when website is ready
# import requests
# response = requests.post(f"{api_url}/api/community/join", json=profile)
pass
Leave Command
def _notify_website_leave(self, anonymous_id: Optional[str]) -> None:
"""Stub: Notify website when user leaves."""
# Similar structure to join
Benchmark Submission
def _submit_to_website(self, submission: Dict[str, Any]) -> None:
"""Stub: Submit benchmark results to website."""
# Similar structure
Enabling Website Integration
When the website API is ready:
-
Update configuration:
{ "website": { "api_url": "https://api.tinytorch.ai", "enabled": true } } -
Implement API calls:
- Uncomment TODO sections in
community.pyandbenchmark.py - Add
requestsdependency if needed - Implement error handling
- Uncomment TODO sections in
-
Test integration:
- Test join/leave notifications
- Test benchmark submission
- Verify data sync
Current Behavior (Local-Only)
All commands work locally:
- ✅
tito community join- Saves profile to.tinytorch/community/profile.json - ✅
tito community update- Updates local profile - ✅
tito community leave- Removes local profile - ✅
tito benchmark baseline- Saves to.tito/benchmarks/ - ✅
tito benchmark capstone- Saves to.tito/benchmarks/
Website stubs are present but disabled:
- Stubs call
_get_config()to check if website is enabled - If disabled (default), commands work purely locally
- When enabled, stubs will make API calls
Benefits of Project-Local Storage
- Version Control Friendly:
.tinytorch/can be gitignored or committed - Project-Specific: Each TinyTorch project has its own community profile
- Portable: Easy to move/share projects with their data
- Privacy: Data stays in project, not in home directory
Migration Notes
If you had data in ~/.tinytorch/, you can migrate:
# Copy old data to new location
cp -r ~/.tinytorch/community .tinytorch/
cp ~/.tinytorch/config.json .tinytorch/config.json # if exists
The new system will automatically use .tinytorch/ in the project root.