Repository navigation
Conversation
Nano and Super stay on the pinned release:1.3.0rc22 image. Edge is served from a source build that includes Cosmos3EdgeForConditionalGeneration. Signed-off-by: Yiming Zhao <yimingz@nvidia.com>
| "if [[ -f /tmp/cosmos3-edge-reasoner-trtllm.pid ]]; then\n", | ||
| " old_pid=\"$(cat /tmp/cosmos3-edge-reasoner-trtllm.pid)\"\n", | ||
| " if kill -0 \"$old_pid\" 2>/dev/null; then\n", | ||
| " kill \"$old_pid\" 2>/dev/null || true\n", |
There was a problem hiding this comment.
Please check that this PID still belongs to the Edge server before killing it. A stale PID file can point to an unrelated process after the PID gets reused. Also, wait runs in a new %%bash shell here, so it cannot wait for the server started by a previous cell. We need to wait for that server to exit before reusing port 8001.
There was a problem hiding this comment.
The launch cell now reads /proc/<pid>/cmdline and kills the recorded PID only when it is still trtllm-serve nvidia/Cosmos3-Edge. A stale PID that belongs to another process is left alone.
wait cannot reap a background process started by an earlier cell, so the new cell polls until that process exits. It also refuses to start while port 8001 still has a listening socket.
| "nohup env CUDA_VISIBLE_DEVICES=0 trtllm-serve nvidia/Cosmos3-Edge \\\n", | ||
| " --host 0.0.0.0 --port 8001 --max_num_tokens 32768 \\\n", | ||
| " > /tmp/cosmos3-edge-reasoner-trtllm.log 2>&1 &\n", | ||
| "echo $! > /tmp/cosmos3-edge-reasoner-trtllm.pid\n", |
There was a problem hiding this comment.
The shutdown cell at the end only runs docker rm -f cosmos3-reasoner-trtllm, so it leaves this Edge server running and holding GPU memory. Please add an Edge shutdown path that stops the server started by this notebook and waits for it to exit.
There was a problem hiding this comment.
The shutdown cell now stops the Edge server as well as the Nano/Super container. It uses the same PID check, so it only signals trtllm-serve nvidia/Cosmos3-Edge, and it waits until that process exits. If Docker is unavailable, the cell skips the container removal instead of failing.
| " (tensorrt-llm ≥ 1.3.0rc22). A cell below pulls it (~20 GB on first run).\n", | ||
| "- Docker with the NVIDIA Container Toolkit (`--runtime nvidia` / `--gpus`) for Nano and Super.\n", | ||
| "- The `nvcr.io/nvidia/tensorrt-llm/release:1.3.0rc22` image for Nano and Super. A cell below pulls it (~20 GB on first run).\n", | ||
| " Do not use this image for Edge.\n", |
There was a problem hiding this comment.
Please make the image-pull cell Nano/Super-only, or tell Edge users to skip it. It currently runs docker pull unconditionally, so following the Edge setup on a machine without Docker fails even though Edge runs from source.
There was a problem hiding this comment.
The image-pull cell is Nano/Super-only. If Docker is missing or the daemon is down, it prints a skip message and exits 0, so an Edge-only machine can run the notebook without pulling release:1.3.0rc22.
| **Cosmos3-Nano** or **Cosmos3-Super**, waits for the server to become healthy, | ||
| [`run_with_tensorrt_llm.ipynb`](./run_with_tensorrt_llm.ipynb) launches | ||
| **Cosmos3-Nano** or **Cosmos3-Super** from the pinned release image, or | ||
| **Cosmos3-Edge** from a source build that includes |
There was a problem hiding this comment.
Could we use the same request as the Cosmos Framework Edge example? Framework asks for a one-sentence description, limits generation to 1024 tokens, and disables sampling. Here we ask for a detailed caption, allow 4096 tokens, and leave sampling enabled.
I ran TensorRT-LLM with the Framework settings and got essentially the same final caption. Matching the settings would make the examples easier to compare.
There was a problem hiding this comment.
The TensorRT-LLM quickstart now uses the same request as the Cosmos Framework Edge example: “Describe what is happening in this image in one sentence.”, max_tokens=1024, and temperature=0. The later notebook examples are unchanged because they cover the other tasks.
pengcuo
left a comment
There was a problem hiding this comment.
Adding to @ishovkun's comments (PID reuse and wait in a fresh shell, missing Edge shutdown, unconditional docker pull, request parity), all of which I agree with. Two more:
- The Edge path depends on an unmerged TensorRT-LLM PR. NVIDIA/TensorRT-LLM#20307 is still open (head
ConstBob:cosmos3-edge-reasoner, mergeable state blocked as of today), and no release up to v1.4.0rc1 containsCosmos3EdgeForConditionalGeneration. The README tells readers to install "from a checkout that includes PR 20307" without naming a branch or commit, so the instructions cannot be followed from upstreammainor from any image. Either hold the Edge section until it ships in a release image (then pin that image like Nano/Super), or name the exact fork branch and commit and label the section as a preview. - The Edge launch cell runs
python -m pip install opencv-python-headlesswith whateverpythonis first on the%%bashPATH, which is not necessarily the environment that ownstrtllm-serve(the Nano/Super cells install it inside the container, where that is unambiguous). Install into the interpreter that owns the entry point, e.g."$(dirname "$(command -v trtllm-serve)")/python" -m pip install ..., or move it to the prerequisites.
The rest of the readiness cell reads correctly to me (Docker-absent branch, Edge PID liveness check).
|
|
||
| **Cosmos3-Edge** uses `Cosmos3EdgeForConditionalGeneration`. That release image | ||
| does not include the architecture. Install TensorRT-LLM from a checkout that | ||
| includes [PR 20307](https://github.com/NVIDIA/TensorRT-LLM/pull/20307), following |
There was a problem hiding this comment.
NVIDIA/TensorRT-LLM#20307 is open as of 2026-10-21 (head ConstBob:cosmos3-edge-reasoner), so there is no checkout on main or in a release that includes it. Name the branch and commit readers should build, or hold this section until the PR lands in a release image.
There was a problem hiding this comment.
TensorRT-LLM #20307 is now merged as 39a44fab. The docs tell readers to build upstream main at or after that commit.
Release images through v1.4.0rc1, including release:1.3.0rc22, still do not include Cosmos3EdgeForConditionalGeneration, so Edge stays a source build. Nano and Super stay on the pinned release:1.3.0rc22 image.
| " fi\n", | ||
| "fi\n", | ||
| "\n", | ||
| "python -m pip install --no-cache-dir opencv-python-headless\n", |
There was a problem hiding this comment.
python here is whatever the notebook's %%bash PATH resolves, not necessarily the interpreter that owns trtllm-serve. Install into that one ("$(dirname "$(command -v trtllm-serve)")/python" -m pip install ...) or drop the line and rely on the prerequisite in the shared README.
There was a problem hiding this comment.
The Edge cell now installs opencv-python-headless with the Python interpreter next to trtllm-serve ("$(dirname "$(command -v trtllm-serve)")/python" -m pip install ...), instead of whatever python is first on the notebook PATH.
Stop only a confirmed Edge server, shut that process down with the container, and skip the Nano/Super image pull when Docker is absent. Point the Edge source build at TensorRT-LLM main after 39a44fab. Signed-off-by: Yiming Zhao <yimingz@nvidia.com>
Summary
Add Cosmos3-Edge to the TensorRT-LLM Reasoner cookbook.
Cosmos3-Nano and Cosmos3-Super stay on the pinned
nvcr.io/nvidia/tensorrt-llm/release:1.3.0rc22image. That image does not includeCosmos3EdgeForConditionalGeneration, so Cosmos3-Edge is documented as a single-GPU server started from a TensorRT-LLM source build that includes NVIDIA/TensorRT-LLM#20307.Changes
cookbooks/cosmos3/README.mdtrtllm-servecommand on port 8001.cookbooks/cosmos3/reasoner/README.mdcookbooks/cosmos3/reasoner/run_with_tensorrt_llm.ipynbrelease:1.3.0rc22.trtllm-serve nvidia/Cosmos3-Edgefrom the current environment and exits with a clear message whentrtllm-serveis unavailable.Testing
bash -non every bash cell./healthserver:nvidia/Cosmos3-Edgecheckpoint, using a TensorRT-LLM environment that includes the Edge architecture.trtllm-serve nvidia/Cosmos3-Edge --host 0.0.0.0 --port 8001 --max_num_tokens 32768started successfully./healthbecame ready./v1/modelsreturnedCosmos3-Edge.assets/robot_153.jpgreturned a non-empty caption.The run used
max_tokens=128for the image request; the cookbook example keepsmax_tokens=4096. Nano and Super launch commands are unchanged and were not rerun.