### Quick Start Workflow Source: https://github.com/harvard-edge/cs249r_book/blob/dev/book/docs/DEVELOPMENT.md Standard commands for initial setup, daily development, and chapter-specific tasks. ```bash # First time setup ./binder setup # Configure environment and tools # Daily workflow (most common commands) ./binder clean # Clean build artifacts ./binder build # Build HTML (complete book) ./binder doctor # Health check # Preview & development ./binder preview intro # Preview a chapter with live reload ./binder build intro # Build specific chapter ``` -------------------------------- ### Setup Development Environment Source: https://github.com/harvard-edge/cs249r_book/blob/dev/tinytorch/CONTRIBUTING.md Commands to clone the repository, create a virtual environment, and install dependencies in editable mode. ```bash git clone https://github.com/harvard-edge/cs249r_book.git cd cs249r_book/tinytorch python3 -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate pip install -r requirements.txt pip install -e ./ ``` -------------------------------- ### Clone and Setup StaffML Source: https://github.com/harvard-edge/cs249r_book/blob/dev/interviews/CONTRIBUTING.md Steps to clone the repository, set up the development environment, and install the vault-cli. ```bash # 1. Clone and pick the staffml worktree git clone https://github.com/harvard-edge/cs249r_book.git cd cs249r_book/interviews # 2. Install vault-cli (Python 3.12+) pip install -e vault-cli/[dev] vault --version pytest vault-cli/tests/ ``` -------------------------------- ### Initialize Development Environment Source: https://github.com/harvard-edge/cs249r_book/blob/dev/book/docs/CONTRIBUTING.md Run the one-time setup command to install pre-commit hooks and verify tooling. ```bash ./book/binder setup ``` -------------------------------- ### Clone TinyTorch Repository and Setup Environment Source: https://github.com/harvard-edge/cs249r_book/blob/dev/tinytorch/quarto/community/about.html Clone the TinyTorch book repository and run the setup command to install dependencies, create a user profile, and initialize your workspace. You will be prompted to log in to the TinyTorch community. ```bash $ git clone https://github.com/harvard-edge/cs249r_book.git $ cd TinyTorch $ tito setup ``` -------------------------------- ### Clone Repository and Setup Environment Source: https://github.com/harvard-edge/cs249r_book/blob/dev/mlperf-edu/examples/GETTING_STARTED.md Clone the MLPerf EDU repository, create a virtual environment, and install the package. ```bash git clone https://github.com/harvard-edge/mlperf-edu.git cd mlperf-edu python3 -m venv .venv source .venv/bin/activate pip install -e . ``` -------------------------------- ### Cross-Reference Generation Setup Source: https://github.com/harvard-edge/cs249r_book/blob/dev/book/tools/dependencies/README.md Installs the full set of dependencies required for ML tools and then runs the cross-reference generation script. ```bash # Use full dependencies for ML tools pip install -r tools/dependencies/requirements.txt python tools/scripts/cross_refs/cross_refs.py ``` -------------------------------- ### Install and Install Pre-commit Hooks Source: https://github.com/harvard-edge/cs249r_book/blob/dev/CONTRIBUTING.md Install the pre-commit tool and set up the repository's pre-commit hooks. This should be done once per clone to ensure code quality checks are performed before commits. ```bash pip install pre-commit pre-commit install ``` -------------------------------- ### Install via pip fallback Source: https://github.com/harvard-edge/cs249r_book/blob/dev/mlperf-edu/INSTALL.md Standard virtual environment installation using pip. ```bash cd mlperf-edu python3 -m venv .venv . .venv/bin/activate python -m pip install --upgrade pip python -m pip install -e ".[dev]" mlperf doctor ``` -------------------------------- ### Local Worker Development Setup Source: https://github.com/harvard-edge/cs249r_book/blob/dev/interviews/staffml/worker/README.md Install dependencies and start a local development server for your worker. Use curl in another terminal to test API endpoints. ```bash npm install wrangler dev # in another terminal: curl -X POST http://localhost:8787/ask \ -H "Content-Type: application/json" \ -d '{"question": "what is the latency budget?", "context": "DLRM-style recommender, 50 sparse lookups per request"}' ``` -------------------------------- ### Binder CLI Quick Start Commands Source: https://github.com/harvard-edge/cs249r_book/blob/dev/book/docs/BINDER.md Common commands for setting up, building, previewing, and checking the project repository. ```bash # First time setup (from repository root) ./book/binder setup ./book/binder doctor # Build & preview — primary author commands (see BUILD.md) ./book/binder build html --vol1 vol1/training ./book/binder preview vol1/introduction # Checks — usually pre-commit only; run locally when debugging a failed hook ./book/binder check cli ./book/binder check all --vol1 ./book/binder check refs --path book/quarto/contents/vol1/introduction/introduction.qmd # Fixes — maintenance / repair (rare in daily chapter work) ./book/binder fix repo-health ./book/binder fix headers add --vol1 --dry-run # Live command reference ./book/binder help ./book/binder check refs help # per-group scopes and error codes ``` -------------------------------- ### Install Pre-commit Git Hooks Source: https://github.com/harvard-edge/cs249r_book/blob/dev/book/tools/scripts/docs/README.md Install the pre-commit framework and its associated git hooks. This setup automates code quality checks before each commit. ```bash pip install -r requirements.txt ``` ```bash pre-commit install ``` -------------------------------- ### Configure environment and get help Source: https://github.com/harvard-edge/cs249r_book/blob/dev/book/docs/DEVELOPMENT.md Commands to initialize the development environment and display project overview information. ```bash # Run setup ./binder setup # Get welcome and overview ./binder hello ``` -------------------------------- ### Set Up Development Environment Source: https://github.com/harvard-edge/cs249r_book/blob/dev/book/docs/BUILD.md Initializes the development environment, including setting up necessary tools and configurations. ```bash ./binder setup ``` -------------------------------- ### Build the site locally Source: https://github.com/harvard-edge/cs249r_book/blob/dev/instructors/README.md Commands to navigate to the directory and start the local development server using Quarto. ```bash cd instructors/ quarto preview ``` -------------------------------- ### Initialize Compression Environment Source: https://github.com/harvard-edge/cs249r_book/blob/dev/mlsysim/tutorial/exercises.md Sets up the required hardware, model, and compression solver instances. ```python from mlsysim import Engine, Hardware, Models from mlsysim.solvers import CompressionModel compress = CompressionModel() model = Models.Language.Llama3_8B hw = Hardware.Cloud.H100 ``` -------------------------------- ### Development Setup Commands Source: https://github.com/harvard-edge/cs249r_book/blob/dev/book/docs/DEVELOPMENT.md Commands to initialize the development environment and run tests. ```bash make setup-hooks && make install ``` ```bash make test && make build-all ``` -------------------------------- ### Initialize ServingModel and Hardware Source: https://github.com/harvard-edge/cs249r_book/blob/dev/mlsysim/tutorial/exercises.md Sets up the simulation environment with the Llama3-8B model and H100 hardware. ```python from mlsysim import Hardware, Models from mlsysim.solvers import ServingModel serving = ServingModel() model = Models.Language.Llama3_8B hw = Hardware.Cloud.H100 ``` -------------------------------- ### Local Worker Development Setup Source: https://github.com/harvard-edge/cs249r_book/blob/dev/socratiq/README.md Steps to set up local development for Cloudflare Workers. Ensure `USE_LOCAL_WORKERS` is set to `true` in `env_configs.js` before starting the widget dev server. ```bash # 1. Start the Cloudflare Worker locally (in cloudflare/proxy-worker/) wrangler dev # 2. Set USE_LOCAL_WORKERS = true in env_configs.js # 3. Start the widget dev server npm run dev ``` -------------------------------- ### Analytics Summary Response Source: https://github.com/harvard-edge/cs249r_book/blob/dev/interviews/staffml/analytics-worker/README.md Example JSON response from the GET / endpoint, providing an aggregate summary of analytics data. Includes total events, recent activity, and score distributions. ```json { "totalEvents": 1234, "last7Days": { "uniqueSessions": 42, "questionsScored": 380, "gauntletsCompleted": 15, "eventsByDay": { "2026-04-01": 50, ... }, "scoresByLevel": { "L3": { "total": 120, "count": 50, "avg": "2.40" } } } } ``` -------------------------------- ### Run Release Validation E2E Tests Source: https://github.com/harvard-edge/cs249r_book/blob/dev/tinytorch/tests/e2e/README.md Execute Level 4 tests to simulate a fresh git clone, perform full setup through milestone 01, test pip installability, and conduct comprehensive verification. This takes approximately 30 minutes. ```bash ./tests/e2e/validate_release.sh ``` -------------------------------- ### Start live preview server Source: https://github.com/harvard-edge/cs249r_book/blob/dev/book/docs/DEVELOPMENT.md Command to launch the development server which supports automatic reloading on file changes. ```bash # Start live preview server ./binder preview # The server will automatically reload when you save changes ``` -------------------------------- ### Install and Verify mlsysim Source: https://github.com/harvard-edge/cs249r_book/blob/dev/mlsysim/tutorial/instructor-quickstart.md Install the library via pip and verify the installation by printing the version. ```bash pip install mlsysim python3 -c "import mlsysim; print(mlsysim.__version__)" # Should print: 0.1.0 ``` -------------------------------- ### Setup Development Environment Script Source: https://github.com/harvard-edge/cs249r_book/blob/dev/tinytorch/tools/dev/README.md Execute this script from the project root to set up the development environment. ```bash # From project root ./tools/dev/setup.sh ``` -------------------------------- ### Install and Verify MLSys·im Source: https://github.com/harvard-edge/cs249r_book/blob/dev/mlsysim/RELEASE_NOTES_0.1.2.md Install the package via pip and verify the installation version and basic evaluation command. ```bash pip install mlsysim==0.1.2 ``` ```bash python -c "import mlsysim; print(mlsysim.__version__)" mlsysim eval Llama3_8B H100 --batch-size 32 ``` -------------------------------- ### Check Chocolatey Installation Source: https://github.com/harvard-edge/cs249r_book/blob/dev/book/docker/windows/README.md Verify that Chocolatey, the package manager used for installing some dependencies, is installed and accessible within the container. ```powershell docker run mlsysbook-windows choco --version ``` -------------------------------- ### Margin Video with Start Time Source: https://github.com/harvard-edge/cs249r_book/blob/dev/book/quarto/_extensions/mlsysbook-ext/margin-video/README.md Embed a YouTube video in the margin and specify a start time in seconds using the `start` option. ```markdown {{< margin-video "https://youtu.be/aircAruvnKk" "Neural Networks" "3Blue1Brown" start="120" >}} ``` -------------------------------- ### Install Inkscape and Ghostscript using Chocolatey Source: https://github.com/harvard-edge/cs249r_book/blob/dev/book/docs/BUILD.md Execute these PowerShell commands as an administrator to install Chocolatey and then use it to install Inkscape and Ghostscript on Windows. ```powershell # Install Chocolatey if not already installed Set-ExecutionPolicy Bypass -Scope Process -Force [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) # Install tools choco install inkscape ghostscript -y ``` -------------------------------- ### Preview site with live reload Source: https://github.com/harvard-edge/cs249r_book/blob/dev/kits/README.md Start a local development server to preview changes in real-time. ```bash quarto preview ``` -------------------------------- ### Install Quarto CLI on Linux Source: https://github.com/harvard-edge/cs249r_book/blob/dev/book/docs/BUILD.md Download and install the Quarto CLI Debian package for Linux systems. Test the installation by checking the version. ```bash wget https://github.com/quarto-dev/quarto-cli/releases/download/v1.9.27/quarto-1.9.27-linux-amd64.deb sudo dpkg -i quarto-1.9.27-linux-amd64.deb ``` ```bash quarto --version ```