longcat: the new settings on the model page, and a compiler in the pod image (v0.2.78)

Configurable means configurable from the UI, not only from models.json. The
model page now carries the four settings added over the last commits — text
encoder quantisation, block-sparse attention, the base checkpoint an avatar
family borrows tokenizer/text_encoder/vae from, and the context-parallel tile —
each with the trade-off in the option text, because "nf4" means nothing without
"~2.8 GB, stays resident" beside it. They are in api_model_configure's
whitelist too, or the page would offer settings it then dropped on save.

And the RunPod image: block-sparse attention is pure Triton, Triton compiles its
CUDA driver module the first time it runs, and neither capability base image
carries a compiler. A pod would have failed with "Failed to find C compiler" on
the first denoising step — exactly how Surya failed in the local image before
v0.2.62. gcc and libc6-dev added, and the compiler test now covers this
Dockerfile alongside the two local ones, since checking only some of them is how
the gap got there in the first place.

Only this one pod image installs requirements-longcat.txt, so it is the whole
blast radius of the accelerate and bitsandbytes pins; the main venv already
carried bitsandbytes for the diffusers 4-bit path, in a separate venv, so there
is no conflict.
Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185zEBiy3KWB37xNGSrxL7w
parent 3b384924
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
# Canonical product version for CoderAI — single source of truth. Both the API # Canonical product version for CoderAI — single source of truth. Both the API
# metadata and the admin web UI read from here. # metadata and the admin web UI read from here.
__version__ = "0.2.77" __version__ = "0.2.78"
__tagline__ = "Complete orchestration, distribution and escalation of remotizable advanced inference." __tagline__ = "Complete orchestration, distribution and escalation of remotizable advanced inference."
# Configure the CUDA caching allocator BEFORE torch is imported anywhere. # Configure the CUDA caching allocator BEFORE torch is imported anywhere.
......
...@@ -2942,7 +2942,10 @@ async def api_model_configure(request: Request, username: str = Depends(require_ ...@@ -2942,7 +2942,10 @@ async def api_model_configure(request: Request, username: str = Depends(require_
"variant", "quality", "num_segments", "num_cond_frames", "cp_size", "variant", "quality", "num_segments", "num_cond_frames", "cp_size",
"longcat_source", "longcat_venv", "ref_img_index", "mask_frame_range", "longcat_source", "longcat_venv", "ref_img_index", "mask_frame_range",
"use_int8", "use_distill", "offload_kv_cache", "use_int8", "use_distill", "offload_kv_cache",
):
# LongCat component quantisation, block-sparse attention, the base
# checkpoint an avatar family borrows from, and the CP tile.
"text_encoder_quant", "bsa", "base_model", "cp_split_hw",):
if key in data: if key in data:
entry[key] = data[key] entry[key] = data[key]
# Work-parallel fan-out over engines and nodes (codai/cluster/fanout.py). # Work-parallel fan-out over engines and nodes (codai/cluster/fanout.py).
......
...@@ -704,9 +704,26 @@ window.__DEFAULT_WHISPER_SERVER_PATH__ = {{ default_whisper_server_path|tojson } ...@@ -704,9 +704,26 @@ window.__DEFAULT_WHISPER_SERVER_PATH__ = {{ default_whisper_server_path|tojson }
<option value="sequential">sequential — lowest VRAM, slowest</option> <option value="sequential">sequential — lowest VRAM, slowest</option>
</select></div> </select></div>
</div> </div>
<div style="display:grid;grid-template-columns:1fr 1fr;gap:.6rem;margin-top:.5rem">
<div class="form-row" style="margin:0"><label class="form-label">Text encoder</label>
<select id="cfg-longcat-te-quant" class="form-input">
<option value="">bf16 — ~11 GB, needs offload</option>
<option value="int8">int8 — ~5.6 GB, stays resident</option>
<option value="nf4">nf4 — ~2.8 GB, stays resident</option>
<option value="fp4">fp4 — ~2.8 GB, stays resident</option>
</select></div>
<div class="form-row" style="margin:0"><label class="form-label">Block-sparse attention</label>
<select id="cfg-longcat-bsa" class="form-input">
<option value="">off — dense attention</option>
<option value="on">on — needs sides /64 and 16n+13 frames</option>
<option value="auto">auto — on when triton is available</option>
</select></div>
</div>
<div style="display:grid;grid-template-columns:1fr 1fr 1fr;gap:.6rem;margin-top:.5rem"> <div style="display:grid;grid-template-columns:1fr 1fr 1fr;gap:.6rem;margin-top:.5rem">
<div class="form-row" style="margin:0"><label class="form-label">Segments <span class="muted">(blank = 1)</span></label><input type="number" id="cfg-longcat-segments" class="form-input" min="1" placeholder="1"></div> <div class="form-row" style="margin:0"><label class="form-label">Segments <span class="muted">(blank = 1)</span></label><input type="number" id="cfg-longcat-segments" class="form-input" min="1" placeholder="1"></div>
<div class="form-row" style="margin:0"><label class="form-label">Conditioning frames</label><input type="number" id="cfg-longcat-cond-frames" class="form-input" min="1" placeholder="13"></div> <div class="form-row" style="margin:0"><label class="form-label">Conditioning frames</label><input type="number" id="cfg-longcat-cond-frames" class="form-input" min="1" placeholder="13"></div>
<div class="form-row" style="margin:0"><label class="form-label">Base checkpoint <span class="muted">(avatar only)</span></label><input type="text" id="cfg-longcat-base-model" class="form-input" placeholder="meituan-longcat/LongCat-Video"></div>
<div class="form-row" style="margin:0"><label class="form-label">CP tile <span class="muted">(HxW)</span></label><input type="text" id="cfg-longcat-cp-split" class="form-input" placeholder="1x2"></div>
<div class="form-row" style="margin:0"><label class="form-label">Context-parallel GPUs</label><input type="number" id="cfg-longcat-cp" class="form-input" min="1" placeholder="1"></div> <div class="form-row" style="margin:0"><label class="form-label">Context-parallel GPUs</label><input type="number" id="cfg-longcat-cp" class="form-input" min="1" placeholder="1"></div>
</div> </div>
<div style="display:grid;grid-template-columns:1fr 1fr;gap:.6rem;margin-top:.5rem"> <div style="display:grid;grid-template-columns:1fr 1fr;gap:.6rem;margin-top:.5rem">
...@@ -4567,6 +4584,10 @@ function _populateCluster(m, s){ ...@@ -4567,6 +4584,10 @@ function _populateCluster(m, s){
set('cfg-longcat-variant', s.variant || 'bf16'); set('cfg-longcat-variant', s.variant || 'bf16');
set('cfg-longcat-quality', s.quality || 'fast'); set('cfg-longcat-quality', s.quality || 'fast');
set('cfg-longcat-offload', s.offload_strategy || ''); set('cfg-longcat-offload', s.offload_strategy || '');
set('cfg-longcat-te-quant', s.text_encoder_quant || '');
set('cfg-longcat-bsa', s.bsa || '');
set('cfg-longcat-base-model', s.base_model || '');
set('cfg-longcat-cp-split', s.cp_split_hw || '');
set('cfg-longcat-segments', s.num_segments || ''); set('cfg-longcat-segments', s.num_segments || '');
set('cfg-longcat-cond-frames', s.num_cond_frames || ''); set('cfg-longcat-cond-frames', s.num_cond_frames || '');
set('cfg-longcat-cp', s.cp_size || ''); set('cfg-longcat-cp', s.cp_size || '');
...@@ -4610,6 +4631,10 @@ function _collectCluster(){ ...@@ -4610,6 +4631,10 @@ function _collectCluster(){
out.variant = val('cfg-longcat-variant') || 'bf16'; out.variant = val('cfg-longcat-variant') || 'bf16';
out.quality = val('cfg-longcat-quality') || 'fast'; out.quality = val('cfg-longcat-quality') || 'fast';
out.offload_strategy = val('cfg-longcat-offload') || ''; out.offload_strategy = val('cfg-longcat-offload') || '';
out.text_encoder_quant = val('cfg-longcat-te-quant') || '';
out.bsa = val('cfg-longcat-bsa') || '';
out.base_model = val('cfg-longcat-base-model') || '';
out.cp_split_hw = val('cfg-longcat-cp-split') || '';
out.num_segments = num('cfg-longcat-segments'); out.num_segments = num('cfg-longcat-segments');
out.num_cond_frames = num('cfg-longcat-cond-frames'); out.num_cond_frames = num('cfg-longcat-cond-frames');
out.cp_size = num('cfg-longcat-cp'); out.cp_size = num('cfg-longcat-cp');
......
...@@ -45,7 +45,15 @@ RUN sed -i 's|^home *=.*|home = /opt/coderai/py310/bin|; \ ...@@ -45,7 +45,15 @@ RUN sed -i 's|^home *=.*|home = /opt/coderai/py310/bin|; \
assert sys.version_info[:2]==(3,10), sys.version; \ assert sys.version_info[:2]==(3,10), sys.version; \
assert torch.__version__.startswith('2.6'), torch.__version__" assert torch.__version__.startswith('2.6'), torch.__version__"
RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates \ # gcc and libc6-dev are RUNTIME requirements here, not build ones: Triton compiles its
# CUDA driver module the first time it is used, and block-sparse attention (longcat.bsa)
# is pure Triton. Without them a pod fails with "Failed to find C compiler" on the first
# denoising step — the same way Surya did in the local image before v0.2.62.
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
ca-certificates \
gcc \
libc6-dev \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# The pipeline code. Shallow, no history, no weights, no demo assets. # The pipeline code. Shallow, no history, no weights, no demo assets.
......
...@@ -25,7 +25,11 @@ ROOT = pathlib.Path(__file__).resolve().parents[1] ...@@ -25,7 +25,11 @@ ROOT = pathlib.Path(__file__).resolve().parents[1]
# and Dockerfile.oci otherwise. Checking only one is how gcc was added to the # and Dockerfile.oci otherwise. Checking only one is how gcc was added to the
# file that was not being used, and the build came out without a compiler. # file that was not being used, and the build came out without a compiler.
DOCKERFILES = [ROOT / "packaging" / "linux" / "Dockerfile.oci", DOCKERFILES = [ROOT / "packaging" / "linux" / "Dockerfile.oci",
ROOT / "packaging" / "linux" / "Dockerfile.oci-venv"] ROOT / "packaging" / "linux" / "Dockerfile.oci-venv",
# The LongCat pod image too: block-sparse attention is pure Triton, so a
# pod without a compiler dies on the first denoising step. Its bases
# (capability-base-light) carry no compiler, so it must add its own.
ROOT / "packaging" / "runpod" / "Dockerfile.capability-video-longcat"]
RUNPOD_VLLM_APT = ROOT / "packaging" / "runpod" / "profiles" / "vllm.apt" RUNPOD_VLLM_APT = ROOT / "packaging" / "runpod" / "profiles" / "vllm.apt"
......
...@@ -39,6 +39,13 @@ FIELDS = { ...@@ -39,6 +39,13 @@ FIELDS = {
"cfg-longcat-int8": "use_int8", "cfg-longcat-int8": "use_int8",
"cfg-longcat-distill": "use_distill", "cfg-longcat-distill": "use_distill",
"cfg-longcat-offload-kv": "offload_kv_cache", "cfg-longcat-offload-kv": "offload_kv_cache",
# Quantising the text encoder is what decides whether the pipeline can stay
# resident on a 24 GB card; BSA whether attention is sparse; base_model where an
# avatar family borrows tokenizer/text_encoder/vae; cp_split_hw the CP tile.
"cfg-longcat-te-quant": "text_encoder_quant",
"cfg-longcat-bsa": "bsa",
"cfg-longcat-base-model": "base_model",
"cfg-longcat-cp-split": "cp_split_hw",
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment