Skip to content

feat: add --high-mem for high-RAM machine shape selection - #105

Open
zoutei wants to merge 1 commit into
googlecolab:mainfrom
zoutei:feat-high-mem-shape
Open

feat: add --high-mem for high-RAM machine shape selection#105
zoutei wants to merge 1 commit into
googlecolab:mainfrom
zoutei:feat-high-mem-shape

Conversation

@zoutei

@zoutei zoutei commented Aug 10, 2026

Copy link
Copy Markdown

Summary

Adds a --high-mem flag to request high-RAM machine shapes when allocating runtimes. This matches the Colab web UI and colab-vscode, which send shape=hm on /tun/m/assign.

  • colab new, colab run, and colab ssh (auto-create only) accept --high-mem
  • colab sessions and colab status show machine shape (Standard / High-RAM)
  • L4 and TPU accelerators ignore the flag (single-shape only), with a stderr notice

Partially addresses #47 (section 1 only).

Changes

  • Pass shape=hm through the assign client for supported accelerators
  • Add --high-mem to new, run, and ssh
  • Persist machine_shape in session state
  • Update README and design docs

Testing

Tested manually on Colab Pro with uv run pytest tests/ (341 passed).

Allocation and shape

  • colab new --high-mem → High-RAM CPU, ~54.8 GB RAM
  • colab new (no flag) → Standard CPU, ~13.6 GB RAM
  • colab new --gpu T4 --high-mem → High-RAM T4, ~54.8 GB RAM
  • colab new --gpu L4 --high-mem → ignore message, Standard shape
  • colab new --tpu v5e1 --high-mem → ignore message

Run and display

  • colab run --high-mem and colab run --gpu T4 --high-mem --keep → High-RAM in sessions/status
  • colab ssh -s <existing> --high-mem → warning that flag is ignored on existing sessions

@google-cla

google-cla Bot commented Aug 10, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant