Getting started
Quickstart
To run Cascade on Sail without cloning anything, use Get started: name a workspace, paste a Sail API key, and open your app a few minutes later. This page runs the app on your laptop instead.
In this quickstart, we run the Cascade app on your laptop, upload a small stand-in trace, simulate it on two copies of the SM86_RTX3070 config, and download the results.
The simulators here are cascade worker --replay, which replays a recorded Accel-Sim log of BabelStream on an RTX 3070 instead of running Accel-Sim. Every number you see comes from that log, not from the trace you upload. The point is to see the whole loop work before you deploy for real.
Before you start#
You need these on your machine.
gitand uv. uv installs Python 3.12 for you.rclone, which serves the app's S3 endpoint. On macOS, runbrew install rclone.- Node 22, only if you want the web UI. Everything else works without it.
Run the loop#
- Clone and install.
git clone https://github.com/atoniolo76/cascade.git cd cascade uv syncTo get the web UI as well, build it once. The build lands in
cascade/static/, which the app serves.(cd web && npm ci && npm run build) - Start the app. This runs the API and UI on port 8000 and the S3 endpoint on port 9000. Leave it running and open a second terminal for the next steps.
export CASCADE_TOKEN=dev-token CASCADE_DATA_DIR=./data \ CASCADE_ACCELSIM_DIR=$PWD/tests/fixtures/accelsim \ CASCADE_SIM_CMD="$PWD/.venv/bin/cascade worker --replay $PWD/tests/fixtures/logs/babelstream_sm86_rtx3070.log" \ uv run cascade serveWhen the app is up, the log ends with this line.
INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit) - Make a stand-in trace. The replaying worker only checks that
traces/kernelslist.gexists, so one line is enough. A real trace comes from the profiler. See Trace a workload.export CASCADE_TOKEN=dev-token CASCADE_URL=http://127.0.0.1:8000 mkdir -p demo/traces echo kernel-1.traceg > demo/traces/kernelslist.g - Upload it.
scripts/upload_trace.pyuploads a directory the same way the profiler does and sendsmetadata.jsonlast. The two--metaflags tell the app which GPU architecture the trace is for and which config to suggest.uv run python scripts/upload_trace.py demo --run-name demo \ --meta trace_gpu_arch=sm_86 --meta suggested_sim_config=SM86_RTX3070You see each file go up.
uploaded traces/kernelslist.g (16 bytes) uploaded metadata.json (1 files listed) to s3://cascade/accelsim-traces/demo/ - Wait for the trace to be ready. The app scans the bucket every 2 seconds. Because the upload already has
kernelslist.g, it skips post-processing.curl -s -H "Authorization: Bearer $CASCADE_TOKEN" "$CASCADE_URL/api/traces/demo"Repeat until the response has
"state":"ready". It takes a few seconds. - Launch a run. This asks for two sims on
SM86_RTX3070and saves the run's id.RUN=$(curl -s -X POST "$CASCADE_URL/api/runs" \ -H "Authorization: Bearer $CASCADE_TOKEN" \ -H "Content-Type: application/json" \ -d '{"trace_id": "demo", "entries": [{"gpu_config": "SM86_RTX3070", "count": 2}]}' \ | python3 -c 'import json, sys; print(json.load(sys.stdin)["id"])') echo $RUN - Watch it finish. Each sim replays about 10,000 log lines and finishes in a few seconds.
curl -s -H "Authorization: Bearer $CASCADE_TOKEN" "$CASCADE_URL/api/runs/$RUN" \ | python3 -c 'import json, sys; r = json.load(sys.stdin); print(r["state"], r["sim_counts"])'When both sims are done, you see this.
succeeded {'succeeded': 2}If you built the UI, open http://127.0.0.1:8000, paste
dev-token, and open the run to see the same thing live. - Download the results. This saves one JSON file with the run, the trace, every sim's per-kernel stats, and the comparison.
curl -s -OJ -H "Authorization: Bearer $CASCADE_TOKEN" "$CASCADE_URL/api/runs/$RUN/results"The file is named
<run id>-results.json. Reading results explains what's in it.
To stop, press Ctrl+C in the first terminal. The app stops rclone too. Your traces and runs stay in ./data for next time.
Next steps#
- Concepts explains what a trace, a run and a sim are, and how their states move.
- Deploy the app runs the same app on Sail, where each sim is its own sandbox.
- Bring your own simulator replaces the replay with Accel-Sim or anything else.