From 3d68f3c77bfd9a44a9f8fbb5704141b4593bc73e Mon Sep 17 00:00:00 2001 From: Rkeramati Date: Sat, 25 Oct 2025 12:56:10 -0400 Subject: [PATCH 1/2] cuda on colab dependency issue --- pyproject.toml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6e3e566..016a7ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,11 +6,11 @@ build-backend = "hatchling.build" name = "minitorch" version = "0.5" description = "A minimal deep learning library for educational purposes" -requires-python = ">=3.8" +requires-python = ">=3.8,<3.12" dependencies = [ "colorama==0.4.6", "hypothesis==6.138.2", - "numba-cuda[cu12]>=0.4.0", ## cu12 is for CUDA 12.0 cu13 is for CUDA 13.0 + "numba>=0.61.2", "numpy<2.0", "pytest==8.4.1", "pytest-env==1.1.5", @@ -21,6 +21,9 @@ dependencies = [ dev = [ "pre-commit==4.3.0", ] +cuda = [ + "numba-cuda[cu12]>=0.4.0", +] extra = [ "datasets==2.4.0", "embeddings==0.0.8", @@ -30,7 +33,7 @@ extra = [ "python-mnist", "streamlit==1.48.1", "streamlit-ace", - "torch==2.8.0", + "torch>=2.9.0", "watchdog==1.0.2", "altair==4.2.2", ] From 996f125c4ce955336679713c9968bfe0782c98b5 Mon Sep 17 00:00:00 2001 From: Rkeramati Date: Sat, 25 Oct 2025 12:58:59 -0400 Subject: [PATCH 2/2] cuda on colab dependency issue --- installation.md | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/installation.md b/installation.md index 4baf55d..4127ce6 100644 --- a/installation.md +++ b/installation.md @@ -1,11 +1,16 @@ # MiniTorch Module 3 Installation -MiniTorch requires Python 3.8 or higher. To check your version of Python, run: +MiniTorch requires Python 3.11. To check your version of Python, run: ```bash >>> python --version ``` +If you don't have Python 3.11, install it before proceeding: +- **Mac**: `brew install python@3.11` +- **Ubuntu/Debian**: `sudo apt install python3.11` +- **Windows**: Download from python.org + We recommend creating a global MiniTorch workspace directory that you will use for all modules: @@ -19,14 +24,14 @@ We highly recommend setting up a *virtual environment*. The virtual environment **Option 1: Anaconda (Recommended)** ```bash ->>> conda create --name minitorch python # Run only once +>>> conda create --name minitorch python=3.11 # Run only once >>> conda activate minitorch ->>> conda install llvmlite # For optimization +>>> conda install llvmlite # For optimization ``` **Option 2: Venv** ```bash ->>> python -m venv venv # Run only once +>>> python3.11 -m venv venv # Run only once (requires Python 3.11) >>> source venv/bin/activate ``` @@ -41,6 +46,14 @@ Each assignment is distributed through a Git repo. Once you accept the assignmen >>> cd {{ASSIGNMENT}} ``` +## Installation + +Install all packages in your virtual environment: + +```bash +>>> python -m pip install -e ".[dev,extra]" +``` + ## Syncing Previous Module Files Module 3 requires files from Module 0, Module 1, and Module 2. Sync them using: