You can run the code either:
- Remotely using an AWS SageMaker environment.
- Locally on your own machine.
The setup differs slightly due to AWS S3 access and GPU availability.
Important: SageMaker instances incur costs while running. Make sure to stop your instance when you're done.
- Go to the AWS Console and search for “Amazon SageMaker AI”.
- Open “SageMaker Studio”.
- Click “Open Studio” to launch the environment.
You can use different SageMaker spaces:
- Code Editor (VSCode) -> Recommended for a full development workflow (terminal, Git, debugging)
- JupyterLab
Choose based on your preference.
Recommended settings:
- Instance type:
ml.g5.xlarge
See Vantage for pricing and GPU details. - Volume size:
- Measurement data: < 20 GB
- Weather data: < 1 GB
- Logs: potentially large
→ Recommended: 250 GB
Note: Increasing storage after initial allocation may cause errors.
Use either:
- GitHub integration in VSCode, or
- Git CLI
On first boot:
cd s4casting
bash setup.shThis will:
- Install python package manager (uv)
- Install CUDA
- Install common development packages / toolchain support
Takes a few minutes. Only needed once per instance.
You can download all the data with the following command:
bash data/get_data.shNote: These local setup instructions target WSL (Ubuntu) or native Linux. Use WSL on Windows.
Uv is a python dependency manager, a replacement for the traditional requirements.txt file. Create the virtual environment and install dependencies:
pip install uv
uv venv
uv sync --python 3.12From the home directory run:
./data/get_data.shIf you want to train locally with GPU acceleration, you need to install CUDA.
There are several ways to do this depending on your environment, for example using system packages:
# Add NVIDIA keyring and repo
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get install -y cuda-toolkit-12-4Some corporate environments require all package downloads to go through an
internal registry mirror rather than public PyPI. The committed uv.lock
always resolves from public PyPI (it is the basis for publicly reproducible
builds and is kept up to date automatically); CI rejects lockfiles resolved
against private registries.
If your environment requires a mirror, configure it as uv's default index globally on your machine (see the uv index documentation), then keep your locally-resolved lockfile out of git:
make lock-local— marksuv.lockas locally managed (git update-index --skip-worktree) and resolves it through your default index. Re-run it regularly to pick up refreshed dependency versions.make lock-reset— restores the committed lockfile. Run it before pulling or switching branches wheneveruv.lockchanged upstream, then re-runmake lock-local.